/**
  * Handle the request
  *
  * On GET, show the form. On POST, try to save the app.
  *
  * @param array $args unused
  *
  * @return void
  */
 function handle($args)
 {
     parent::handle($args);
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $this->handlePost($args);
     } else {
         $this->showForm();
     }
 }
Example #2
0
 function handle($args)
 {
     parent::handle($args);
     # Post from the tag dropdown; redirect to a GET
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         common_redirect($this->selfUrl(), 303);
         return;
     }
     $this->showPage();
 }
Example #3
0
 function handle($args)
 {
     parent::handle($args);
     $this->showPage();
 }
Example #4
0
 /**
  * Handle the request
  *
  * Shows info about the app
  *
  * @return void
  */
 function handle($args)
 {
     parent::handle($args);
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         // CSRF protection
         $token = $this->trimmed('token');
         if (!$token || $token != common_session_token()) {
             $this->clientError(_('There was a problem with your session token.'));
             return;
         }
         if ($this->arg('reset')) {
             $this->resetKey();
         }
     } else {
         $this->showPage();
     }
 }
Example #5
0
 /**
  * Handle input
  *
  * Only handles get, so just show the page.
  *
  * @param array $args $_REQUEST data (unused)
  *
  * @return void
  */
 function handle($args)
 {
     parent::handle($args);
     if ($this->notice->is_local == Notice::REMOTE_OMB) {
         if (!empty($this->notice->url)) {
             $target = $this->notice->url;
         } else {
             if (!empty($this->notice->uri) && preg_match('/^https?:/', $this->notice->uri)) {
                 // Old OMB posts saved the remote URL only into the URI field.
                 $target = $this->notice->uri;
             } else {
                 // Shouldn't happen.
                 $target = false;
             }
         }
         if ($target && $target != $this->selfUrl()) {
             common_redirect($target, 301);
             return false;
         }
     }
     $this->showPage();
 }