Updates the test email sender method to the new User model.
[platal.git] / modules / platal.php
index d72c110..a1699d5 100644 (file)
@@ -202,7 +202,7 @@ class PlatalModule extends PLModule
             // updates the Google Apps password as well.
             if ($globals->mailstorage->googleapps_domain) {
                 require_once 'googleapps.inc.php';
-                $account = new GoogleAppsAccount(S::v('uid'), S::v('forlife'));
+                $account = new GoogleAppsAccount(S::user());
                 if ($account->active() && $account->sync_password) {
                     $account->set_password($password);
                 }
@@ -368,7 +368,7 @@ Adresse de secours : " . Post::v('email') : ""));
             // updates the Google Apps password as well.
             if ($globals->mailstorage->googleapps_domain) {
                 require_once 'googleapps.inc.php';
-                $account = new GoogleAppsAccount($uid);
+                $account = new GoogleAppsAccount(User::getSilent($uid));
                 if ($account->active() && $account->sync_password) {
                     $account->set_password($password);
                 }
@@ -412,12 +412,11 @@ Adresse de secours : " . Post::v('email') : ""));
     function handler_exit(&$page, $level = null)
     {
         if (S::has('suid')) {
-            $a4l  = S::v('forlife');
             $suid = S::v('suid');
             $log  = S::v('log');
-            S::logger()->log("suid_stop", S::v('forlife') . " by " . $suid['forlife']);
+            S::logger()->log("suid_stop", S::user()->login() . " by " . $suid['hruid']);
             Platal::session()->stopSUID();
-            pl_redirect('admin/user/' . $a4l);
+            pl_redirect('admin/user/' . S::user()->login());
         }
 
         if ($level == 'forget' || $level == 'forgetall') {
@@ -449,14 +448,14 @@ Adresse de secours : " . Post::v('email') : ""));
 
     function handler_review(&$page, $action = null, $mode = null) 
     {
-        require_once dirname(__FILE__) . '/platal/review.inc.php';
+        $this->load('review.inc.php');
         $dom = 'Review';
         if (@$GLOBALS['IS_XNET_SITE']) {
             $dom .= 'Xnet';
         }
         $wp = new PlWikiPage($dom . '.Admin');
         $conf = explode('%0a', $wp->getField('text'));
-        $wiz = new PlWizard('Tour d\'horizon', 'core/plwizard.tpl', true);
+        $wiz = new PlWizard('Tour d\'horizon', PlPage::getCoreTpl('plwizard.tpl'), true);
         foreach ($conf as $line) {
             $list = preg_split('/\s*[*|]\s*/', $line, -1, PREG_SPLIT_NO_EMPTY);
             $wiz->addPage('ReviewPage', $list[0], $list[1]);