Auth session in only valid for one blog... KILL KILL KILL
[dotclear.git] / widget.auth.php
1 <?php
2 class xorgAuthWidget {
3 public static function behavior_initWidgets(&$w) {
4 $w->create('XorgAuth', __('Auth. X.org'), array('xorgAuthWidget', 'widget'));
5 }
6
7 static public function widget(&$w) {
8 global $core;
9 $name = $core->auth->userID();
10 if ($name) {
11 $str = '<p>Tu es ' . $core->auth->getInfo('user_displayname') . '<br />';
12 if ($core->auth->check('usage,contentadmin,admin', $core->blog->id)) {
13 $str .= '<a href="' . $core->blog->url . 'admin/index.php">Interface de rédaction</a><br />';
14 }
15 return $str . '<a href="' . $core->blog->url . 'auth/exit">Déconnexion</a></p>';
16 } else {
17 return '<p><a href="' . $core->blog->url . 'auth/Xorg?path=' . $_SERVER['REQUEST_URI'] . '">M\'authentifier via Polytechnique.org</a></p>';
18 }
19 }
20 }
21
22 ?>