X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=WEB-INF%2Flib%2FttUser.class.php;h=28eeebcfd6a04366be31fc25a28c9d8ef629405e;hb=086b93bd5a71b4c68ae3fa3e37d97182ee2a5b73;hp=73ec7a1e941abeb31b1ada038d4e6faf5a700e83;hpb=30634c0b3869d459552df1da06ec264fb1e6b086;p=timetracker.git diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 73ec7a1e..28eeebcf 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -441,9 +441,7 @@ class ttUser { } if ($include_quota) { $quota = $val['quota_percent']; - if (null == $quota) - $quota = '100'; // Null means 100%. Perhaps enforce not NULLs in db and eliminate this check. - elseif (ttEndsWith($quota, '.00')) + if (ttEndsWith($quota, '.00')) $quota = substr($quota, 0, strlen($quota)-3); // Trim trailing ".00"; elseif ($replaceDecimalMark) $quota = str_replace('.', $decimal_mark, $quota); @@ -594,7 +592,7 @@ class ttUser { return false; // So far, so good. Check user now. - $options = array('group_id'=>$group_id,'status'=>ACTIVE,'max_rank'=>MAX_RANK); + $options = array('status'=>ACTIVE,'max_rank'=>MAX_RANK); $users = $this->getUsers($options); foreach($users as $one_user) { if ($one_user['id'] == $this->behalf_id) @@ -697,7 +695,8 @@ class ttUser { return false; // Mark user as deleted. - $sql = "update tt_users set status = NULL where id = $user_id". + $modified_part = ', modified = now(), modified_ip = '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', modified_by = '.$mdb2->quote($this->id); + $sql = "update tt_users set status = null $modified_part where id = $user_id". " and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error'))