X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fgoogleapps.php;h=c8988197211d6bd322a937c1bb70cb99cf1e251c;hb=1aff3b59c0f46dafe3396c1123a252645805e233;hp=72519bba938eb4846355878edad00e10ddbb0e81;hpb=71741ee039a6cc4a40b17b9a27120a55dfde7722;p=platal.git diff --git a/modules/googleapps.php b/modules/googleapps.php index 72519bb..c898819 100644 --- a/modules/googleapps.php +++ b/modules/googleapps.php @@ -1,6 +1,6 @@ $this->make_hook('index', AUTH_MDP, 'gapps'), - 'admin/googleapps' => $this->make_hook('admin', AUTH_MDP, 'admin'), - 'admin/googleapps/job' => $this->make_hook('admin_job', AUTH_MDP, 'admin'), - 'admin/googleapps/user' => $this->make_hook('admin_user', AUTH_MDP, 'admin'), + 'googleapps' => $this->make_hook('index', AUTH_PASSWD, 'gapps'), + 'admin/googleapps' => $this->make_hook('admin', AUTH_PASSWD, 'admin'), + 'admin/googleapps/job' => $this->make_hook('admin_job', AUTH_PASSWD, 'admin'), + 'admin/googleapps/user' => $this->make_hook('admin_user', AUTH_PASSWD, 'admin'), ); } @@ -49,11 +49,13 @@ class GoogleAppsModule extends PLModule // Fills up the 'is Google Apps redirection active' variable. $redirect_active = false; $redirect_unique = true; + $gapps_email = ''; if ($account->active()) { $redirect = new Redirect($user); foreach ($redirect->emails as $email) { if ($email->type == 'googleapps') { + $gapps_email = $email->email; $redirect_active = $email->active; $redirect_unique = !$redirect->other_active($email->email); } @@ -68,7 +70,7 @@ class GoogleAppsModule extends PLModule S::assert_xsrf_token(); if (Post::v('pwsync') == 'sync') { $account->set_password_sync(true); - $account->set_password(S::v('password')); + $account->set_password($user->password()); } else { $account->set_password_sync(false); } @@ -83,7 +85,7 @@ class GoogleAppsModule extends PLModule if ($account->pending_update_suspension) { $page->trigWarning("Ton compte est déjà en cours de désactivation."); } else { - if (!$redirect_active || $redirect->modify_one_email('googleapps', false) == SUCCESS) { + if (!$redirect_active || $redirect->modify_one_email($gapps_email, false) == SUCCESS) { $account->suspend(); $page->trigSuccess("Ton compte Google Apps est dorénavant désactivé."); } else { @@ -234,5 +236,5 @@ class GoogleAppsModule extends PLModule } } -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>