[eluser]xwero[/eluser]
chakhar86, simshaun is autoloading the library. But that is not the main problem.
The main problem is the library gets loaded when the user_id is in the session or not, making database calls when they aren't needed.
The cur_user_level data is only useful when a user is logged in or you have to see the not logged user as a user_level. but that can be checked as follows
Code:
if( ! $this->session->userdata('cur_user_level'))
{
// not logged in
}
else
{
// do something with cur_user_level here
}