From c19f01d77c990962baef1906ac0ed60280324b77 Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 20 Dec 2004 19:26:43 +0000 Subject: - replacement of PREFIX_TABLE constant in delete_user function - deletion of $isadmin variable, replaced by constant IN_ADMIN - small refactoring - in include/common.inc.php, deletion of useless part "Obtain and encode users IP" and corresponding functions encode_ip and decode_ip - definition of $conf['default_language'] deleted from include/config.inc.php : it is already present in database table config - function init_userprefs deleted (useless), all its content moved to include/user.inc.php - admin.lang.php and faq.lang.php are loaded only if current user is in administrative section git-svn-id: http://piwigo.org/svn/trunk@650 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/user.inc.php | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'include/user.inc.php') diff --git a/include/user.inc.php b/include/user.inc.php index 4c1561071..c4dc68987 100644 --- a/include/user.inc.php +++ b/include/user.inc.php @@ -127,13 +127,32 @@ if ($user['restrictions'][0] == '') $user['restrictions'] = array(); } -$isadmin = false; -if ($user['status'] == 'admin') -{ - $isadmin = true; -} // calculation of the number of picture to display per page $user['nb_image_page'] = $user['nb_image_line'] * $user['nb_line_page']; -init_userprefs($user); +if (empty($user['language']) + or !file_exists(PHPWG_ROOT_PATH.'language/'. + $user['language'].'/common.lang.php')) +{ + $user['language'] = $conf['default_language']; +} +include_once(PHPWG_ROOT_PATH.'language/'.$user['language'].'/common.lang.php'); + +// only if we are in the administration section +if (defined('IN_ADMIN') and IN_ADMIN) +{ + $langdir = PHPWG_ROOT_PATH.'language/'.$user['language']; + if (!file_exists($langdir.'/admin.lang.php')) + { + $langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language']; + } + include_once($langdir.'/admin.lang.php'); + include_once($langdir.'/faq.lang.php'); +} + +if (empty($user['template'])) +{ + $user['template'] = $conf['default_template']; +} +$template = setup_style($user['template']); ?> -- cgit v1.2.3