The password must be provided when creating a new user (#954)
This commit is contained in:
parent
9ad3ed929f
commit
2dc5439b5d
3 changed files with 15 additions and 1 deletions
|
@ -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.
|
// Validate calendar view mode.
|
||||||
if (isset($admin['settings']['calendar_view']) && ($admin['settings']['calendar_view'] !== CALENDAR_VIEW_DEFAULT
|
if (isset($admin['settings']['calendar_view']) && ($admin['settings']['calendar_view'] !== CALENDAR_VIEW_DEFAULT
|
||||||
&& $admin['settings']['calendar_view'] !== CALENDAR_VIEW_TABLE))
|
&& $admin['settings']['calendar_view'] !== CALENDAR_VIEW_TABLE))
|
||||||
|
|
|
@ -73,7 +73,6 @@ class Providers_model extends EA_Model {
|
||||||
*/
|
*/
|
||||||
public function validate($provider)
|
public function validate($provider)
|
||||||
{
|
{
|
||||||
|
|
||||||
// If a provider id is present, check whether the record exist in the database.
|
// If a provider id is present, check whether the record exist in the database.
|
||||||
if (isset($provider['id']))
|
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.
|
// Validate calendar view mode.
|
||||||
if (isset($provider['settings']['calendar_view']) && ($provider['settings']['calendar_view'] !== CALENDAR_VIEW_DEFAULT
|
if (isset($provider['settings']['calendar_view']) && ($provider['settings']['calendar_view'] !== CALENDAR_VIEW_DEFAULT
|
||||||
&& $provider['settings']['calendar_view'] !== CALENDAR_VIEW_TABLE))
|
&& $provider['settings']['calendar_view'] !== CALENDAR_VIEW_TABLE))
|
||||||
|
|
|
@ -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.
|
// Validate calendar view mode.
|
||||||
if (isset($secretary['settings']['calendar_view']) && ($secretary['settings']['calendar_view'] !== CALENDAR_VIEW_DEFAULT
|
if (isset($secretary['settings']['calendar_view']) && ($secretary['settings']['calendar_view'] !== CALENDAR_VIEW_DEFAULT
|
||||||
&& $secretary['settings']['calendar_view'] !== CALENDAR_VIEW_TABLE))
|
&& $secretary['settings']['calendar_view'] !== CALENDAR_VIEW_TABLE))
|
||||||
|
|
Loading…
Reference in a new issue