Replaced the "show_error" with the "abort" equivalent

This commit is contained in:
Alex Tselegidis 2021-12-18 17:32:05 +01:00
parent 0ff19b050d
commit 526df6e4d7
5 changed files with 22 additions and 22 deletions

View file

@ -45,7 +45,7 @@ class Admins extends EA_Controller {
if (cannot('view', PRIV_USERS)) if (cannot('view', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$user_id = session('user_id'); $user_id = session('user_id');
@ -104,7 +104,7 @@ class Admins extends EA_Controller {
if (cannot('add', PRIV_USERS)) if (cannot('add', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$admin_id = $this->admins_model->save($admin); $admin_id = $this->admins_model->save($admin);
@ -131,7 +131,7 @@ class Admins extends EA_Controller {
if (cannot('edit', PRIV_USERS)) if (cannot('edit', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$admin_id = $this->admins_model->save($admin); $admin_id = $this->admins_model->save($admin);
@ -156,7 +156,7 @@ class Admins extends EA_Controller {
{ {
if (cannot('delete', PRIV_USERS)) if (cannot('delete', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$admin_id = request('admin_id'); $admin_id = request('admin_id');
@ -182,7 +182,7 @@ class Admins extends EA_Controller {
{ {
if (cannot('view', PRIV_USERS)) if (cannot('view', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$admin_id = request('admin_id'); $admin_id = request('admin_id');

View file

@ -57,7 +57,7 @@ class Appointments extends EA_Controller {
{ {
if (cannot('view', PRIV_APPOINTMENTS)) if (cannot('view', PRIV_APPOINTMENTS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$keyword = request('keyword', ''); $keyword = request('keyword', '');
@ -89,7 +89,7 @@ class Appointments extends EA_Controller {
if (cannot('add', PRIV_APPOINTMENTS)) if (cannot('add', PRIV_APPOINTMENTS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$appointment_id = $this->appointments_model->save($appointment); $appointment_id = $this->appointments_model->save($appointment);
@ -116,7 +116,7 @@ class Appointments extends EA_Controller {
if (cannot('edit', PRIV_APPOINTMENTS)) if (cannot('edit', PRIV_APPOINTMENTS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$appointment_id = $this->appointments_model->save($appointment); $appointment_id = $this->appointments_model->save($appointment);
@ -141,7 +141,7 @@ class Appointments extends EA_Controller {
{ {
if (cannot('delete', PRIV_APPOINTMENTS)) if (cannot('delete', PRIV_APPOINTMENTS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$appointment_id = request('appointment_id'); $appointment_id = request('appointment_id');
@ -167,7 +167,7 @@ class Appointments extends EA_Controller {
{ {
if (cannot('view', PRIV_APPOINTMENTS)) if (cannot('view', PRIV_APPOINTMENTS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$appointment_id = request('appointment_id'); $appointment_id = request('appointment_id');

View file

@ -54,7 +54,7 @@ class Legal_settings extends EA_Controller {
if (cannot('view', PRIV_SYSTEM_SETTINGS)) if (cannot('view', PRIV_SYSTEM_SETTINGS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$user_id = session('user_id'); $user_id = session('user_id');

View file

@ -46,7 +46,7 @@ class Secretaries extends EA_Controller {
if (cannot('view', PRIV_USERS)) if (cannot('view', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$user_id = session('user_id'); $user_id = session('user_id');
@ -74,7 +74,7 @@ class Secretaries extends EA_Controller {
{ {
if (cannot('view', PRIV_USERS)) if (cannot('view', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$keyword = request('keyword', ''); $keyword = request('keyword', '');
@ -106,7 +106,7 @@ class Secretaries extends EA_Controller {
if (cannot('add', PRIV_USERS)) if (cannot('add', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$secretary_id = $this->secretaries_model->save($secretary); $secretary_id = $this->secretaries_model->save($secretary);
@ -133,7 +133,7 @@ class Secretaries extends EA_Controller {
if (cannot('edit', PRIV_USERS)) if (cannot('edit', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$secretary_id = $this->secretaries_model->save($secretary); $secretary_id = $this->secretaries_model->save($secretary);
@ -158,7 +158,7 @@ class Secretaries extends EA_Controller {
{ {
if (cannot('delete', PRIV_USERS)) if (cannot('delete', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$secretary_id = request('secretary_id'); $secretary_id = request('secretary_id');
@ -184,7 +184,7 @@ class Secretaries extends EA_Controller {
{ {
if (cannot('view', PRIV_USERS)) if (cannot('view', PRIV_USERS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$secretary_id = request('secretary_id'); $secretary_id = request('secretary_id');

View file

@ -42,7 +42,7 @@ class Unavailabilities extends EA_Controller {
{ {
if (cannot('view', PRIV_APPOINTMENTS)) if (cannot('view', PRIV_APPOINTMENTS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$keyword = request('keyword', ''); $keyword = request('keyword', '');
@ -74,7 +74,7 @@ class Unavailabilities extends EA_Controller {
if (cannot('add', PRIV_APPOINTMENTS)) if (cannot('add', PRIV_APPOINTMENTS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$unavailability_id = $this->unavailabilities_model->save($unavailability); $unavailability_id = $this->unavailabilities_model->save($unavailability);
@ -101,7 +101,7 @@ class Unavailabilities extends EA_Controller {
if (cannot('edit', PRIV_APPOINTMENTS)) if (cannot('edit', PRIV_APPOINTMENTS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$unavailability_id = $this->unavailabilities_model->save($unavailability); $unavailability_id = $this->unavailabilities_model->save($unavailability);
@ -126,7 +126,7 @@ class Unavailabilities extends EA_Controller {
{ {
if (cannot('delete', PRIV_APPOINTMENTS)) if (cannot('delete', PRIV_APPOINTMENTS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$unavailability_id = request('unavailability_id'); $unavailability_id = request('unavailability_id');
@ -152,7 +152,7 @@ class Unavailabilities extends EA_Controller {
{ {
if (cannot('view', PRIV_APPOINTMENTS)) if (cannot('view', PRIV_APPOINTMENTS))
{ {
show_error('Forbidden', 403); abort(403, 'Forbidden');
} }
$unavailability_id = request('unavailability_id'); $unavailability_id = request('unavailability_id');