mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-07 22:05:05 +02:00
- 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:
+25
-6
@@ -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']);
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user