diff options
author | plegall <plg@piwigo.org> | 2004-12-20 19:26:43 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2004-12-20 19:26:43 +0000 |
commit | c19f01d77c990962baef1906ac0ed60280324b77 (patch) | |
tree | 3adbc0c836875d77d06feb987773030e36646c86 /include/user.inc.php | |
parent | 1d46ea86e9d3925a60f1d126d4b1bd642630741a (diff) |
- 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
Diffstat (limited to '')
-rw-r--r-- | include/user.inc.php | 31 |
1 files changed, 25 insertions, 6 deletions
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']); ?> |