- 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
This commit is contained in:
plegall
2004-12-20 19:26:43 +00:00
parent 1d46ea86e9
commit c19f01d77c
6 changed files with 62 additions and 127 deletions
+25 -6
View File
@@ -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']);
?>