$includeSelf = isset($options['include_self']);
$select_part = 'select u.id, u.group_id, u.name';
- if (isset($options['include_login'])) $select_part .= ', u.login';
+ if (isset($options['include_login'])) {
+ $select_part .= ', u.login';
+ // Piggy-back on include_login to see if we must also include quota_percent.
+ $include_quota = $this->isPluginEnabled('mq');
+ if ($include_quota) {
+ $decimal_mark = $this->getDecimalMark();
+ $replaceDecimalMark = ('.' != $decimal_mark);
+ $select_part .= ', u.quota_percent';
+ }
+ }
if (!isset($options['include_clients'])) $select_part .= ', r.rights';
if (isset($options['include_role'])) $select_part .= ', r.name as role_name, r.rank';
if ($isClient)
continue; // Skip adding clients.
}
+ if ($include_quota) {
+ $quota = $val['quota_percent'];
+ if (ttEndsWith($quota, '.00'))
+ $quota = substr($quota, 0, strlen($quota)-3); // Trim trailing ".00";
+ elseif ($replaceDecimalMark)
+ $quota = str_replace('.', $decimal_mark, $quota);
+ $val['quota_percent'] = $quota.'%';
+ }
$user_list[] = $val;
}
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'))