Changeset 1930


Ignore:
Timestamp:
03/29/07 00:30:04 (13 years ago)
Author:
rub
Message:

Issue 578
User guest must be real user

Step 2: Installation finished, guest must be used on list and group, corrections

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_perm.php

    r1900 r1930  
    276276       '.$conf['user_fields']['username'].' AS username 
    277277  FROM '.USERS_TABLE.' 
    278   WHERE '.$conf['user_fields']['id'].' != '.$conf['guest_id'].' 
    279278;'; 
    280279$result = pwg_query($query); 
  • trunk/admin/user_list.php

    r1926 r1930  
    104104    LEFT JOIN '.USER_GROUP_TABLE.' AS ug 
    105105      ON u.'.$conf['user_fields']['id'].' = ug.user_id 
    106   WHERE u.'.$conf['user_fields']['id'].' != '.$conf['guest_id']; 
     106  WHERE u.'.$conf['user_fields']['id'].' > 0'; 
    107107  if (isset($filter['username'])) 
    108108  { 
     
    792792      'U_PROFILE' => $profile_url.$local_user['id'], 
    793793      'U_PERM' => $perm_url.$local_user['id'], 
    794       'USERNAME' => $local_user['username'], 
    795       'STATUS' => $lang['user_status_'.$local_user['status']].(($local_user['adviser'] == 'true') ? ' ['.$lang['adviser'].']' : ''), 
     794      'USERNAME' => $local_user['username'] 
     795        .($local_user['id'] == $conf['guest_id'] 
     796          ? '<BR />['.l10n('is_the_guest').']' : '') 
     797        .($local_user['id'] == $conf['default_user_id'] 
     798          ? '<BR />['.l10n('is_the_default').']' : ''), 
     799      'STATUS' => $lang['user_status_'. 
     800        $local_user['status']].(($local_user['adviser'] == 'true') 
     801        ? '<BR />['.l10n('adviser').']' : ''), 
    796802      'EMAIL' => get_email_address_as_display_text($local_user['email']), 
    797803      'GROUPS' => $groups_string, 
    798       'PROPERTIES' => (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true')) ? $lang['is_high_enabled'] : $lang['is_high_disabled'] 
     804      'PROPERTIES' =>  
     805        (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true')) 
     806        ? $lang['is_high_enabled'] : $lang['is_high_disabled'] 
    799807      ) 
    800808    ); 
  • trunk/include/functions_user.inc.php

    r1926 r1930  
    727727    $result = pwg_query($query); 
    728728    $page['cache_default_user'] = mysql_fetch_assoc($result); 
     729     
     730    if ($page['cache_default_user'] !== false) 
     731    { 
     732      unset($page['cache_default_user']['user_id']); 
     733      unset($page['cache_default_user']['status']); 
     734      unset($page['cache_default_user']['registration_date']); 
     735    } 
    729736  } 
    730737 
     
    794801 * 
    795802 * @param int user_id / array of user_if 
    796  */ 
    797 function create_user_infos($arg_id) 
     803 * @param array of values used to override default user values 
     804 */ 
     805function create_user_infos($arg_id, $override_values = null) 
    798806{ 
    799807  global $conf; 
     
    823831      $default_user = array(); 
    824832    } 
    825      
     833 
     834    if (!is_null($override_values)) 
     835    { 
     836      $default_user = array_merge($default_user, $override_values); 
     837      print_r($default_user); 
     838    } 
    826839 
    827840    foreach ($user_ids as $user_id) 
     
    841854      } 
    842855 
    843       $insert = 
     856      $insert = array_merge( 
     857        $default_user, 
    844858        array( 
    845859          'user_id' => $user_id, 
    846860          'status' => $status, 
    847861          'registration_date' => $dbnow 
    848           ); 
     862          )); 
    849863 
    850864      array_push($inserts, $insert); 
  • trunk/install.php

    r1900 r1930  
    313313      ); 
    314314 
    315     $query = ' 
    316 UPDATE '.CONFIG_TABLE.' 
    317   SET value = \''.$language.'\' 
    318   WHERE param = \'default_language\' 
    319 ;'; 
    320     mysql_query($query); 
    321  
    322315    // fill $conf global array 
    323316    load_conf_from_db(); 
     
    344337    mass_inserts(USERS_TABLE, array_keys($inserts[0]), $inserts); 
    345338 
    346     create_user_infos(1); 
    347     create_user_infos(2); 
    348  
    349     $query = ' 
    350 UPDATE '.USER_INFOS_TABLE.' 
    351   SET language = \''.$language.'\' 
    352 ;'; 
    353     mysql_query($query); 
     339    create_user_infos(array(1,2), array('language' => $language)); 
    354340 
    355341    // Available upgrades must be ignored after a fresh installation. To 
  • trunk/language/en_UK.iso-8859-1/admin.lang.php

    r1928 r1930  
    590590$lang['%d guests'] = '%d guests'; 
    591591$lang['Hour'] = 'Hour'; 
     592$lang['is_the_guest'] = 'guest'; 
     593$lang['is_the_default'] = 'default values'; 
    592594?> 
  • trunk/language/fr_FR.iso-8859-1/admin.lang.php

    r1928 r1930  
    589589$lang['%d guests'] = '%d invités'; 
    590590$lang['Hour'] = 'Heure'; 
     591$lang['is_the_guest'] = 'invité'; 
     592$lang['is_the_default'] = 'valeurs par défaut'; 
    591593?> 
Note: See TracChangeset for help on using the changeset viewer.