protected function beforeDelete() { if ($this->id == \GO::config()->group_root) { throw new \Exception(\GO::t('noDeleteAdmins', 'groups')); } if ($this->id == \GO::config()->group_everyone) { throw new \Exception(\GO::t('noDeleteEveryone', 'groups')); } return parent::beforeDelete(); }
protected function beforeDelete() { if ($this->status == self::STATUS_RUNNING) { throw new \Exception("Can't delete a running mailing. Pause it first."); } return parent::beforeDelete(); }
protected function beforeDelete() { if ($this->id == 'modules') { $this->setValidationError('delete', GO::t('cmdModulesCannotBeDeleted', 'modules')); } $this->_checkDependencies(); return parent::beforeDelete(); }
protected function beforeDelete() { //blocked database check. We check this in the controller now. if ($this->isLocked() && !\GO::user()->isAdmin()) { throw new \Exception(\GO::t("fileIsLocked", "files") . ': ' . $this->path); } return parent::beforeDelete(); }
protected function beforeDelete() { if ($this->id == 1) { throw new \Exception(GO::t('deletePrimaryAdmin', 'users')); } elseif ($this->id == GO::user()->id) { throw new \Exception(GO::t('deleteYourself', 'users')); } else { return parent::beforeDelete(); } }
protected function beforeDelete() { $file = $this->getFilesystemFile(); if ($file->delete() && $this->file->folder->quotaUser) { $this->file->folder->quotaUser->calculatedDiskUsage(0 - $this->size_bytes)->save(true); //user quota \GO::config()->save_setting("file_storage_usage", \GO::config()->get_setting('file_storage_usage') - $this->size_bytes); } return parent::beforeDelete(); }
public function beforeDelete() { if ($this->goUser()) { throw new \Exception("This contact belongs to a user account. Please delete this account first."); } return parent::beforeDelete(); }