diff --git a/application/core/EA_Controller.php b/application/core/EA_Controller.php index dafbc757..325d5a59 100644 --- a/application/core/EA_Controller.php +++ b/application/core/EA_Controller.php @@ -51,6 +51,7 @@ * @property Settings_model $settings_model * @property Users_model $users_model * + * @property Accounts $accounts * @property Availability $availability * @property Google_Sync $google_sync * @property Ics_file $ics_file @@ -74,9 +75,11 @@ class EA_Controller extends CI_Controller { */ private function configure_language() { - if ($this->session->has_userdata('language')) + $session_language = session('language'); + + if ($session_language) { - $this->config->set_item('language', $this->session->userdata('language')); + config(['language' => $session_language]); } $this->lang->load('translations'); diff --git a/application/core/EA_Model.php b/application/core/EA_Model.php index 25c61779..b6cfe662 100644 --- a/application/core/EA_Model.php +++ b/application/core/EA_Model.php @@ -51,6 +51,7 @@ * @property Settings_model $settings_model * @property Users_model $users_model * + * @property Accounts $accounts * @property Availability $availability * @property Google_Sync $google_sync * @property Ics_file $ics_file diff --git a/application/libraries/Accounts.php b/application/libraries/Accounts.php index da9c1cb0..1ba75c6e 100644 --- a/application/libraries/Accounts.php +++ b/application/libraries/Accounts.php @@ -13,9 +13,11 @@ /** - * Accounts + * Accounts library * - * Handles any account related functionality. + * Handles account related functionality. + * + * @package Libraries */ class Accounts { /** @@ -24,40 +26,16 @@ class Accounts { protected $CI; /** - * Availability constructor. + * Accounts constructor. */ public function __construct() { $this->CI =& get_instance(); - $this->CI->load->model('users'); + $this->CI->load->model('users_model'); + $this->CI->load->model('roles_model'); $this->CI->load->library('timezones'); - - $this->CI->load->helper('password'); - $this->CI->load->helper('string'); - } - - /** - * Get the user data from the database. - * - * @param int $user_id User ID. - * - * @return array Returns an array with user data. - */ - public function get_user(int $user_id): array - { - return $this->CI->users_model->find($user_id); - } - - /** - * Update a user. - * - * @param array $user Associative array with the user data. - */ - public function save_user(array $user): void - { - $this->CI->users_model->save($user); } /**