username fix
authorx2000habouzit <x2000habouzit>
Thu, 2 Sep 2004 18:46:49 +0000 (18:46 +0000)
committerx2000habouzit <x2000habouzit>
Thu, 2 Sep 2004 18:46:49 +0000 (18:46 +0000)
include/xorg.session.inc.php
templates/skin/default.tpl
templates/skin/noIE.tpl
templates/skin/sharky.tpl

index ff51000..387a12b 100644 (file)
@@ -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;
+    }
 }
 
 ?>
index 0e258f3..6aa5fa0 100644 (file)
@@ -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 $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -39,7 +39,7 @@
       <tr>
         <td>
           {dynamic}
-          {$smarty.session.suid} ({$smarty.session.username})
+          {$smarty.session.suid} ({$smarty.session.user_id})
           {/dynamic}
           [<a href="{"exit.php"|url}">exit</a>]
         </td>
index 50aa815..b811c9a 100644 (file)
@@ -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 $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -45,7 +45,7 @@
       {if $smarty.session.suid}
       <div id="suid">
         {dynamic}
-        {$smarty.session.suid} ({$smarty.session.username})
+        {$smarty.session.suid} ({$smarty.session.user_id})
         {/dynamic}
         [<a href="{"exit.php"|url}">exit</a>]
       </div>
index c6b1283..4fff93f 100644 (file)
@@ -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 $
  ***************************************************************************}
 
 <?xml version="1.0" encoding="iso-8859-1"?>
@@ -40,7 +40,7 @@
       <tr>
         <td>
           {dynamic}
-          {$smarty.session.suid} ({$smarty.session.username})
+          {$smarty.session.suid} ({$smarty.session.user_id})
           {/dynamic}
           [<a href="{"exit.php"|url}">exit</a>]
         </td>