]> wagnertech.de Git - timetracker.git/blobdiff - user_edit.php
Siwtched to using isPost() function
[timetracker.git] / user_edit.php
index e314e53e3fdcd7d68b658f8b18ab9a93cbd0c492..9026fe0840a7759b320627489d72eb7b5be2e57e 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'));
@@ -175,7 +175,7 @@ if ($request->getMethod() == 'POST') {
   if (!ttValidEmail($cl_email, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.email'));
   if (!ttValidFloat($cl_rate, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('form.users.default_rate'));
 
-  if ($errors->isEmpty()) {
+  if ($errors->no()) {
     $existing_user = ttUserHelper::getUserByLogin($cl_login);
     if (!$existing_user || ($user_id == $existing_user['id'])) {