Merge branch 'master' of /home/git/platal
[platal.git] / plugins / insert.getUserName.php
index 56e02b3..08dd7df 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -23,14 +23,14 @@ function smarty_insert_getUsername()
 {
     global $globals;
 
-    $id = Cookie::getInt('ORGuid', -1);
+    $id = Cookie::i('ORGuid', -1);
     $id = S::v($_SESSION['uid'], $id);
-    
+
     if ($id<0) {
         return "";
     }
 
-    if (Cookie::get('ORGdomain', 'login') != 'alias') {
+    if (Cookie::v('ORGdomain', 'login') != 'alias') {
        $res = XDB::query("SELECT  alias FROM aliases
                                      WHERE  id={?} AND (type IN ('a_vie','alias') AND FIND_IN_SET('bestalias', flags))", $id);
        return $res->fetchOneCell();
@@ -40,7 +40,7 @@ function smarty_insert_getUsername()
                  FROM virtual AS v
            INNER JOIN virtual_redirect USING(vid)
            INNER JOIN aliases AS a ON(id={?} AND a.type='a_vie')
-                 WHERE redirect = CONCAT(a.alias, {?}) 
+                 WHERE redirect = CONCAT(a.alias, {?})
                       OR redirect = CONCAT(a.alias, {?})",
                $id, "@".$globals->mail->domain, "@".$globals->mail->domain2);
        $alias = $res->fetchOneCell();
@@ -48,6 +48,7 @@ function smarty_insert_getUsername()
      }
 
      return $login;
-     
 }
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>