Improved access check for cf_custom_field_add.php.
authorNik Okuntseff <support@anuko.com>
Tue, 14 Aug 2018 21:16:29 +0000 (21:16 +0000)
committerNik Okuntseff <support@anuko.com>
Tue, 14 Aug 2018 21:16:29 +0000 (21:16 +0000)
WEB-INF/templates/footer.tpl
cf_custom_field_add.php

index 1b7d29c..99c9b21 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.17.98.4319 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.98.4320 | Copyright &copy; <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>
index 922d83b..8227d25 100644 (file)
@@ -39,6 +39,12 @@ if (!$user->isPluginEnabled('cf')) {
   header('Location: feature_disabled.php');
   exit();
 }
+$fields = CustomFields::getFields();
+// Deny access when max number of custom fields is already set.
+if (count($fields) >= 1) {
+  header('Location: access_denied.php');
+  exit();
+}
 
 if ($request->isPost()) {
   $cl_field_name = trim($request->getParameter('name'));