Пример #1
0
 public function onRun()
 {
     $this->logged_in = (int) Auth::logged_in();
     if ($this->property('redirect_logout') && $this->logged_in == 0) {
         return Redirect::to($this->property('redirect_logout'));
     }
     if ($this->property('redirect_login') && $this->logged_in == 1) {
         return Redirect::to($this->property('redirect_login'));
     }
     $this->wp_user = Auth::wp_get_current_user();
     if ($this->wp_user->data) {
         $this->page['user'] = $this->wp_user->to_array();
     } else {
         $this->page['user'] = false;
     }
 }