From: Stéphane Jacob Date: Sat, 16 Apr 2011 19:31:30 +0000 (+0200) Subject: Disables xnet account by default, they will be set as pending after validation. X-Git-Tag: xorg/1.1.1~93 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=312d41ce38d7845aaaf738a30654b27182e58e4f;p=platal.git Disables xnet account by default, they will be set as pending after validation. Signed-off-by: Stéphane Jacob --- diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index fcff1ba..7b46cfd 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -727,9 +727,8 @@ class XnetGrpModule extends PLModule $full_name = "$firstname $lastname"; $directory_name = strtoupper($lastname) . " " . $firstname; } - XDB::execute('INSERT INTO accounts (hruid, display_name, full_name, directory_name, - email, type) - VALUES ({?}, {?}, {?}, {?}, {?}, \'xnet\')', + XDB::execute('INSERT INTO accounts (hruid, display_name, full_name, directory_name, email, type, state) + VALUES ({?}, {?}, {?}, {?}, {?}, \'xnet\', \'disabled\')', $hruid, $display_name, $full_name, $directory_name, $email); $user = User::get($hruid); } diff --git a/upgrade/1.1.1/05_xnet_accounts.sql b/upgrade/1.1.1/05_xnet_accounts.sql new file mode 100644 index 0000000..b8e94c0 --- /dev/null +++ b/upgrade/1.1.1/05_xnet_accounts.sql @@ -0,0 +1,8 @@ +-- Disables non-activated xnet accounts. + + UPDATE accounts AS a +LEFT JOIN register_pending_xnet AS r ON (r.uid = a.uid) + SET a.state = 'disabled' + WHERE a.password IS NULL AND a.type = 'xnet' AND r.hash IS NULL; + +-- vim:set syntax=mysql: