From: Stéphane Jacob Date: Fri, 18 Mar 2011 21:38:40 +0000 (+0100) Subject: Renames domain value for users loging with their hruid. Ensures the rigth username... X-Git-Tag: xorg/1.1.0~26^2~15 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=d05cf8d4ad0bba8aa4e053ede5f9dccb9b0c88fa;p=platal.git Renames domain value for users loging with their hruid. Ensures the rigth username is suggested to them. Signed-off-by: Stéphane Jacob --- diff --git a/classes/xorgsession.php b/classes/xorgsession.php index 25ade0d..400f809 100644 --- a/classes/xorgsession.php +++ b/classes/xorgsession.php @@ -148,7 +148,7 @@ class XorgSession extends PlSession WHERE email = {?} AND type = \'alias_aux\'', $uname); $loginType = 'uid'; - } else if (Post::s('domain') == "ax") { + } else if (Post::s('domain') == 'hruid') { $login = $uname; $loginType = 'hruid'; } else { diff --git a/plugins/insert.getUserName.php b/plugins/insert.getUserName.php index e8172fe..ce34a96 100644 --- a/plugins/insert.getUserName.php +++ b/plugins/insert.getUserName.php @@ -28,15 +28,22 @@ function smarty_insert_getUsername() return ''; } - if (Cookie::v('domain', 'login') != 'alias') { + $domain = Cookie::v('domain', 'login'); + if ($domain == 'hruid') { + return XDB::fetchOneCell('SELECT hruid + FROM accounts + WHERE uid = {?}', + $id); + } elseif ($domain == 'alias') { return XDB::fetchOneCell('SELECT email FROM email_source_account - WHERE uid = {?} AND type != \'alias_aux\' AND FIND_IN_SET(\'bestalias\', flags)', + WHERE uid = {?} AND type = \'alias_aux\'', $id); } else { return XDB::fetchOneCell('SELECT email FROM email_source_account - WHERE uid = {?} AND type = \'alias_aux\'', + WHERE uid = {?} AND type != \'alias_aux\' + ORDER BY NOT FIND_IN_SET(\'bestalias\', flags), MIN(email)', $id); } diff --git a/templates/core/password_prompt.tpl b/templates/core/password_prompt.tpl index a7e3a6b..6975a2c 100644 --- a/templates/core/password_prompt.tpl +++ b/templates/core/password_prompt.tpl @@ -56,7 +56,7 @@ - diff --git a/templates/platal/password.tpl b/templates/platal/password.tpl index 02cdee2..94dd077 100644 --- a/templates/platal/password.tpl +++ b/templates/platal/password.tpl @@ -68,7 +68,7 @@ - + strictement personnelle'} colspan="2"> diff --git a/templates/xnet/login.tpl b/templates/xnet/login.tpl index f92b8cb..749c243 100644 --- a/templates/xnet/login.tpl +++ b/templates/xnet/login.tpl @@ -28,7 +28,7 @@ Identifiant : - +