fixed problem with not set system-charset and non-ascii chars in user-name with accounts in ldap:

Username did not get translated, as at the time when the accounts-class get instanciated the user preferences, which determine the language, which determine the charset (if no system-charset), are not loaded. I use iso-8859-1 as default then, which gives us the same behavior then before all the changes.
This commit is contained in:
Ralf Becker 2003-10-15 12:24:38 +00:00
parent a5b1627506
commit 692767bcf0
4 changed files with 14 additions and 12 deletions

View File

@ -37,7 +37,9 @@
function accounts_()
{
/* This does not get called */
$this->ds = $GLOBALS['phpgw']->common->ldapConnect();
$this->user_context = $GLOBALS['phpgw_info']['server']['ldap_context'];
$this->group_context = $GLOBALS['phpgw_info']['server']['ldap_group_context'];
}
function read_repository()

View File

@ -96,12 +96,7 @@
$this->account_type = $account_type;
}
if($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap')
{
$this->ds = $GLOBALS['phpgw']->common->ldapConnect();
$this->user_context = $GLOBALS['phpgw_info']['server']['ldap_context'];
$this->group_context = $GLOBALS['phpgw_info']['server']['ldap_group_context'];
}
$this->accounts_(); // call constructor of extended class
$this->xmlrpc_methods[] = array(
'name' => 'get_list',

View File

@ -38,7 +38,6 @@
function accounts_()
{
/* Don't think this ever gets called */
$this->db = $GLOBALS['phpgw']->db;
}

View File

@ -93,7 +93,12 @@
}
return $this->charsets[$lang];
}
return $this->system_charset || !is_array($GLOBALS['lang']) ? $this->system_charset : strtolower($this->translate('charset'));
if ($this->system_charset) // do we have a system-charset ==> return it
{
return $this->system_charset;
}
// if no translations are loaded (system-startup) use a default, else lang('charset')
return !is_array($GLOBALS['lang']) ? 'iso-8859-1' : strtolower($this->translate('charset'));
}
function init()
@ -324,7 +329,7 @@
}
foreach($langs as $lang)
{
//echo '<br>Working on: ' . $lang;
echo '<br>Working on: ' . $lang;
$addlang = False;
if ($upgrademethod == 'addonlynew')
{
@ -357,7 +362,7 @@
//echo '<br>Checking in: ' . $app['name'];
if($GLOBALS['phpgw_setup']->app_registered($app) && file_exists($appfile))
{
//echo '<br>Including: ' . $appfile;
echo '<br>Including: ' . $appfile;
$lines = file($appfile);
foreach($lines as $line)
{
@ -373,7 +378,7 @@
}
$charset = @$raw['common']['charset'] ? $raw['common']['charset'] : $this->charset($lang);
//echo "<p>lang='$lang', charset='$charset', system_charset='$this->system_charset')</p>\n";
echo "<p>raw($lang)=<pre>".print_r($raw,True)."</pre>\n";
foreach($raw as $app_name => $ids)
{
foreach($ids as $message_id => $content)
@ -463,6 +468,7 @@
{
// update all langs
$installed = $this->get_installed_langs();
echo "<p>install_langs(".print_r($installed,True).")</p>\n";
$this->install_langs($installed ? array_keys($installed) : array());
break;
}