X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fplatal.php;h=f2d4d96b684086cdc66448976829e7c977d71c6d;hb=c700d16b2402b1d246383097f6f22f716e294eaf;hp=9ef16e4d4e37f9b925bda8b188dd849fa46b4394;hpb=ddb649901f5a88d695a7050f2a59da140842ec89;p=platal.git diff --git a/modules/platal.php b/modules/platal.php index 9ef16e4..f2d4d96 100644 --- a/modules/platal.php +++ b/modules/platal.php @@ -1,6 +1,6 @@ changeTpl('platal/changeLog.tpl'); $clog = pl_entities(file_get_contents(dirname(__FILE__).'/../ChangeLog')); + $clog = preg_replace('/=+\s*/', '
', $clog);
         // url catch only (not all wiki syntax)
         $clog = preg_replace(array(
             '/((?:https?|ftp):\/\/(?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/ui',
@@ -99,6 +100,7 @@ class PlatalModule extends PLModule
           $clog);
         $clog = preg_replace('!(#[0-9]+(,[0-9]+)*)!e', 'bugize("\1")', $clog);
         $clog = preg_replace('!vim:.*$!', '', $clog);
+        $clog = preg_replace("!(
(\\s|\n)*)?
(\s|\n)*
((\\s|\n)*
)?!m", "", "
$clog
"); $page->assign('ChangeLog', $clog); } @@ -183,8 +185,11 @@ class PlatalModule extends PLModule function handler_password(&$page) { + global $globals; + if (Post::has('response2')) { require_once 'secure_hash.inc.php'; + S::assert_xsrf_token(); $_SESSION['password'] = $password = Post::v('response2'); @@ -193,6 +198,16 @@ class PlatalModule extends PLModule WHERE user_id={?}', $password, S::v('uid')); + // If GoogleApps is enabled, and the user did choose to use synchronized passwords, + // 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')); + if ($account->active() && $account->sync_password) { + $account->set_password($password); + } + } + $log =& S::v('log'); $log->log('passwd', ''); @@ -329,6 +344,7 @@ Adresse de secours : " . Post::v('email') : "")); function handler_tmpPWD(&$page, $certif = null) { + global $globals; XDB::execute('DELETE FROM perte_pass WHERE DATE_SUB(NOW(), INTERVAL 380 MINUTE) > created'); @@ -342,11 +358,22 @@ Adresse de secours : " . Post::v('email') : "")); $uid = $ligne["uid"]; if (Post::has('response2')) { $password = Post::v('response2'); - $logger = new CoreLogger($uid); XDB::query('UPDATE auth_user_md5 SET password={?} WHERE user_id={?} AND perms IN("admin","user")', $password, $uid); XDB::query('DELETE FROM perte_pass WHERE certificat={?}', $certif); + + // If GoogleApps is enabled, and the user did choose to use synchronized passwords, + // updates the Google Apps password as well. + if ($globals->mailstorage->googleapps_domain) { + require_once 'googleapps.inc.php'; + $account = new GoogleAppsAccount($uid); + if ($account->active() && $account->sync_password) { + $account->set_password($password); + } + } + + $logger = new CoreLogger($uid); $logger->log("passwd",""); $page->changeTpl('platal/tmpPWD.success.tpl'); } else {