From: x2000habouzit Date: Thu, 2 Sep 2004 18:46:49 +0000 (+0000) Subject: username fix X-Git-Tag: xorg/old~1611 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=aa244ffd0a507555787c08d1a2aebfcf532556d7;p=platal.git username fix --- diff --git a/include/xorg.session.inc.php b/include/xorg.session.inc.php index ff51000..387a12b 100644 --- a/include/xorg.session.inc.php +++ b/include/xorg.session.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: xorg.session.inc.php,v 1.20 2004-09-02 18:23:02 x2000habouzit Exp $ + $Id: xorg.session.inc.php,v 1.21 2004-09-02 18:46:49 x2000habouzit Exp $ ***************************************************************************/ require("diogenes.core.session.inc.php"); @@ -258,6 +258,26 @@ function set_skin() { $_SESSION['skin'] = SKIN_COMPATIBLE; $_SESSION['skin_id'] = SKIN_COMPATIBLE_ID; } + + + function getUserId($auth,$username) { + global $globals; + + $res = $globals->db->query("SELECT id FROM aliases WHERE alias='$username'"); + list($uid) = mysql_fetch_row($res); + mysql_free_result($res); + return $uid; + } + + + function getUsername($auth,$uid) { + global $globals; + + $res = $globals->db->query("SELECT alias FROM aliases WHERE id='$uid' AND type='a_vie'"); + list($username) = mysql_fetch_row($res); + mysql_free_result($res); + return $username; + } } ?> diff --git a/templates/skin/default.tpl b/templates/skin/default.tpl index 0e258f3..6aa5fa0 100644 --- a/templates/skin/default.tpl +++ b/templates/skin/default.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: default.tpl,v 1.14 2004-08-31 11:25:43 x2000habouzit Exp $ + $Id: default.tpl,v 1.15 2004-09-02 18:46:49 x2000habouzit Exp $ ***************************************************************************} @@ -39,7 +39,7 @@ {dynamic} - {$smarty.session.suid} ({$smarty.session.username}) + {$smarty.session.suid} ({$smarty.session.user_id}) {/dynamic} [exit] diff --git a/templates/skin/noIE.tpl b/templates/skin/noIE.tpl index 50aa815..b811c9a 100644 --- a/templates/skin/noIE.tpl +++ b/templates/skin/noIE.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: noIE.tpl,v 1.2 2004-08-31 11:25:43 x2000habouzit Exp $ + $Id: noIE.tpl,v 1.3 2004-09-02 18:46:49 x2000habouzit Exp $ ***************************************************************************} @@ -45,7 +45,7 @@ {if $smarty.session.suid}
{dynamic} - {$smarty.session.suid} ({$smarty.session.username}) + {$smarty.session.suid} ({$smarty.session.user_id}) {/dynamic} [exit]
diff --git a/templates/skin/sharky.tpl b/templates/skin/sharky.tpl index c6b1283..4fff93f 100644 --- a/templates/skin/sharky.tpl +++ b/templates/skin/sharky.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: sharky.tpl,v 1.4 2004-08-31 11:25:43 x2000habouzit Exp $ + $Id: sharky.tpl,v 1.5 2004-09-02 18:46:49 x2000habouzit Exp $ ***************************************************************************} @@ -40,7 +40,7 @@ {dynamic} - {$smarty.session.suid} ({$smarty.session.username}) + {$smarty.session.suid} ({$smarty.session.user_id}) {/dynamic} [exit]