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 /_darcs/pristine/lib/openid.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 '_darcs/pristine/lib/openid.php')
-rw-r--r-- | _darcs/pristine/lib/openid.php | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/_darcs/pristine/lib/openid.php b/_darcs/pristine/lib/openid.php index 3ca359fa1..1e7f318fb 100644 --- a/_darcs/pristine/lib/openid.php +++ b/_darcs/pristine/lib/openid.php @@ -31,7 +31,8 @@ require_once('Auth/OpenID/MySQLStore.php'); define('OPENID_COOKIE_EXPIRY', round(365.25 * 24 * 60 * 60)); define('OPENID_COOKIE_KEY', 'lastusedopenid'); -function oid_store() { +function oid_store() +{ static $store = null; if (!$store) { # Can't be called statically @@ -42,23 +43,27 @@ function oid_store() { return $store; } -function oid_consumer() { +function oid_consumer() +{ $store = oid_store(); $consumer = new Auth_OpenID_Consumer($store); return $consumer; } -function oid_clear_last() { +function oid_clear_last() +{ oid_set_last(''); } -function oid_set_last($openid_url) { +function oid_set_last($openid_url) +{ common_set_cookie(OPENID_COOKIE_KEY, $openid_url, time() + OPENID_COOKIE_EXPIRY); } -function oid_get_last() { +function oid_get_last() +{ $openid_url = $_COOKIE[OPENID_COOKIE_KEY]; if ($openid_url && strlen($openid_url) > 0) { return $openid_url; @@ -67,7 +72,8 @@ function oid_get_last() { } } -function oid_link_user($id, $canonical, $display) { +function oid_link_user($id, $canonical, $display) +{ $oid = new User_openid(); $oid->user_id = $id; @@ -84,7 +90,8 @@ function oid_link_user($id, $canonical, $display) { return true; } -function oid_get_user($openid_url) { +function oid_get_user($openid_url) +{ $user = null; $oid = User_openid::staticGet('canonical', $openid_url); if ($oid) { @@ -93,7 +100,8 @@ function oid_get_user($openid_url) { return $user; } -function oid_check_immediate($openid_url, $backto=null) { +function oid_check_immediate($openid_url, $backto=null) +{ if (!$backto) { $action = $_REQUEST['action']; $args = common_copy_args($_GET); @@ -113,7 +121,8 @@ function oid_check_immediate($openid_url, $backto=null) { true); } -function oid_authenticate($openid_url, $returnto, $immediate=false) { +function oid_authenticate($openid_url, $returnto, $immediate=false) +{ $consumer = oid_consumer(); @@ -190,7 +199,8 @@ function oid_authenticate($openid_url, $returnto, $immediate=false) { # Half-assed attempt at a module-private function -function _oid_print_instructions() { +function _oid_print_instructions() +{ common_element('div', 'instructions', _('This form should automatically submit itself. '. 'If not, click the submit button to go to your '. @@ -199,7 +209,8 @@ function _oid_print_instructions() { # update a user from sreg parameters -function oid_update_user(&$user, &$sreg) { +function oid_update_user(&$user, &$sreg) +{ $profile = $user->getProfile(); |