livestatus: Stop relying on broken short-cut
[ninja.git] / application / helpers / user.php
blob235e7e828f0d1097c8cd5d8365f993da93d891ec
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
2 /**
3 * Help class for user session data
4 */
5 class user_Core
7 /**
8 * Fetch session data for certain variable
10 * @param $var string: Variable name to return value for
11 * @return Value from session on success. false if not found
13 public static function session($var = false)
15 $return = false;
16 return !empty(Auth::instance()->get_user()->$var) ? Auth::instance()->get_user()->$var : false;
17 $user_data = Session::instance()->get('user_data', false);
18 if (is_object($user_data) && isset($user_data->$var)) {
19 $return = $user_data->$var;
21 if (!$return) {
22 $return = Session::instance()->get($var, false);
24 return $return;