X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=_public.php;h=adc2d8b27312120484bf48a6dd2ca67c0d5398ef;hb=HEAD;hp=19de04c3dc88d9dafc44f7e7527bc663cf0e3f42;hpb=a1a69528964163fff5a1193b3a6d8807b9272ce0;p=dotclear.git diff --git a/_public.php b/_public.php index 19de04c..adc2d8b 100644 --- a/_public.php +++ b/_public.php @@ -1,136 +1,22 @@ url->register('xorgAuth', 'Xorg', '^auth/(.*)$', array('xorgAuthentifier', 'doAuth')); -$core->url->register('xorgLogin', 'XorgLogin', '^admin/(xorg\.php)$', array('xorgLoginPage', 'page')); -class xorgAuthWidget { - static public function widget(&$w) { - global $core; - if ($core->auth->xorg_infos['forlife']) { - return '

Tu es ' . $core->auth->xorg_infos['prenom'] . ' ' . $core->auth->xorg_infos['nom'] . '
' - . 'déconnexion

'; - } else { - return '

M\'authentifier via Polytechnique.org

'; - } - } -} +require_once dirname(__FILE__) . '/page.auth.php'; +require_once dirname(__FILE__) . '/widget.auth.php'; +require_once dirname(__FILE__) . '/widget.copyright.php'; +require_once dirname(__FILE__) . '/widget.post.perms.php'; +require_once dirname(__FILE__) . '/class.xorg.auth.php'; +require_once dirname(__FILE__) . '/page.webservice.php'; -class xorgLoginPage extends dcUrlHandlers { - static public function page($args) { - switch ($args) { - case 'xorg.php': - self::dispatchForm(); - default: - self::p404(); - } - } +/* Xorg auth */ +$core->url->register('xorgAuth', 'XorgAuth', '^auth/(.*)$', array('xorgAuthentifier', 'doAuth')); - static protected function dispatchForm() { - # If we have a session cookie, go to index.php - if (isset($_SESSION['sess_user_id'])) - { - header('Location: http://murphy.m4x.org/~x2003bruneau/dotclear/admin/index.php'); - } +/* Declare the authentication widget on public page */ +$core->addBehavior('initWidgets', array('xorgAuthWidget', 'behavior_initWidgets')); +$core->addBehavior('initWidgets', array('xorgCopyrightWidget', 'behavior_initWidgets')); - # Loading locales for detected language - $dlang = http::getAcceptLanguage(); - if ($dlang) { - l10n::set(dirname(__FILE__).'/../locales/'.$dlang.'/main'); - } +/* Post permission handling */ +$core->addBehavior('coreBlogGetPosts', array('xorgPostPermsWidget', 'behavior_coreBlogGetPosts')); - global $core; - $msg = $err = null; - header('Content-Type: text/html; charset=UTF-8'); - ?> - - - - - - - - - - - <?php echo html::escapeHTML(DC_VENDOR_NAME); ?> - - - - - callBehavior('loginPageHTMLHead'); - ?> - - - - -
-

- - '.$err.''; - } - if ($msg) { - echo '

'.$msg.'

'; - } - - { - echo - '
'. - '

Via Polytechnique.org

' . - '

Via le formulaire

' . - '
'. - - '

'.__('You must accept cookies in order to use the private area.').'

'; - - if ($core->auth->allowPassChange()) { - echo '

'.__('I forgot my password').'

'; - } - } - ?> -
- - - - - -auth->killSession(); - break; - case 'Xorg': - if ($core->auth->callXorg($_GET['path'])) { - header('Location: http://murphy.m4x.org' . $_GET['path']); - exit; - } - break; - case 'XorgReturn': - $core->auth->returnXorg(); - break; - default: - self::p404(); - } - return; - } - -} +/* Webservice to create new blog */ +$core->url->register('xorgWebservice', 'XorgWebservice', '^xorgservice/(.*)$', array('XorgWebservice', 'handle')); ?>