Support https in blog URLs
[dotclear.git] / widget.auth.php
CommitLineData
b519995b
FB
1<?php
2class xorgAuthWidget {
3b8da081 3 public static function behavior_initWidgets($w) {
b519995b
FB
4 $w->create('XorgAuth', __('Auth. X.org'), array('xorgAuthWidget', 'widget'));
5 }
6
3b8da081 7 static public function widget($w) {
b519995b 8 global $core;
85cd8fee 9 $name = @$core->auth->getInfo('user_displayname');
b519995b 10 if ($name) {
a2f34875 11 $str = '<div><ul><li><strong>Tu es ' . $core->auth->getInfo('user_displayname') . '</strong></li>';
4eb4eebc 12 if ($core->auth->check('usage,contentadmin,admin', $core->blog->id)) {
f76de30d 13 $str .= '<li><a href="' . $core->blog->url . 'admin/index.php">Interface de rédaction</a></li>';
4eb4eebc 14 }
f76de30d 15 return $str . '<li><a href="' . $core->blog->url . 'auth/exit">Déconnexion</a></li></ul></div>';
b519995b 16 } else {
f76de30d 17 return '<ul><li><a href="' . $core->blog->url . 'auth/Xorg?path=' . $_SERVER['PATH_INFO'] . '">M\'authentifier via Polytechnique.org</a></li></ul>';
b519995b
FB
18 }
19 }
20}
21
22?>