From: Pierre Habouzit (MadCoder Date: Wed, 15 Dec 2004 15:25:43 +0000 (+0000) Subject: plugins ok X-Git-Tag: xorg/old~650 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=0ea256b06f2a9428975bb52576e907c6c4987075;p=platal.git plugins ok git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-98 --- diff --git a/plugins/insert.getName.php b/plugins/insert.getName.php index 0dd3f3f..82b59fb 100644 --- a/plugins/insert.getName.php +++ b/plugins/insert.getName.php @@ -22,10 +22,11 @@ function smarty_insert_getName() { global $globals; - if (empty($_COOKIE['ORGuid'])) { + $uid = Cookie::get('ORGuid', -1); + if ($uid < 0) { return ""; } - $res = $globals->db->query("SELECT prenom FROM auth_user_md5 WHERE user_id='{$_COOKIE['ORGuid']}'"); + $res = $globals->db->query("SELECT prenom FROM auth_user_md5 WHERE user_id=$uid"); if (list($prenom) = mysql_fetch_row($res)) { mysql_free_result($res); return $prenom; diff --git a/plugins/insert.getUserName.php b/plugins/insert.getUserName.php index b1f06de..f33c263 100644 --- a/plugins/insert.getUserName.php +++ b/plugins/insert.getUserName.php @@ -22,15 +22,14 @@ function smarty_insert_getUsername() { global $globals; - if (isset($_COOKIE['ORGuid'])) { - $id = $_COOKIE['ORGuid']; - } - if (isset($_SESSION['uid'])) { - $id = $_SESSION['uid']; - } - if (empty($id)) { + + $id = Cookie::getInt('ORGuid', -1); + $id = Session::getInt($_SESSION['uid'], $id); + + if ($id<0) { return ""; } + $res = $globals->db->query("SELECT alias FROM aliases WHERE id='$id' AND (type IN ('a_vie','alias') AND FIND_IN_SET('bestalias', flags))");