From c6cc53103600adfddb995040563c066c7d5b0718 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 21 Nov 2011 14:05:38 +0100 Subject: [PATCH] Initializes best_domain on promotion addition. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/admin.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/admin.php b/modules/admin.php index a2d5d59..7f86769 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -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 ({?}, {?}, {?})', -- 2.1.4