X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fplatal.php;h=12493356f1d27f8eed076595d93629bceff87b56;hb=50579de4416173b970ad17fe8953414ebd2fa1c3;hp=767c63ea4b05e2c74fdb51e63500a74829ab800a;hpb=6d20fb1df94dbf2fbada3aa1cb41e2f7596c0e9b;p=platal.git diff --git a/modules/platal.php b/modules/platal.php index 767c63e..1249335 100644 --- a/modules/platal.php +++ b/modules/platal.php @@ -62,6 +62,11 @@ class PlatalModule extends PLModule function handler_index(&$page) { + // Include X-XRDS-Location response-header for Yadis discovery + global $globals; + header('X-XRDS-Location: ' . $globals->baseurl . '/openid/idp_xrds'); + + // Redirect to the suitable page if (S::logged()) { pl_redirect('events'); } else if (!@$GLOBALS['IS_XNET_SITE']) { @@ -87,7 +92,7 @@ class PlatalModule extends PLModule $page->changeTpl('platal/changeLog.tpl'); $clog = pl_entities(file_get_contents(dirname(__FILE__).'/../ChangeLog')); - $clog = preg_replace('/=+\s*/', '
', $clog); + $clog = preg_replace('/===+\s*/', '
', $clog); // url catch only (not all wiki syntax) $clog = preg_replace(array( '/((?:https?|ftp):\/\/(?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/ui', @@ -137,6 +142,14 @@ class PlatalModule extends PLModule if (Post::has('rss')) { $this->__set_rss_state(Post::b('rss')); } + + # FIXME: this code is not multi-domain compatible. We should decide how + # carva will extend to users not in the main domain. + $res = XDB::query("SELECT alias + FROM aliases + WHERE id = {?} AND FIND_IN_SET('bestalias', flags)", + S::user()->id()); + $page->assign('bestalias', $res->fetchOneCell()); } function handler_webredir(&$page) @@ -169,6 +182,14 @@ class PlatalModule extends PLModule WHERE user_id = {?}', S::v('uid')); $page->assign('carva', $res->fetchOneCell()); + + # FIXME: this code is not multi-domain compatible. We should decide how + # carva will extend to users not in the main domain. + $res = XDB::query("SELECT alias + FROM aliases + WHERE id = {?} AND FIND_IN_SET('bestalias', flags)", + S::user()->id()); + $page->assign('bestalias', $res->fetchOneCell()); } function handler_prefs_rss(&$page) @@ -202,7 +223,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 +389,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 +433,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,7 +469,11 @@ Adresse de secours : " . Post::v('email') : "")); function handler_review(&$page, $action = null, $mode = null) { - require_once dirname(__FILE__) . '/platal/review.inc.php'; + // Include X-XRDS-Location response-header for Yadis discovery + global $globals; + header('X-XRDS-Location: ' . $globals->baseurl . '/openid/idp_xrds'); + + $this->load('review.inc.php'); $dom = 'Review'; if (@$GLOBALS['IS_XNET_SITE']) { $dom .= 'Xnet';