From: Stéphane Jacob Date: Thu, 5 Aug 2010 14:18:43 +0000 (+0200) Subject: Uses default password checker and hasher JS function in admin page. X-Git-Tag: xorg/1.0.1~282 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=2477a631eb7b6dbcfe5368da1886e5f0c84e3427;p=platal.git Uses default password checker and hasher JS function in admin page. Signed-off-by: Stéphane Jacob --- diff --git a/htdocs/javascript/password.js b/htdocs/javascript/password.js index 4e8b1b9..578e345 100644 --- a/htdocs/javascript/password.js +++ b/htdocs/javascript/password.js @@ -20,6 +20,7 @@ function hashResponse(password1, password2, hasConfirmation) { pw1 = $('[name=' + password1 + ']').val(); + if (hasConfirmation) { pw2 = $('[name=' + password2 + ']').val(); if (pw1 != pw2) { @@ -27,7 +28,10 @@ function hashResponse(password1, password2, hasConfirmation) { return false; } $('[name=' + password2 + ']').val(''); + } else if (pw1 == '********') { + return true; } + if (pw1.length < 6) { alert("\nErreur : le nouveau mot de passe doit faire au moins 6 caractères !"); return false; diff --git a/modules/admin.php b/modules/admin.php index 70418e4..92a6493 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -433,12 +433,12 @@ class AdminModule extends PLModule Post::s('sex'), $user->profile()->id()); } } - if (!Post::blank('hashpass')) { - $to_update['password'] = Post::s('hashpass'); + if (!Post::blank('pwhash')) { + $to_update['password'] = Post::s('pwhash'); require_once 'googleapps.inc.php'; $account = new GoogleAppsAccount($user); if ($account->active() && $account->sync_password) { - $account->set_password(Post::s('hashpass')); + $account->set_password(Post::s('pwhash')); } } if (!Post::blank('weak_password')) { @@ -640,6 +640,7 @@ class AdminModule extends PLModule $page->addJsLink('jquery.ui.core.js'); $page->addJsLink('jquery.ui.tabs.js'); + $page->addJsLink('password.js'); // Displays last login and last host information. $res = XDB::query("SELECT start, host diff --git a/templates/admin/user.tpl b/templates/admin/user.tpl index 895f7ff..7db27fa 100644 --- a/templates/admin/user.tpl +++ b/templates/admin/user.tpl @@ -35,13 +35,6 @@