From 0ea256b06f2a9428975bb52576e907c6c4987075 Mon Sep 17 00:00:00 2001 From: "Pierre Habouzit (MadCoder" Date: Wed, 15 Dec 2004 15:25:43 +0000 Subject: [PATCH] plugins ok git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-98 --- plugins/insert.getName.php | 5 +++-- plugins/insert.getUserName.php | 13 ++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) 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))"); -- 2.1.4