Implements a url-shortener (Closes #1042).
[platal.git] / modules / auth / auth.inc.php
index 186506a..fc9cf18 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2010 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -62,11 +62,10 @@ function gpex_make($chlg, $privkey, $datafields, $charset)
         } else if (isset($personnal_data[$val])) {
             $params .= gpex_prepare_param($val, $personnal_data[$val], $tohash, $charset);
         } else if ($val == 'username') {
-            $res = XDB::query("SELECT  alias
-                                 FROM  aliases
-                                WHERE  uid = {?} AND FIND_IN_SET('bestalias', flags)",
-                              S::i('uid'));
-            $min_username = $res->fetchOneCell();
+            $min_username = $XDB::fetchOneCell('SELECT  email
+                                                  FROM  email_source_account
+                                                 WHERE  uid = {?} FIND_IN_SET(\'bestalias\', flags)',
+                                               S::i('uid'));
             $params      .= gpex_prepare_param($val, $min_username, $tohash, $charset);
         } else if ($val == 'grpauth') {
             if (isset($_GET['group'])) {