From f20ba236407fd255ff26d4503402c8d5af173fd7 Mon Sep 17 00:00:00 2001 From: jekkos Date: Fri, 17 Aug 2018 23:54:47 +0200 Subject: [PATCH] No password change in testing mode (#2073) --- application/controllers/Employees.php | 2 +- application/models/Employee.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/Employees.php b/application/controllers/Employees.php index 3267f5c13..ab68faff8 100644 --- a/application/controllers/Employees.php +++ b/application/controllers/Employees.php @@ -121,7 +121,7 @@ class Employees extends Persons } //Password has been changed OR first time password set - if($this->input->post('password') != '') + if($this->input->post('password') != '' && ENVIRONMENT != 'testing') { $exploded = explode(":", $this->input->post('language')); $employee_data = array( diff --git a/application/models/Employee.php b/application/models/Employee.php index f5678d666..32a11f3d6 100644 --- a/application/models/Employee.php +++ b/application/models/Employee.php @@ -119,11 +119,9 @@ class Employee extends Person //Now insert the new grants if($success) { - $count = 0; foreach($grants_data as $grant) { $success = $this->db->insert('grants', array('permission_id' => $grant['permission_id'], 'person_id' => $employee_id, 'menu_group' => $grant['menu_group'])); - $count = $count+ 1; } } } @@ -473,6 +471,10 @@ class Employee extends Person { $success = FALSE; + if (ENVIRONMENT == 'testing') { + return $success; + } + //Run these queries as a transaction, we want to make sure we do all or nothing $this->db->trans_start();