Пример #1
0
 /**
  * Load the item data
  */
 protected function loadData()
 {
     $this->id = $this->getParameter('id', 'int', null);
     if ($this->id == null || !BackendMailengineModel::existsUser($this->id)) {
         $this->redirect(BackendModel::createURLForAction('users') . '&error=non-existing');
     }
     $this->record = BackendMailengineModel::getUser($this->id);
     if (substr($this->record['unsubscribe_on'], 0, 10) == '0000-00-00') {
         unset($this->record['unsubscribe_on']);
     }
 }
Пример #2
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');
     }
 }