No password change in testing mode (#2073)

This commit is contained in:
FrancescoUK authored and GitHub committed 2018-08-18 13:17:42 +01:00
commit 04b9a181dc
2 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -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(
+12 -12
View File
@@ -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;
}
}
}
@@ -366,7 +364,7 @@ class Employee extends Person
/*
Determines whether the employee has access to at least one submodule
*/
*/
public function has_module_grant($permission_id, $person_id)
{
$this->db->from('grants');
@@ -433,8 +431,8 @@ class Employee extends Person
}
/*
Gets employee permission grants
*/
Gets employee permission grants
*/
public function get_employee_grants($person_id)
{
$this->db->from('grants');
@@ -443,7 +441,6 @@ class Employee extends Person
return $this->db->get()->result_array();
}
/*
Attempts to login employee and set session. Returns boolean based on outcome.
*/
@@ -473,15 +470,18 @@ class Employee extends Person
{
$success = FALSE;
//Run these queries as a transaction, we want to make sure we do all or nothing
$this->db->trans_start();
if(ENVIRONMENT != 'testing')
{
//Run these queries as a transaction, we want to make sure we do all or nothing
$this->db->trans_start();
$this->db->where('person_id', $employee_id);
$success = $this->db->update('employees', $employee_data);
$this->db->where('person_id', $employee_id);
$success = $this->db->update('employees', $employee_data);
$this->db->trans_complete();
$this->db->trans_complete();
$success &= $this->db->trans_status();
$success &= $this->db->trans_status();
}
return $success;
}