'error.access_denied' => 'Access denied.',
'error.sys' => 'System error.',
'error.db' => 'Database error.',
+'error.feature_disabled' => 'Feature is disabled.',
'error.field' => 'Incorrect "{0}" data.',
'error.empty' => 'Field "{0}" is empty.',
'error.not_equal' => 'Field "{0}" is not equal to field "{1}".',
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit')));
if ($request->isPost()) {
+
/*
* Note: creating a group by admin is pretty much the same as self-registration,
- * except that created_by gields for group and user must be set to admin account.
+ * except that created_by fields for group and user must be set to admin account.
* Therefore, we'll reuse ttRegistrator instance to create a group here
* and override created_by fields using ttRegistrator::setCreatedBy() function.
*/
require_once('plugins/CustomFields.class.php');
import('form.Form');
-// Access check.
-if (!ttAccessAllowed('manage_custom_fields') || !$user->isPluginEnabled('cf')) {
+// Access checks.
+if (!ttAccessAllowed('manage_custom_fields')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('cf')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
if ($request->isPost()) {
$cl_field_name = trim($request->getParameter('name'));
require_once('plugins/CustomFields.class.php');
import('form.Form');
-// Access check.
-if (!ttAccessAllowed('manage_custom_fields') || !$user->isPluginEnabled('cf')) {
+// Access checks.
+if (!ttAccessAllowed('manage_custom_fields')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('cf')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$id = $request->getParameter('id');
require_once('plugins/CustomFields.class.php');
import('form.Form');
-// Access check.
-if (!ttAccessAllowed('manage_custom_fields') || !$user->isPluginEnabled('cf')) {
+// Access checks.
+if (!ttAccessAllowed('manage_custom_fields')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('cf')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$cl_id = $request->getParameter('id');
$field = CustomFields::getField($cl_id);
require_once('plugins/CustomFields.class.php');
import('form.Form');
-// Access check.
-if (!ttAccessAllowed('manage_custom_fields') || !$user->isPluginEnabled('cf')) {
+// Access checks.
+if (!ttAccessAllowed('manage_custom_fields')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('cf')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$form = new Form('customFieldsForm');
require_once('plugins/CustomFields.class.php');
import('form.Form');
-// Access check.
-if (!ttAccessAllowed('manage_custom_fields') || !$user->isPluginEnabled('cf')) {
+// Access checks.
+if (!ttAccessAllowed('manage_custom_fields')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('cf')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$cl_field_id = $request->getParameter('field_id');
$field = CustomFields::getField($cl_field_id);
require_once('plugins/CustomFields.class.php');
import('form.Form');
-// Access check.
-if (!ttAccessAllowed('manage_custom_fields') || !$user->isPluginEnabled('cf')) {
+// Access checks.
+if (!ttAccessAllowed('manage_custom_fields')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('cf')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$cl_id = $request->getParameter('id');
$form = new Form('optionDeleteForm');
require_once('plugins/CustomFields.class.php');
import('form.Form');
-// Access check.
-if (!ttAccessAllowed('manage_custom_fields') || !$user->isPluginEnabled('cf')) {
+// Access checks.
+if (!ttAccessAllowed('manage_custom_fields')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('cf')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$cl_id = $request->getParameter('id');
$cl_name = CustomFields::getOptionName($cl_id);
require_once('plugins/CustomFields.class.php');
import('form.Form');
-// Access check.
-if (!ttAccessAllowed('manage_custom_fields') || !$user->isPluginEnabled('cf')) {
+// Access checks.
+if (!ttAccessAllowed('manage_custom_fields')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('cf')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$field_id = $request->getParameter('field_id');
$options = CustomFields::getOptions($field_id);
import('ttUserHelper');
import('ttTeamHelper');
-// Access check.
-if (!ttAccessAllowed('view_own_charts') || !$user->isPluginEnabled('ch')) {
+// Access checks.
+if (!ttAccessAllowed('view_own_charts')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('ch')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
+
+
// Initialize and store date in session.
$cl_date = $request->getParameter('date', @$_SESSION['date']);
--- /dev/null
+<?php
+// +----------------------------------------------------------------------+
+// | Anuko Time Tracker
+// +----------------------------------------------------------------------+
+// | Copyright (c) Anuko International Ltd. (https://www.anuko.com)
+// +----------------------------------------------------------------------+
+// | LIBERAL FREEWARE LICENSE: This source code document may be used
+// | by anyone for any purpose, and freely redistributed alone or in
+// | combination with other software, provided that the license is obeyed.
+// |
+// | There are only two ways to violate the license:
+// |
+// | 1. To redistribute this code in source form, with the copyright
+// | notice or license removed or altered. (Distributing in compiled
+// | forms without embedded copyright notices is permitted).
+// |
+// | 2. To redistribute modified versions of this code in *any* form
+// | that bears insufficient indications that the modifications are
+// | not the work of the original author(s).
+// |
+// | This license applies to this document only, not any other software
+// | that it may be combined with.
+// |
+// +----------------------------------------------------------------------+
+// | Contributors:
+// | https://www.anuko.com/time_tracker/credits.htm
+// +----------------------------------------------------------------------+
+
+require_once('initialize.php');
+
+$err->add($i18n->get('error.feature_disabled'));
+if ($auth->isAuthenticated()) $smarty->assign('authenticated', true); // Used in header.tpl for menu display.
+
+$smarty->assign('title', $i18n->get('label.error'));
+$smarty->assign('content_page_name', 'access_denied.tpl');
+$smarty->display('index.tpl');