diff --git a/application/models/Admins_model.php b/application/models/Admins_model.php index 364d7646..a081f292 100644 --- a/application/models/Admins_model.php +++ b/application/models/Admins_model.php @@ -116,6 +116,11 @@ class Admins_model extends EA_Model { } } + if ( ! isset($admin['id']) && ! isset($admin['settings']['password'])) + { + throw new Exception('The user password cannot be empty for new users.'); + } + // Validate calendar view mode. if (isset($admin['settings']['calendar_view']) && ($admin['settings']['calendar_view'] !== CALENDAR_VIEW_DEFAULT && $admin['settings']['calendar_view'] !== CALENDAR_VIEW_TABLE)) diff --git a/application/models/Providers_model.php b/application/models/Providers_model.php index 5a7f7145..98df3a34 100755 --- a/application/models/Providers_model.php +++ b/application/models/Providers_model.php @@ -73,7 +73,6 @@ class Providers_model extends EA_Model { */ public function validate($provider) { - // If a provider id is present, check whether the record exist in the database. if (isset($provider['id'])) { @@ -147,6 +146,11 @@ class Providers_model extends EA_Model { } } + if ( ! isset($provider['id']) && ! isset($provider['settings']['password'])) + { + throw new Exception('The user password cannot be empty for new users.'); + } + // Validate calendar view mode. if (isset($provider['settings']['calendar_view']) && ($provider['settings']['calendar_view'] !== CALENDAR_VIEW_DEFAULT && $provider['settings']['calendar_view'] !== CALENDAR_VIEW_TABLE)) diff --git a/application/models/Secretaries_model.php b/application/models/Secretaries_model.php index 9f28a44f..0a8bd153 100644 --- a/application/models/Secretaries_model.php +++ b/application/models/Secretaries_model.php @@ -124,6 +124,11 @@ class Secretaries_model extends EA_Model { } } + if ( ! isset($secretary['id']) && ! isset($secretary['settings']['password'])) + { + throw new Exception('The user password cannot be empty for new users.'); + } + // Validate calendar view mode. if (isset($secretary['settings']['calendar_view']) && ($secretary['settings']['calendar_view'] !== CALENDAR_VIEW_DEFAULT && $secretary['settings']['calendar_view'] !== CALENDAR_VIEW_TABLE))