From 312d41ce38d7845aaaf738a30654b27182e58e4f Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 16 Apr 2011 21:31:30 +0200 Subject: [PATCH] Disables xnet account by default, they will be set as pending after validation. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/xnetgrp.php | 5 ++--- upgrade/1.1.1/05_xnet_accounts.sql | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 upgrade/1.1.1/05_xnet_accounts.sql 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: -- 2.1.4