X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fgoogleapps.php;h=de3d6681ce3718e105f604ddc91d6799f8f9ee73;hb=0001ba7a34dc3b535407cb1b961781c3c69c0ccd;hp=c2c4e536fad38d356d7b2d7ed7a995459e1432e8;hpb=a8b4ccb6c163277c49fb92427a7bb4ace8469660;p=platal.git diff --git a/modules/googleapps.php b/modules/googleapps.php index c2c4e53..de3d668 100644 --- a/modules/googleapps.php +++ b/modules/googleapps.php @@ -1,6 +1,6 @@ addJsLink('motdepasse.js'); $page->setTitle('Compte Google Apps'); - $account = new GoogleAppsAccount(S::user()); + $user = S::user(); + $account = new GoogleAppsAccount($user); // Fills up the 'is Google Apps redirection active' variable. $page->assign('redirect_active', false); $page->assign('redirect_unique', true); if ($account->active()) { - $redirect = new Redirect(S::v('uid')); + $redirect = new Redirect($user); $page->assign('redirect_unique', !$redirect->other_active('googleapps')); - $storage = new EmailStorage(S::v('uid'), 'googleapps'); + $storage = new EmailStorage($user, 'googleapps'); $page->assign('redirect_active', $storage->active); } @@ -193,12 +194,11 @@ class GoogleAppsModule extends PLModule if ($user) { $account = new GoogleAppsAccount($user); - $storage = new EmailStorage($user->id(), 'googleapps'); + $storage = new EmailStorage($user, 'googleapps'); // Force synchronization of plat/al and Google Apps passwords. if ($action == 'forcesync' && $account->sync_password) { - $res = XDB::query("SELECT password FROM auth_user_md5 WHERE user_id = {?}", $user->id()); - $account->set_password($res->fetchOneCell()); + $account->set_password($user->password()); $page->trigSuccess('Le mot de passe a été synchronisé.'); }