Example #1
0
 /**
  * Execute the action
  */
 public function execute()
 {
     $this->id = $this->getParameter('id', 'int');
     // does the item exist
     if ($this->id !== null && BackendMailengineModel::existsUser($this->id)) {
         parent::execute();
         $this->record = (array) BackendMailengineModel::getUser($this->id);
         BackendMailengineModel::deleteUser($this->id);
         BackendMailengineModel::deleteGroupFromUser($this->id);
         BackendModel::triggerEvent($this->getModule(), 'after_delete_user', array('id' => $this->id));
         $this->redirect(BackendModel::createURLForAction('users') . '&report=deleted&var=' . urlencode($this->record['name']));
     } else {
         $this->redirect(BackendModel::createURLForAction('users') . '&error=non-existing');
     }
 }