diff options
author | z0rglub <z0rglub@piwigo.org> | 2004-09-18 16:07:40 +0000 |
---|---|---|
committer | z0rglub <z0rglub@piwigo.org> | 2004-09-18 16:07:40 +0000 |
commit | e9cd9b5395ccd88936bf41d7091ae8acee1f5a78 (patch) | |
tree | a4ece7664cc5c240068c6e587e6d1a58d6e5e24b | |
parent | 79de56d63c0b2b9309adbc77c766f5b4a9a728c9 (diff) |
code refactoring
git-svn-id: http://piwigo.org/svn/trunk@524 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions_user.inc.php | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index dfa980adb..5be76dfbc 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -212,10 +212,18 @@ function check_login_authorization() function init_userprefs($userdata) { global $conf, $template, $lang, $lang_info; - + $language = (!empty($userdata['language']) && !$userdata['is_the_guest'] )?$userdata['language']:$conf['default_language']; - $style = (!empty($userdata['template'])&& !$userdata['is_the_guest'] )?$userdata['template']:$conf['default_template']; - + + if (!empty($userdata['template']) and !$userdata['is_the_guest']) + { + $template = $userdata['template']; + } + else + { + $template = $conf['default_template']; + } + if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $language . '/common.lang.php')) ) { $language = DEFAULT_LANGUAGE; @@ -231,8 +239,8 @@ function init_userprefs($userdata) } include_once(PHPWG_ROOT_PATH . 'language/' . $language . '/admin.lang.php'); } - - $template= setup_style($style); + + $template = setup_style($template); return; } |