Implement user settings

This commit is contained in:
Eike Foken
2011-09-15 18:28:45 +02:00
parent 59739561b4
commit 1496c44505
5 changed files with 72 additions and 3 deletions

View File

@@ -273,6 +273,22 @@ class Access {
return $this->cache['profile'];
}
/**
* Gets the settings of the current user.
*
* @return array
*/
public function settings($key) {
if ((boolean) $this->CI->session->userdata('settings')) {
$settings = $this->CI->session->userdata('settings');
} else {
$settings = $this->CI->user->getSettings($this->CI->session->userdata('user_id'));
$this->CI->session->set_userdata('settings', $settings);
}
return isset($settings[$key]) ? $settings[$key] : false;
}
}
/* End of file Access.php */