From f4737a5a76517751aa2000f25168c52fea7c1a06 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 1 Jun 2008 14:07:26 +0200 Subject: [PATCH] Remove hardcoded pathes. Signed-off-by: Florent Bruneau --- class.xorg.auth.php | 25 +++++++++++++++++++------ widget.auth.php | 2 +- widget.post.perms.php | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) 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'; } -- 2.1.4