Introduced isPost() function to keep things shorter
authorNik Okuntseff <support@anuko.com>
Tue, 22 Mar 2016 17:08:02 +0000 (10:08 -0700)
committerNik Okuntseff <support@anuko.com>
Tue, 22 Mar 2016 17:08:02 +0000 (10:08 -0700)
WEB-INF/lib/html/HttpRequest.class.php
WEB-INF/templates/footer.tpl
admin_team_add.php

index 84081c7..cea6122 100644 (file)
@@ -31,7 +31,12 @@ class ttHttpRequest {
   function getMethod() {
     return isset( $_SERVER['REQUEST_METHOD'] ) ? $_SERVER['REQUEST_METHOD'] : false;
   }
-       
+
+  // The isPost function determines if a request method is POST.
+  function isPost() {
+    return ($this->getMethod() == 'POST');
+  }
+
   // The getParameter is the primary function of this class. It returns request parameter,
   // identified by $name.
   function getParameter($name = "", $default = null) { 
index 37694d0..5d0b9ca 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.9.16.3433 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.9.16.3434 | 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 5ece36d..06f19bc 100644 (file)
@@ -36,7 +36,7 @@ if (!ttAccessCheck(right_administer_site)) {
   exit();
 }
 
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
   $cl_team_name = trim($request->getParameter('team_name'));
   $cl_manager_name = trim($request->getParameter('manager_name'));
   $cl_manager_login = trim($request->getParameter('manager_login'));
@@ -58,7 +58,7 @@ if (!$auth->isPasswordExternal()) {
 $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_email','value'=>$cl_manager_email));
 $form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
 
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
   // Validate user input.
   if (!ttValidString($cl_team_name, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.team_name'));
   if (!ttValidString($cl_manager_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.manager_name'));
@@ -93,7 +93,7 @@ if ($request->getMethod() == 'POST') {
     } else
       $errors->add($i18n->getKey('error.user_exists'));
   }
-} // POST
+} // isPost
 
 $smarty->assign('auth_external', $auth->isPasswordExternal());
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));