- Timestamp:
- Jul 6, 2008, 12:36:39 AM (16 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_user.inc.php
r2411 r2425 152 152 } 153 153 154 create_user_infos($next_id); 154 $override = null; 155 if ($with_notification and $conf['browser_language']) 156 { 157 if ( !get_browser_language($override['language']) ) 158 $override=null; 159 } 160 create_user_infos($next_id, $override); 155 161 156 162 if ($with_notification and $conf['email_admin_on_new_user']) … … 839 845 function get_default_language() 840 846 { 841 global $conf; 842 if (isset($conf['browser_language']) and $conf['browser_language']) 843 { 844 return get_browser_language(); 845 } 846 else 847 { 848 return get_default_user_value('language', PHPWG_DEFAULT_LANGUAGE); 849 } 847 return get_default_user_value('language', PHPWG_DEFAULT_LANGUAGE); 850 848 } 851 849 852 850 /** 853 * Returns t he browser language value851 * Returns true if the browser language value is set into param $lang 854 852 * 855 853 */ 856 function get_browser_language( )854 function get_browser_language(&$lang) 857 855 { 858 856 $browser_language = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2); … … 861 859 if (substr($language_code, 0, 2) == $browser_language) 862 860 { 863 return $language_code; 864 } 865 } 866 return PHPWG_DEFAULT_LANGUAGE; 861 $lang = $language_code; 862 return true; 863 } 864 } 865 return false; 867 866 } 868 867 … … 924 923 $status = 'normal'; 925 924 } 926 $default_user['language'] = get_default_language();927 925 928 926 $insert = array_merge( -
trunk/include/user.inc.php
r2371 r2425 70 70 ( defined('IN_ADMIN') and IN_ADMIN ) ? false : true // use cache ? 71 71 ); 72 if ( is_a_guest() or is_generic())72 if ($conf['browser_language'] and (is_a_guest() or is_generic()) ) 73 73 { 74 $user['language'] = get_default_language();74 get_browser_language($user['language']); 75 75 } 76 76 trigger_action('user_init', $user);
Note: See TracChangeset
for help on using the changeset viewer.