Override current blog id by the DC_BLOG_ID var
[dotclear.git] / _public.php
index 2b00670..1403395 100644 (file)
@@ -1,37 +1,10 @@
 <?php
-$core->url->register('xorgAuth', 'Xorg', '^auth/(.*)$', array('xorgAuthentifier', 'doAuth'));
-
-class xorgAuthWidget {
-  static public function widget(&$w) {
-    global $core;
-    if ($core->auth->xorg_infos['forlife']) {
-      return '<p>Tu es ' . $core->auth->xorg_infos['prenom'] . ' ' . $core->auth->xorg_infos['nom'] . '<br />'
-           . '<a href="auth/exit">déconnexion</a></p>';
-    } else {
-      return '<p><a href="auth/Xorg?path=' . $_SERVER['REQUEST_URI'] . '">M\'authentifier via Polytechnique.org</a></p>';
-    }
-  }
-}
+require_once dirname(__FILE__) . '/page.auth.php';
+require_once dirname(__FILE__) . '/widget.auth.php';
+require_once dirname(__FILE__) . '/widget.post.perms.php';
+require_once dirname(__FILE__) . '/class.xorg.auth.php';
 
-class xorgAuthentifier extends dcUrlHandlers {
-  static public function doAuth($args) {
-    @session_start();
-    global $core;
-    switch ($args) {
-     case 'exit':
-      $core->auth->killSession();
-      break;
-     case 'Xorg':
-      $core->auth->callXorg();
-      break;
-     case 'XorgReturn':
-      $core->auth->returnXorg();
-      break;
-     default:
-      self::p404();
-    }
-    return;
-  }
+$core->url->register('xorgAuth', 'Xorg', '^auth/(.*)$', array('xorgAuthentifier', 'doAuth'));
 
-}
+$core->addBehavior('coreBlogGetPosts', array('xorgPostPermsWidget', 'behavior_coreBlogGetPosts'));
 ?>