no actions if no quotas exist

This commit is contained in:
Roland Gruber 2007-03-05 16:56:57 +00:00
parent a36ad691fc
commit 152db49234
1 changed files with 6 additions and 1 deletions

View File

@ -182,6 +182,7 @@ class quota extends baseModule {
* @param boolean $newAccount new account * @param boolean $newAccount new account
*/ */
function postModifyActions($newAccount) { function postModifyActions($newAccount) {
if (!isset($this->quota) || !is_array($this->quota)) return;
// determine if this is a user or group account // determine if this is a user or group account
if ($_SESSION[$this->base]->type=='user') $id = $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0]; if ($_SESSION[$this->base]->type=='user') $id = $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0];
if ($_SESSION[$this->base]->type=='group') $id = $_SESSION[$this->base]->module['posixGroup']->attributes['cn'][0]; if ($_SESSION[$this->base]->type=='group') $id = $_SESSION[$this->base]->module['posixGroup']->attributes['cn'][0];
@ -205,7 +206,6 @@ class quota extends baseModule {
} }
$ret = lamdaemon(array($id . " quota set " . $_SESSION[$this->base]->type . " $quotastring\n"), $server); $ret = lamdaemon(array($id . " quota set " . $_SESSION[$this->base]->type . " $quotastring\n"), $server);
} }
return $return;
} }
/** /**
@ -216,6 +216,7 @@ class quota extends baseModule {
*/ */
function preDeleteActions() { function preDeleteActions() {
$this->initQuotas(); $this->initQuotas();
if (!isset($this->quota) || !is_array($this->quota)) return true;
// determine if this is a user or group account // determine if this is a user or group account
if ($_SESSION[$this->base]->type=='user') $id = $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0]; if ($_SESSION[$this->base]->type=='user') $id = $_SESSION[$this->base]->module['posixAccount']->attributes['uid'][0];
if ($_SESSION[$this->base]->type=='group') $id = $_SESSION[$this->base]->module['posixGroup']->attributes['cn'][0]; if ($_SESSION[$this->base]->type=='group') $id = $_SESSION[$this->base]->module['posixGroup']->attributes['cn'][0];
@ -249,6 +250,7 @@ class quota extends baseModule {
* @return array list of info/error messages * @return array list of info/error messages
*/ */
function process_attributes() { function process_attributes() {
if (!isset($this->quota) || !is_array($this->quota)) return array();
$errors = array(); $errors = array();
// get list of lamdaemon servers // get list of lamdaemon servers
$serverDescriptions = array(); $serverDescriptions = array();
@ -469,6 +471,7 @@ class quota extends baseModule {
*/ */
function load_profile($profile) { function load_profile($profile) {
$this->initQuotas(); $this->initQuotas();
if (!isset($this->quota) || !is_array($this->quota)) return;
$servers = array_keys($this->quota); $servers = array_keys($this->quota);
for ($s = 0; $s < sizeof($servers); $s++) { for ($s = 0; $s < sizeof($servers); $s++) {
$server = $servers[$s]; $server = $servers[$s];
@ -490,6 +493,7 @@ class quota extends baseModule {
*/ */
function get_pdfEntries() { function get_pdfEntries() {
$this->initQuotas(); $this->initQuotas();
if (!isset($this->quota) || !is_array($this->quota)) return array();
if (sizeof($this->quota) > 0) { if (sizeof($this->quota) > 0) {
$quotas = array(); $quotas = array();
// get list of lamdaemon servers // get list of lamdaemon servers
@ -543,6 +547,7 @@ class quota extends baseModule {
*/ */
function get_uploadColumns() { function get_uploadColumns() {
$this->initQuotas(); $this->initQuotas();
if (!isset($this->quota) || !is_array($this->quota)) return array();
$return = array(); $return = array();
if (sizeof($this->quota) > 0) { if (sizeof($this->quota) > 0) {
// get list of lamdaemon servers // get list of lamdaemon servers