]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/openidlogin.php
Extract image management code to a helper function
[quix0rs-gnu-social.git] / actions / openidlogin.php
index 1bf37f28f4dfaec267926adfe32e61ec129f4a03..d1989e0dea736dad06e744b9dc28b69316b17d7d 100644 (file)
@@ -21,12 +21,14 @@ if (!defined('LACONICA')) { exit(1); }
 
 require_once(INSTALLDIR.'/lib/openid.php');
 
-class OpenidloginAction extends Action {
+class OpenidloginAction extends Action
+{
 
-    function handle($args) {
+    function handle($args)
+    {
         parent::handle($args);
         if (common_logged_in()) {
-            common_user_error(_('Already logged in.'));
+            $this->clientError(_('Already logged in.'));
         } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $openid_url = $this->trimmed('openid_url');
 
@@ -56,37 +58,40 @@ class OpenidloginAction extends Action {
         }
     }
 
-    function get_instructions() {
+    function get_instructions()
+    {
         return _('Login with an [OpenID](%%doc.openid%%) account.');
     }
 
-    function show_top($error=null) {
+    function show_top($error=null)
+    {
         if ($error) {
-            common_element('div', array('class' => 'error'), $error);
+            $this->element('div', array('class' => 'error'), $error);
         } else {
             $instr = $this->get_instructions();
             $output = common_markup_to_html($instr);
-            common_element_start('div', 'instructions');
-            common_raw($output);
-            common_element_end('div');
+            $this->elementStart('div', 'instructions');
+            $this->raw($output);
+            $this->elementEnd('div');
         }
     }
 
-    function show_form($error=null, $openid_url) {
+    function show_form($error=null, $openid_url)
+    {
         common_show_header(_('OpenID Login'), null, $error, array($this, 'show_top'));
         $formaction = common_local_url('openidlogin');
-        common_element_start('form', array('method' => 'post',
+        $this->elementStart('form', array('method' => 'post',
                                            'id' => 'openidlogin',
                                            'action' => $formaction));
-        common_hidden('token', common_session_token());
-        common_input('openid_url', _('OpenID URL'),
+        $this->hidden('token', common_session_token());
+        $this->input('openid_url', _('OpenID URL'),
                      $openid_url,
                      _('Your OpenID URL'));
-        common_checkbox('rememberme', _('Remember me'), false,
+        $this->checkbox('rememberme', _('Remember me'), false,
                         _('Automatically login in the future; ' .
                            'not for shared computers!'));
-        common_submit('submit', _('Login'));
-        common_element_end('form');
+        $this->submit('submit', _('Login'));
+        $this->elementEnd('form');
         common_show_footer();
     }
 }