'referent/country' => $this->make_hook('ref_country', AUTH_COOKIE, 'user', NO_AUTH),
'groupes-x' => $this->make_hook('xnet', AUTH_COOKIE),
+ 'groupes-x/logo' => $this->make_hook('xnetlogo', AUTH_PUBLIC),
'vcard' => $this->make_hook('vcard', AUTH_COOKIE),
'admin/binets' => $this->make_hook('admin_binets', AUTH_MDP, 'admin'),
$page->assign('assos', $req->fetchAllAssoc());
}
+ function handler_xnetlogo(&$page, $id)
+ {
+ if (is_null($id)) {
+ return PL_NOT_FOUND;
+ }
+
+ $res = XDB::query('SELECT logo, logo_mime
+ FROM groupex.asso
+ WHERE id = {?}', $id);
+ list($logo, $logo_mime) = $res->fetchOneRow();
+
+ if (!empty($logo)) {
+ header("Content-type: $mime");
+ echo $logo;
+ } else {
+ header('Content-type: image/jpeg');
+ readfile(dirname(__FILE__) . '/../htdocs/images/dflt_carre.jpg');
+ }
+
+ exit;
+ }
+
function handler_vcard(&$page, $x = null)
{
if (is_null($x)) {
<legend style="padding:4px"><strong><a href="http://www.polytechnique.net/login/{$asso.diminutif}">{$asso.nom}</a></strong></legend>
{if $asso.has_logo}
<a href="http://www.polytechnique.net/login/{$asso.diminutif}" style="width: 30%; display: block; float: right; ">
- <img alt="[ LOGO ]" src="http://www.polytechnique.net/{$asso.diminutif}/logo" style="width: 100%" />
+ <img alt="[ LOGO ]" src="{$globals->baseurl}/groupes-x/logo/{$asso.asso_id}" style="width: 100%" />
</a>
{/if}
<ul style="padding-top:0px;padding-bottom:0px">