Esempio n. 1
0
 /**
  * Handle input and output a page
  *
  * @param array $args $_REQUEST arguments
  *
  * @return void
  */
 function handle($args)
 {
     parent::handle($args);
     if (!common_logged_in()) {
         $this->clientError(_('Not logged in.'));
         return;
     } else {
         if (!common_is_real_login()) {
             // Cookie theft means that automatic logins can't
             // change important settings or see private info, and
             // _all_ our settings are important
             common_set_returnto($this->selfUrl());
             $user = common_current_user();
             if (Event::handle('RedirectToLogin', array($this, $user))) {
                 common_redirect(common_local_url('login'), 303);
             }
         } else {
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 $this->handlePost();
             } else {
                 $this->showForm();
             }
         }
     }
 }
Esempio n. 2
0
 /**
  * output page based on arguments
  *
  * @param array $args HTTP arguments (from $_REQUEST)
  *
  * @return void
  */
 function handle($args)
 {
     parent::handle($args);
     if (!$this->user) {
         $this->clientError(_('用户不存在'), 404);
         return;
     }
     $cur = common_current_user();
     if (!$cur || $cur->id != $this->user->id) {
         $this->clientError(_('Only the user can read their own mailboxes.'), 403);
         return;
     }
     $this->showPage();
 }
Esempio n. 3
0
 function handle($args)
 {
     parent::handle($args);
     if (!common_config('invite', 'enabled')) {
         $this->clientError(_('暂时无法邀请新用户'));
     } else {
         if (!common_logged_in()) {
             $this->clientError(_('必须登录才能邀请新用户'));
             return;
         } else {
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 $this->sendInvitations();
             } else {
                 $this->showForm();
             }
         }
     }
 }
 function handle($args)
 {
     parent::handle($args);
     if (!common_config('invite', 'enabled')) {
         $this->clientError(_('Invites have been disabled.'));
     } else {
         if (!common_logged_in()) {
             $this->clientError(sprintf(_('You must be logged in to invite other users to use %s.'), common_config('site', 'name')));
             return;
         } else {
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 $this->sendInvitations();
             } else {
                 $this->showForm();
             }
         }
     }
 }
Esempio n. 5
0
 function handle($args)
 {
     parent::handle($args);
     if (!common_config('invite', 'enabled')) {
         // TRANS: Client error displayed when trying to sent invites while they have been disabled.
         $this->clientError(_('Invites have been disabled.'));
     } else {
         if (!common_logged_in()) {
             // TRANS: Client error displayed when trying to sent invites while not logged in.
             // TRANS: %s is the StatusNet site name.
             $this->clientError(sprintf(_('You must be logged in to invite other users to use %s.'), common_config('site', 'name')));
             return;
         } else {
             if ($_SERVER['REQUEST_METHOD'] == 'POST') {
                 $this->sendInvitations();
             } else {
                 $this->showForm();
             }
         }
     }
 }