From: x2000habouzit Date: Mon, 22 Nov 2004 07:48:49 +0000 (+0000) Subject: some plugins reorg X-Git-Tag: xorg/old~850 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=5ce8cb4f74c7dde265b85bbf3d428db67079fb66;p=platal.git some plugins reorg --- diff --git a/include/xorg.common.inc.php b/include/xorg.common.inc.php index 0e8be88..ce43be2 100644 --- a/include/xorg.common.inc.php +++ b/include/xorg.common.inc.php @@ -18,7 +18,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: xorg.common.inc.php,v 1.9 2004-11-22 06:50:03 x2000habouzit Exp $ + $Id: xorg.common.inc.php,v 1.10 2004-11-22 07:48:49 x2000habouzit Exp $ ***************************************************************************/ // {{{ defines @@ -28,6 +28,7 @@ define("AUTH_PUBLIC", $i++); define("AUTH_COOKIE", $i++); define("AUTH_MDP", $i++); +define("PERMS_EXT", "ext"); define("PERMS_USER", "user"); define("PERMS_ADMIN", "admin"); diff --git a/include/insert.password.inc.php b/plugins/insert.getName.php similarity index 70% rename from include/insert.password.inc.php rename to plugins/insert.getName.php index 2d53ac0..9ae711c 100644 --- a/include/insert.password.inc.php +++ b/plugins/insert.getName.php @@ -18,33 +18,21 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: insert.password.inc.php,v 1.6 2004-11-17 10:12:45 x2000habouzit Exp $ + $Id: insert.getName.php,v 1.1 2004-11-22 07:48:50 x2000habouzit Exp $ ***************************************************************************/ -function smarty_insert_getName() { +function smarty_insert_getName() +{ global $globals; - if(empty($_COOKIE['ORGuid'])) return ""; + if (empty($_COOKIE['ORGuid'])) { + return ""; + } $res = $globals->db->query("SELECT prenom FROM auth_user_md5 WHERE user_id='{$_COOKIE['ORGuid']}'"); - if(list($prenom) = mysql_fetch_row($res)) { + if (list($prenom) = mysql_fetch_row($res)) { mysql_free_result($res); return $prenom; } return ""; } -function smarty_insert_getUsername() { - global $globals; - if(isset($_COOKIE['ORGuid'])) $id = $_COOKIE['ORGuid']; - if(isset($_SESSION['uid'])) $id = $_SESSION['uid']; - if(empty($id)) return ""; - $res = $globals->db->query("SELECT alias - FROM aliases - WHERE id='$id' AND (type='a_vie' OR type='alias') - ORDER BY !FIND_IN_SET('epouse',flags), LENGTH(alias) LIMIT 1"); - if(list($uname) = mysql_fetch_row($res)) { - mysql_free_result($res); - return $uname; - } - return ""; -} ?> diff --git a/plugins/insert.getUserName.php b/plugins/insert.getUserName.php new file mode 100644 index 0000000..6d81679 --- /dev/null +++ b/plugins/insert.getUserName.php @@ -0,0 +1,45 @@ +db->query("SELECT alias + FROM aliases + WHERE id='$id' AND (type IN ('a_vie','alias') AND FIND_IN_SET('bestalias', flags))"); + if (list($uname) = mysql_fetch_row($res)) { + mysql_free_result($res); + return $uname; + } + return ""; +} +?> diff --git a/templates/password_prompt.tpl b/templates/password_prompt.tpl index 0e0f1a6..c51b38b 100644 --- a/templates/password_prompt.tpl +++ b/templates/password_prompt.tpl @@ -17,7 +17,7 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: password_prompt.tpl,v 1.24 2004-11-13 13:17:08 x2000habouzit Exp $ + $Id: password_prompt.tpl,v 1.25 2004-11-22 07:48:50 x2000habouzit Exp $ ***************************************************************************}