Merge commit 'origin/master' into account
[platal.git] / modules / googleapps.php
index 7648c87..2463966 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -206,12 +206,10 @@ class GoogleAppsModule extends PLModule
                 $account->do_unsuspend();
                 $page->trigSuccess('Le compte est en cours de réactivation.');
             } else if (Post::has('forcesync') && $account->active() && $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 est en cours de synchronisation.');
             } else if (Post::has('sync') && $account->active()) {
-                $res = XDB::query("SELECT password FROM auth_user_md5 WHERE user_id = {?}", $user->id());
-                $account->set_password($res->fetchOneCell());
+                $account->set_password($user->password());
                 $account->set_password_sync(true);
             } else if (Post::has('nosync') && $account->active()) {
                 $account->set_password_sync(false);