Siwtched to using isPost() function
[timetracker.git] / user_edit.php
index 060367d..9026fe0 100644 (file)
@@ -64,7 +64,7 @@ if (in_array('cl', explode(',', $user->plugins)))
 $projects = ttTeamHelper::getActiveProjects($user->team_id);
 $assigned_projects = array();
 
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
   $cl_name = trim($request->getParameter('name'));
   $cl_login = trim($request->getParameter('login'));
   if (!$auth->isPasswordExternal()) {
@@ -162,7 +162,7 @@ $form->addInputElement($table);
 $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$user_id));
 $form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.save')));
 
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
   // Validate user input.
   if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.person_name'));
   if (!ttValidString($cl_login)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));