Ejemplo n.º 1
0
 protected function _remove()
 {
     if (!UserSession::get('user.superadmin')) {
         $this->_403();
     }
     try {
         if (!($id = $this->input->post('id'))) {
             Alert::once('success', 'Invalid ID!', Url::current());
         }
         $user = new AdminModel($id);
         $user->remove();
         Alert::once('success', 'Account removed successfully!', Url::current());
     } catch (\Exception $e) {
         Alert::once('error', $e->getMessage(), Url::current());
     }
 }