Example #1
0
 /**
  * Remove action method
  *
  * @return void
  */
 public function remove()
 {
     if ($this->request->isPost()) {
         $post = $this->request->getPost();
         $session = new Model\Session();
         if (isset($post['clear_all_sessions']) && (int) $post['clear_all_sessions'] == 1) {
             $session->clearSessions($this->sess->user->sess_id);
             $this->sess->setRequestValue('removed', true);
         } else {
             if (isset($post['clear_sessions_by']) && $post['clear_sessions_by'] != '----') {
                 $session->clearSessions($this->sess->user->sess_id, $post['clear_sessions_by']);
                 $this->sess->setRequestValue('removed', true);
             } else {
                 if (isset($post['rm_sessions'])) {
                     $session->remove($post['rm_sessions']);
                     $this->sess->setRequestValue('removed', true);
                 }
             }
         }
     }
     $this->redirect('/sessions');
 }