From: x2003bruneau Date: Mon, 4 Dec 2006 21:20:27 +0000 (+0000) Subject: Fix authentification issues with the trombino on xnet X-Git-Tag: xorg/0.9.13~220 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=deb09f59cb5d77089e9734de1ff8fc3590e2886a;p=platal.git Fix authentification issues with the trombino on xnet git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1241 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/modules/xnet.php b/modules/xnet.php index 3eb6312..f46ec86 100644 --- a/modules/xnet.php +++ b/modules/xnet.php @@ -33,9 +33,31 @@ class XnetModule extends PLModule 'groupes.php' => $this->make_hook('groups2', AUTH_PUBLIC), 'plan' => $this->make_hook('plan', AUTH_PUBLIC), 'send_bug' => $this->make_hook('bug', AUTH_MDP), + 'photo' => $this->make_hook('photo', AUTH_MDP), ); } + function handler_photo(&$page, $x = null) + { + if (is_null($x)) { + return PL_NOT_FOUND; + } + + $res = XDB::query("SELECT attachmime, attach + FROM aliases + INNER JOIN photo ON(id = uid) + WHERE alias = {?}", $x); + + if ((list($type, $data) = $res->fetchOneRow())) { + Header("Content-type: image/$type"); + echo $data; + } else { + Header('Content-type: image/png'); + echo file_get_contents(dirname(__FILE__).'/../htdocs/images/none.png'); + } + exit; + } + function handler_bug(&$page) { $page->changeTpl('bug.tpl',SIMPLE); diff --git a/templates/include/trombi.tpl b/templates/include/trombi.tpl index 0776b85..2d7109a 100644 --- a/templates/include/trombi.tpl +++ b/templates/include/trombi.tpl @@ -29,7 +29,7 @@ {/if} -  [ PHOTO ] +  [ PHOTO ] {if $trombi_admin && $smarty.session.perms eq 'admin' && !$urlmainsite}