/** * Unlock selected accounts * * @return @e void [Outputs to screen] */ protected function _unlock() { //----------------------------------------- // Check //----------------------------------------- $ids = IPSLib::fetchInputAsArray('mid_'); if (count($ids) < 1) { $this->registry->output->showError($this->lang->words['t_nolockloc'], 11251); } //----------------------------------------- // Unlock //----------------------------------------- if ($this->request['type'] == 'unlock') { try { $message = $this->_getManagementClass()->unlockMembers($ids); } catch (Exception $error) { $this->registry->output->showError($error->getMessage(), 11247); } $this->registry->output->global_message = $message; $this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . 'app=members'); } else { if ($this->request['type'] == 'ban') { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg('member_ban', 'members', 'members'); try { $message = $this->_getManagementClass()->banMembers($ids); } catch (Exception $error) { $this->registry->output->showError($error->getMessage(), 11247); } $this->registry->output->global_message = $message; $this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . 'app=members'); } else { if ($this->request['type'] == 'delete') { $this->registry->getClass('class_permissions')->checkPermissionAutoMsg('member_delete', 'members', 'members'); $this->registry->output->global_message = $this->_getManagementClass()->deleteMembers($ids); $this->registry->output->silentRedirectWithMessage($this->settings['base_url'] . 'app=members'); } } } }
/** * Unlock selected accounts * * @return @e void [Outputs to screen] */ protected function _unlock() { //----------------------------------------- // Check //----------------------------------------- $ids = IPSLib::fetchInputAsArray('mid_'); if (count($ids) < 1) { $this->returnJsonError($this->lang->words['t_nolockloc'], 11251); } //----------------------------------------- // Unlock //----------------------------------------- if ($this->request['type'] == 'unlock') { try { $message = $this->_getManagementClass()->unlockMembers($ids); } catch (Exception $error) { $this->returnJsonError($error->getMessage()); } $this->returnJsonArray(array('ok' => 1, 'msg' => $message)); } else { if ($this->request['type'] == 'ban') { $this->registry->getClass('class_permissions')->return = true; if (!$this->registry->getClass('class_permissions')->checkPermission('member_ban', 'members', 'members')) { $this->returnJsonError($this->lang->words['no_permission']); } try { $message = $this->_getManagementClass()->banMembers($ids); } catch (Exception $error) { $this->returnJsonError($error->getMessage()); } $this->returnJsonArray(array('ok' => 1, 'msg' => $message)); } else { if ($this->request['type'] == 'delete') { $this->registry->getClass('class_permissions')->return = true; if (!$this->registry->getClass('class_permissions')->checkPermission('member_delete', 'members', 'members')) { $this->returnJsonError($this->lang->words['no_permission']); } $message = $this->_getManagementClass()->deleteMembers($ids); $this->returnJsonArray(array('ok' => 1, 'msg' => $message)); } } } }