From: Janusz Dobrowolski Date: Thu, 5 Aug 2010 10:03:06 +0000 (+0000) Subject: user_theme() fixed to be used also before login, warning suppressed in array_search_value X-Git-Tag: v2.4.2~19^2~738 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=0be968c32faf8bbb26f5353e8af6e2169ea2c220;hp=46adaa0c03e5bb3ec387cbd95483175be4f08dfb;p=fa-stable.git user_theme() fixed to be used also before login, warning suppressed in array_search_value --- diff --git a/includes/current_user.inc b/includes/current_user.inc index a7a35303..ab5073a6 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -353,7 +353,8 @@ function user_dec_sep() function user_theme() { - return $_SESSION["wa_current_user"]->prefs->get_theme(); + return isset($_SESSION["wa_current_user"]) ? + $_SESSION["wa_current_user"]->prefs->get_theme() : 'default'; } function user_pagesize() @@ -469,7 +470,7 @@ function array_append(&$array, $elements) function array_search_value($needle, $haystack, $valuekey=null) { foreach($haystack as $key => $value) { - $val = isset($valuekey) ? $value[$valuekey] : $value; + $val = isset($valuekey) ? @$value[$valuekey] : $value; if ($needle == $val){ return $value; }