diff options
author | Sarven Capadisli <csarven@controlyourself.ca> | 2009-04-02 06:44:54 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@controlyourself.ca> | 2009-04-02 06:44:54 +0000 |
commit | 798984381f9ee40681d1feb4a7bef72460fe39f2 (patch) | |
tree | 8bcf6b27a9efe7f53a2b1e5fd23d7f4f2789bc51 /lib | |
parent | 928d3bd68c62d2e35594fb4196216e1f9fd363a2 (diff) | |
parent | 36f73bffbc717d895370e905070c310062127529 (diff) |
Merge branch '0.7.x' into 0.8.x
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action.php | 4 | ||||
-rw-r--r-- | lib/openid.php | 4 | ||||
-rw-r--r-- | lib/settingsaction.php | 4 | ||||
-rw-r--r-- | lib/util.php | 6 |
4 files changed, 10 insertions, 8 deletions
diff --git a/lib/action.php b/lib/action.php index 2935cb900..75531d34b 100644 --- a/lib/action.php +++ b/lib/action.php @@ -326,7 +326,9 @@ class Action extends HTMLOutputter // lawsuit */ function showBody() { - $this->elementStart('body', array('id' => $this->trimmed('action'))); + $this->elementStart('body', (common_current_user()) ? array('id' => $this->trimmed('action'), + 'class' => 'user_in') + : array('id' => $this->trimmed('action'))); $this->elementStart('div', array('id' => 'wrap')); if (Event::handle('StartShowHeader', array($this))) { $this->showHeader(); diff --git a/lib/openid.php b/lib/openid.php index 3aa488b6d..3af7a39cf 100644 --- a/lib/openid.php +++ b/lib/openid.php @@ -160,7 +160,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false) $auth_request->addExtension($sreg_request); } - $trust_root = common_path(''); + $trust_root = common_root_url(true); $process_url = common_local_url($returnto); if ($auth_request->shouldSendRedirect()) { @@ -171,7 +171,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false) } else if (Auth_OpenID::isFailure($redirect_url)) { return sprintf(_('Could not redirect to server: %s'), $redirect_url->message); } else { - common_redirect($redirect_url); + common_redirect($redirect_url, 303); } } else { // Generate form markup and render it. diff --git a/lib/settingsaction.php b/lib/settingsaction.php index 53c807c6f..db20c5804 100644 --- a/lib/settingsaction.php +++ b/lib/settingsaction.php @@ -78,9 +78,9 @@ class SettingsAction extends Action common_set_returnto($this->selfUrl()); $user = common_current_user(); if ($user->hasOpenID()) { - common_redirect(common_local_url('openidlogin')); + common_redirect(common_local_url('openidlogin'), 303); } else { - common_redirect(common_local_url('login')); + common_redirect(common_local_url('login'), 303); } } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->handlePost(); diff --git a/lib/util.php b/lib/util.php index fdcae0aca..f08e70754 100644 --- a/lib/util.php +++ b/lib/util.php @@ -850,7 +850,7 @@ function common_redirect($url, $code=307) 303 => "See Other", 307 => "Temporary Redirect"); - header("Status: ${code} $status[$code]"); + header('HTTP/1.1 '.$code.' '.$status[$code]); header("Location: $url"); $xo = new XMLOutputter(); @@ -952,9 +952,9 @@ function common_profile_url($nickname) // Should make up a reasonable root URL -function common_root_url() +function common_root_url($ssl=false) { - return common_path(''); + return common_path('', $ssl); } // returns $bytes bytes of random data as a hexadecimal string |