Ignore:
Timestamp:
Dec 20, 2004, 8:26:43 PM (19 years ago)
Author:
plg
Message:
  • 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 $confdefault_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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/user.inc.php

    r648 r650  
    128128}
    129129
    130 $isadmin = false;
    131 if ($user['status'] == 'admin')
    132 {
    133   $isadmin = true;
    134 }
    135130// calculation of the number of picture to display per page
    136131$user['nb_image_page'] = $user['nb_image_line'] * $user['nb_line_page'];
    137132
    138 init_userprefs($user);
     133if (empty($user['language'])
     134    or !file_exists(PHPWG_ROOT_PATH.'language/'.
     135                    $user['language'].'/common.lang.php'))
     136{
     137  $user['language'] = $conf['default_language'];
     138}
     139include_once(PHPWG_ROOT_PATH.'language/'.$user['language'].'/common.lang.php');
     140
     141// only if we are in the administration section
     142if (defined('IN_ADMIN') and IN_ADMIN)
     143{
     144  $langdir = PHPWG_ROOT_PATH.'language/'.$user['language'];
     145  if (!file_exists($langdir.'/admin.lang.php'))
     146  {
     147    $langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language'];
     148  }
     149  include_once($langdir.'/admin.lang.php');
     150  include_once($langdir.'/faq.lang.php');
     151}
     152
     153if (empty($user['template']))
     154{
     155  $user['template'] = $conf['default_template'];
     156}
     157$template = setup_style($user['template']);
    139158?>
Note: See TracChangeset for help on using the changeset viewer.