From: Nik Okuntseff Date: Fri, 23 Nov 2018 12:20:09 +0000 (+0000) Subject: Improved ttUser::updateGroup for subgroup support. X-Git-Tag: timetracker_1.19-1~570 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=94737b99e973c5ff06e58d10f1c32c0955462a8f;p=timetracker.git Improved ttUser::updateGroup for subgroup support. --- diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index ad5c0410..79f7ae77 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -509,8 +509,13 @@ class ttUser { if (!($this->can('manage_basic_settings') || $this->can('manage_advanced_settings') || $this->can('manage_features'))) return false; + // TODO: update the above for subgroup updates. + + $group_id = $fields['group_id']; + if ($group_id && !$this->isGroupValid($group_id)) return false; $mdb2 = getConnection(); + if (!$group_id) $group_id = $this->getActiveGroup(); if (isset($fields['name'])) $name_part = ', name = '.$mdb2->quote($fields['name']); if (isset($fields['currency'])) $currency_part = ', currency = '.$mdb2->quote($fields['currency']); @@ -537,7 +542,7 @@ class ttUser { $time_format_part.$week_start_part.$tracking_mode_part.$task_required_part.$project_required_part.$record_type_part. $bcc_email_part.$allow_ip_part.$plugins_part.$config_part.$lock_spec_part.$workday_minutes_part.$modified_part, ','); - $sql = "update tt_groups set $parts where id = $this->group_id"; + $sql = "update tt_groups set $parts where id = $group_id and org_id = $this->org_id"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 50749d42..72436ab5 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.18.27.4495 | Copyright © Anuko | +  Anuko Time Tracker 1.18.27.4496 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}