Moving to GitHub.
[platal.git] / modules / googleapps.php
index b4900b9..c898819 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2011 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -29,10 +29,10 @@ class GoogleAppsModule extends PLModule
         }
 
         return array(
-            'googleapps'            => $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'),
         );
     }
 
@@ -70,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);
                 }
@@ -236,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:
 ?>