Initializes best_domain on promotion addition.
authorStéphane Jacob <sj@m4x.org>
Mon, 21 Nov 2011 13:05:38 +0000 (14:05 +0100)
committerStéphane Jacob <sj@m4x.org>
Mon, 21 Nov 2011 13:15:51 +0000 (14:15 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
modules/admin.php

index a2d5d59..7f86769 100644 (file)
@@ -853,6 +853,7 @@ class AdminModule extends PLModule
                   default:
                     $page->killError("La formation n'est pas reconnue : " . Env::t('edu_type') . '.');
                 }
+                $best_domain = User::$sub_mail_domains[$type] . Platal::globals()->mail->domain;
 
                 XDB::startTransaction();
                 foreach ($lines as $line) {
@@ -890,10 +891,10 @@ class AdminModule extends PLModule
                                                VALUES  (100, {?}, {?}, {?}, {?}, {?}, {?}, \'primary\')',
                                          $pid, $eduSchools[Profile::EDU_X], $degreeid, $entry_year, $grad_year, $promotion);
                             XDB::execute('INSERT INTO  accounts (hruid, type, is_admin, state, full_name, directory_name,
-                                                                 display_name, lastname, firstname, sex)
-                                               VALUES  ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})',
+                                                                 display_name, lastname, firstname, sex, best_domain)
+                                               VALUES  ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})',
                                          $infos['hrid'], $type, 0, 'pending', $fullName, $directoryName,
-                                         $infos[1], $infos[0], $infos[1], $sex);
+                                         $infos[1], $infos[0], $infos[1], $sex, $best_domain);
                             $uid = XDB::insertId();
                             XDB::execute('INSERT INTO  account_profiles (uid, pid, perms)
                                                VALUES  ({?}, {?}, {?})',