From: Florent Bruneau Date: Sun, 1 Jun 2008 12:07:26 +0000 (+0200) Subject: Remove hardcoded pathes. X-Git-Url: http://git.polytechnique.org/?p=dotclear.git;a=commitdiff_plain;h=f4737a5a76517751aa2000f25168c52fea7c1a06 Remove hardcoded pathes. Signed-off-by: Florent Bruneau --- diff --git a/class.xorg.auth.php b/class.xorg.auth.php index e27e3d2..9fa422c 100644 --- a/class.xorg.auth.php +++ b/class.xorg.auth.php @@ -1,5 +1,9 @@ null, 'prenom' => null, @@ -103,9 +107,6 @@ class xorgAuth extends dcAuth { /** Xorg SSO API */ public function callXorg($path = null) { - if (is_null($path)) { - $path = $_SERVER['REQUEST_URI']; - } $this->buildFromSession(); if (@$_SESSION['auth-xorg']) { return true; @@ -114,6 +115,9 @@ class xorgAuth extends dcAuth { if (!session_id()) { $core->session->start(); } + if (is_null($path)) { + $path = @$_SERVER['PATH_INFO']; + } $_SESSION["auth-x-challenge"] = md5(uniqid(rand(), 1)); $_SESSION['xorg-group'] = $core->blog->settings->get('xorg_blog_owner'); $url = "https://www.polytechnique.org/auth-groupex/utf8"; @@ -155,7 +159,7 @@ class xorgAuth extends dcAuth { $_SESSION['sess_blog_id'] = 'default'; $this->sudo(array($this, 'createUser')); $path = $_GET['path']; - header("Location: http://murphy.m4x.org" . $_GET['path']); + header('Location: ' . $core->blog->url . $_GET['path']); exit; } unset($_SESSION['auth-xorg']); @@ -241,9 +245,18 @@ class xorgAuth extends dcAuth { public function authForm() { global $core; - $path = "http://murphy.m4x.org/~x2003bruneau/dotclear/"; + if (!isset($core->blog)) { + $blog = @$core->getBlog(DC_BLOG_ID); + } else { + $blog = $core->blog; + } + $path = @$blog->url; + if (!$path) { + $path = $blog->f('blog_url'); + } + return '
'. - '

Via Polytechnique.org

' . + '

Via Polytechnique.org

' . '
'. '

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

'; } diff --git a/widget.auth.php b/widget.auth.php index 7a41403..ba14500 100644 --- a/widget.auth.php +++ b/widget.auth.php @@ -14,7 +14,7 @@ class xorgAuthWidget { } return $str . 'Déconnexion

'; } else { - return '

M\'authentifier via Polytechnique.org

'; + return '

M\'authentifier via Polytechnique.org

'; } } } diff --git a/widget.post.perms.php b/widget.post.perms.php index 249c135..415d371 100644 --- a/widget.post.perms.php +++ b/widget.post.perms.php @@ -118,7 +118,7 @@ class xorgPostPermsFilter extends rsExtPostPublic { $str = '

' . 'Vous n\'avez pas les droits suffisants pour lire ce billet
'; if (!$core->auth->userID()) { - $str .= 'Vous devez vous authentifier'; + $str .= 'Vous devez vous authentifier'; } else { $str .= 'Tu dois être membre du groupe pour lire ce message'; }