Fix GoogleMaps links
[platal.git] / plugins / insert.getUserName.php
index 37ab6cd..ca14209 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
+ *  Copyright (C) 2003-2007 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -23,19 +23,19 @@ function smarty_insert_getUsername()
 {
     global $globals;
 
-    $id = Cookie::getInt('ORGuid', -1);
-    $id = Session::getInt($_SESSION['uid'], $id);
-    
+    $id = Cookie::i('ORGuid', -1);
+    $id = S::v($_SESSION['uid'], $id);
+
     if ($id<0) {
         return "";
     }
 
-    if (Cookie::get('ORGdomain', 'login') != 'alias') {
-       $res = $globals->xdb->query("SELECT  alias FROM aliases
+    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();
     } else {
-       $res = $globals->xdb->query("
+       $res = XDB::query("
                SELECT v.alias
                  FROM virtual AS v
            INNER JOIN virtual_redirect USING(vid)
@@ -48,6 +48,7 @@ function smarty_insert_getUsername()
      }
 
      return $login;
-     
 }
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>