return true;
}
-
- // enablePlugin either enables or disables a specific plugin for team.
- static function enablePlugin($plugin, $enable = true)
- {
- global $user;
- if (!$user->can('manage_features'))
- return false;
-
- $plugin_array = explode(',', $user->plugins);
- if ($enable && !in_array($plugin, $plugin_array))
- $plugin_array[] = $plugin; // Add plugin to array.
-
- if (!$enable && in_array($plugin, $plugin_array)) {
- $key = array_search($plugin, $plugin_array);
- if ($key !== false)
- unset($plugin_array[$key]); // Remove plugin from array.
- }
-
- $plugins = implode(',', $plugin_array);
- if ($plugins != $user->plugins) {
- if (!$user->updateGroup(array('plugins' => $plugins)))
- return false;
- $user->plugins = $plugins;
- }
-
- return true;
- }
}
// updateGroup updates group information with new data.
function updateGroup($fields) {
+ if (!($this->can('manage_basic_settings') ||
+ $this->can('manage_advanced_settings') ||
+ $this->can('manage_features'))) return false;
$mdb2 = getConnection();
return true;
}
+
+ // enablePlugin either enables or disables a specific plugin for group.
+ function enablePlugin($plugin, $enable = true)
+ {
+ if (!$this->can('manage_advanced_settings'))
+ return false; // Note: enablePlugin is currently only used on week_view.php.
+ // So, it's not really a plugin we are enabling, but rather week view display options.
+ // Therefore, a check for manage_advanced_settings, not manage_features.
+
+ $plugin_array = explode(',', $this->plugins);
+ if ($enable && !in_array($plugin, $plugin_array))
+ $plugin_array[] = $plugin; // Add plugin to array.
+
+ if (!$enable && in_array($plugin, $plugin_array)) {
+ $key = array_search($plugin, $plugin_array);
+ if ($key !== false)
+ unset($plugin_array[$key]); // Remove plugin from array.
+ }
+
+ $plugins = implode(',', $plugin_array);
+ if ($plugins != $this->plugins) {
+ if (!$this->updateGroup(array('plugins' => $plugins)))
+ return false;
+ $this->plugins = $plugins;
+ }
+
+ return true;
+ }
}
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.87.4241 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.87.4242 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
if ($request->isPost()){
- if (!ttTeamHelper::enablePlugin('wvn', $cl_week_note) ||
- !ttTeamHelper::enablePlugin('wvl', $cl_week_list) ||
- !ttTeamHelper::enablePlugin('wvns', $cl_notes)) {
+ if (!$user->enablePlugin('wvn', $cl_week_note) ||
+ !$user->enablePlugin('wvl', $cl_week_list) ||
+ !$user->enablePlugin('wvns', $cl_notes)) {
$err->add($i18n->get('error.db'));
}
}