Provides accounts data for accounts without profile for authgroupex (Closes #1474).
authorStéphane Jacob <sj@m4x.org>
Mon, 25 Apr 2011 21:24:42 +0000 (23:24 +0200)
committerStéphane Jacob <sj@m4x.org>
Mon, 25 Apr 2011 21:55:42 +0000 (23:55 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
ChangeLog
modules/auth/auth.inc.php

index 915fd92..11a354e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@ VERSION 1.1.1                                                         XX XX XXXX
 
 Bug/Wish:
 
+    * Auth:
+        - #1474: Provides accounts data for accounts without profile       -JAC
+
     * Emails:
         - #1110: Improves email combobox                                   -JAC
         - #1459: Lists and administrates aliases on main domain            -JAC
index feed3d9..8e9a4cb 100644 (file)
@@ -48,7 +48,12 @@ function gpex_make($chlg, $privkey, $datafields, $charset)
         $personnal_data['prenom'] = $personnal_data['firstname'];
         $personnal_data['flags'] = $user->profile()->isFemale() ? 'femme' : '';
     } else {
-        $personnal_data = array();
+        // Missing fields: promo, entry_year, grad_year, ax_id, xorg_id, forlife
+        $personnal_data = array(
+            'lastname' => $user->lastname,
+            'firstname' => $user->firstname,
+            'sex' => $user->gender
+        );
     }
 
     foreach ($fieldarr as $val) {
@@ -66,7 +71,7 @@ function gpex_make($chlg, $privkey, $datafields, $charset)
                                                  FROM  email_source_account
                                                 WHERE  uid = {?} AND FIND_IN_SET(\'bestalias\', flags)',
                                               S::i('uid'));
-            $params      .= gpex_prepare_param($val, $min_username, $tohash, $charset);
+            $params .= gpex_prepare_param($val, (is_null($min_username) ? '', $min_username), $tohash, $charset);
         } else if ($val == 'grpauth') {
             if (isset($_GET['group'])) {
                 $res = XDB::query("SELECT  perms