X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fgoogleapps.php;h=263a24d3f5156611c95d8b7aa998b14f9c3db855;hb=aabb817adfe803f869cf01ebede47cceb005544d;hp=e75ce5c6560367b889b6fe849e63a3e84bd55ec8;hpb=fe13bc1d7ba9f72d452ec07baf8538a74b7c67b8;p=platal.git diff --git a/modules/googleapps.php b/modules/googleapps.php index e75ce5c..263a24d 100644 --- a/modules/googleapps.php +++ b/modules/googleapps.php @@ -41,7 +41,7 @@ class GoogleAppsModule extends PLModule require_once("emails.inc.php"); require_once("googleapps.inc.php"); $page->changeTpl('googleapps/index.tpl'); - $page->addJsLink('motdepasse.js'); + $page->addJsLink('password.js'); $page->setTitle('Compte Google Apps'); $user = S::user(); @@ -69,9 +69,9 @@ class GoogleAppsModule extends PLModule } else { $account->set_password_sync(false); } - } elseif ($action == 'password' && Post::has('response2') && !$account->sync_password) { + } elseif ($action == 'password' && Post::has('pwhash') && Post::t('pwhash') && !$account->sync_password) { S::assert_xsrf_token(); - $account->set_password(Post::v('response2')); + $account->set_password(Post::t('pwhash')); } if ($action == 'suspend' && Post::has('suspend') && $account->active()) { @@ -102,9 +102,9 @@ class GoogleAppsModule extends PLModule $password_sync = Post::b('password_sync'); $redirect_mails = Post::b('redirect_mails'); if ($password_sync) { - $password = S::v('password'); + $password = $user->password(); } else { - $password = Post::v('response2'); + $password = Post::t('pwhash'); } $account->create($password_sync, $password, $redirect_mails);