diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-12-23 14:33:23 -0500 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-12-23 14:33:23 -0500 |
commit | 04ef1ba8eee7a9e2a565d7b4b747ef607665d562 (patch) | |
tree | d56ac33bd6bfb8f8641cc9f63b0f6af52b6edfb9 /actions/finishopenidlogin.php | |
parent | eb2f9c98ac115ce67e9a740b200c832153ffa05c (diff) |
change function headers to K&R style
Another huge change, for PEAR code standards compliance. Function
headers have to be in K&R style (opening brace on its own line),
instead of having the opening brace on the same line as the function
and parameters. So, a little perl magic found all the function
definitions and move the opening brace to the next line (properly
indented... usually).
darcs-hash:20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz
Diffstat (limited to 'actions/finishopenidlogin.php')
-rw-r--r-- | actions/finishopenidlogin.php | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index ae5b136a2..eb52d73b1 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -23,7 +23,8 @@ require_once(INSTALLDIR.'/lib/openid.php'); class FinishopenidloginAction extends Action { - function handle($args) { + function handle($args) + { parent::handle($args); if (common_logged_in()) { common_user_error(_('Already logged in.')); @@ -52,7 +53,8 @@ class FinishopenidloginAction extends Action { } } - function show_top($error=null) { + function show_top($error=null) + { if ($error) { common_element('div', array('class' => 'error'), $error); } else { @@ -62,7 +64,8 @@ class FinishopenidloginAction extends Action { } } - function show_form($error=null, $username=null) { + function show_form($error=null, $username=null) + { common_show_header(_('OpenID Account Setup'), null, $error, array($this, 'show_top')); @@ -99,7 +102,8 @@ class FinishopenidloginAction extends Action { common_show_footer(); } - function try_login() { + function try_login() + { $consumer = oid_consumer(); @@ -146,26 +150,30 @@ class FinishopenidloginAction extends Action { } } - function message($msg) { + function message($msg) + { common_show_header(_('OpenID Login')); common_element('p', null, $msg); common_show_footer(); } - function save_values($display, $canonical, $sreg) { + function save_values($display, $canonical, $sreg) + { common_ensure_session(); $_SESSION['openid_display'] = $display; $_SESSION['openid_canonical'] = $canonical; $_SESSION['openid_sreg'] = $sreg; } - function get_saved_values() { + function get_saved_values() + { return array($_SESSION['openid_display'], $_SESSION['openid_canonical'], $_SESSION['openid_sreg']); } - function create_new_user() { + function create_new_user() + { # FIXME: save invite code before redirect, and check here @@ -247,7 +255,8 @@ class FinishopenidloginAction extends Action { common_redirect(common_local_url('showstream', array('nickname' => $user->nickname))); } - function connect_user() { + function connect_user() + { $nickname = $this->trimmed('nickname'); $password = $this->trimmed('password'); @@ -286,7 +295,8 @@ class FinishopenidloginAction extends Action { $this->go_home($user->nickname); } - function go_home($nickname) { + function go_home($nickname) + { $url = common_get_returnto(); if ($url) { # We don't have to return to it again @@ -299,7 +309,8 @@ class FinishopenidloginAction extends Action { common_redirect($url); } - function best_new_nickname($display, $sreg) { + function best_new_nickname($display, $sreg) + { # Try the passed-in nickname @@ -332,7 +343,8 @@ class FinishopenidloginAction extends Action { return null; } - function is_new_nickname($str) { + function is_new_nickname($str) + { if (!Validate::string($str, array('min_length' => 1, 'max_length' => 64, 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { @@ -347,7 +359,8 @@ class FinishopenidloginAction extends Action { return true; } - function openid_to_nickname($openid) { + function openid_to_nickname($openid) + { if (Auth_Yadis_identifierScheme($openid) == 'XRI') { return $this->xri_to_nickname($openid); } else { @@ -360,7 +373,8 @@ class FinishopenidloginAction extends Action { # 2. One element in path, like http://profile.typekey.com/EvanProdromou/ # or http://getopenid.com/evanprodromou - function url_to_nickname($openid) { + function url_to_nickname($openid) + { static $bad = array('query', 'user', 'password', 'port', 'fragment'); $parts = parse_url($openid); @@ -406,7 +420,8 @@ class FinishopenidloginAction extends Action { return null; } - function xri_to_nickname($xri) { + function xri_to_nickname($xri) + { $base = $this->xri_base($xri); if (!$base) { @@ -419,7 +434,8 @@ class FinishopenidloginAction extends Action { } } - function xri_base($xri) { + function xri_base($xri) + { if (substr($xri, 0, 6) == 'xri://') { return substr($xri, 6); } else { @@ -429,7 +445,8 @@ class FinishopenidloginAction extends Action { # Given a string, try to make it work as a nickname - function nicknamize($str) { + function nicknamize($str) + { $str = preg_replace('/\W/', '', $str); return strtolower($str); } |