--- ./index.php-dist 2003-01-03 00:00:00.000000000 +0200 +++ ./index.php 2004-05-17 20:58:00.000000000 +0300 @@ -27,6 +27,8 @@ } else { $main_page = Horde::applicationUrl('login.php'); } + if (isset($HTTP_GET_VARS['module'])) + $main_page = $main_page . "?module=" . $HTTP_GET_VARS['module']; if ($browser->hasFeature('wml')) { include HORDE_TEMPLATES . '/index/wap.inc'; } elseif ($conf['menu']['floating_bar'] && (!$browser->hasQuirk('avoid_popup_windows'))) { --- ./lib/MIME.php-dist 2003-01-15 00:00:00.000000000 +0200 +++ ./lib/MIME.php 2004-05-18 01:31:00.000000000 +0300 @@ -213,13 +213,53 @@ /* Convert Cyrillic character sets. */ if (stristr(Lang::getCharset(), 'windows-1251')) { - if (stristr($charset, 'koi8-r')) { +// if (stristr($charset, 'koi8-r')) { + if ((stristr($charset, 'koi8-r')) or + (stristr($charset, 'koi8r')) or (stristr($mime->charset, 'koi8-ru')) or + (stristr($charset, 'koi8'))) { $decoded = convert_cyr_string($decoded, 'k', 'w'); + } else if (stristr($charset, 'iso-8859-5')) { + $decoded = convert_cyr_string($decoded, 'i', 'w'); + } else if ((stristr($charset, 'x-cp866')) or + (stristr($charset, 'csibm866')) or (stristr($charset, 'ibm866'))) { + $decoded = convert_cyr_string($decoded, 'd', 'w'); + } else if ((stristr($charset, 'x-mac-cyrillic')) or + (stristr($charset, 'maccyrillic')) or (stristr($charset, 'mac-cyrillic'))) { + $decoded = convert_cyr_string($decoded, 'm', 'w'); + } elseif ((stristr($charset, 'utf-8')) or (stristr($charset, 'utf8'))) { + if (function_exists('mb_convert_encoding')) { + $decoded_tmp = @mb_convert_encoding($decoded, 'WINDOWS-1251', 'UTF8'); + if ($decoded_tmp) { + $decoded = $decoded_tmp; + } else { + $decoded = convert_cyr_string(@mb_convert_encoding($decoded, 'ISO-8859-5', 'UTF8'),' i', 'w'); + } + + } } } if (stristr(Lang::getCharset(), 'koi8-r')) { - if (stristr($charset, 'windows-1251')) { +// if (stristr($charset, 'windows-1251')) { + if ((stristr($charset, 'windows-1251')) or (stristr($charset, 'cp1251'))) { $decoded = convert_cyr_string($decoded, 'w', 'k'); + } else if (stristr($charset, 'iso-8859-5')) { + $decoded = convert_cyr_string($decoded, 'i', 'k'); + } else if ((stristr($charset, 'x-cp866')) or + (stristr($charset, 'csibm866')) or (stristr($charset, 'ibm866'))) { + $decoded = convert_cyr_string($decoded, 'd', 'k'); + } else if ((stristr($charset, 'x-mac-cyrillic')) or + (stristr($charset, 'maccyrillic')) or (stristr($charset, 'mac-cyrillic'))) { + $decoded = convert_cyr_string($decoded, 'm', 'k'); + } elseif ((stristr($charset, 'utf-8')) or (stristr($charset, 'utf8'))) { + if (function_exists('mb_convert_encoding')) { + $decoded_tmp = @mb_convert_encoding($decoded, 'KOI8-R', 'UTF8'); + if ($decoded_tmp) { + $decoded = $decoded_tmp; + } else { + $decoded = convert_cyr_string(@mb_convert_encoding($decoded, 'ISO-8859-5', 'UTF8'), 'i', 'k'); + } + + } } } @@ -229,13 +269,53 @@ case 'b': $decoded = urldecode(base64_decode($encoded_text)); if (stristr(Lang::getCharset(), 'windows-1251')) { - if (stristr($charset, 'koi8-r')) { +// if (stristr($charset, 'koi8-r')) { + if ((stristr($charset, 'koi8-r')) or + (stristr($charset, 'koi8r')) or (stristr($mime->charset, 'koi8-ru')) or + (stristr($charset, 'koi8'))) { $decoded = convert_cyr_string($decoded, 'k', 'w'); + } else if (stristr($charset, 'iso-8859-5')) { + $decoded = convert_cyr_string($decoded, 'i', 'w'); + } else if ((stristr($charset, 'x-cp866')) or + (stristr($charset, 'csibm866')) or (stristr($charset, 'ibm866'))) { + $decoded = convert_cyr_string($decoded, 'd', 'w'); + } else if ((stristr($charset, 'x-mac-cyrillic')) or + (stristr($charset, 'maccyrillic')) or (stristr($charset, 'mac-cyrillic'))) { + $decoded = convert_cyr_string($decoded, 'm', 'w'); + } elseif ((stristr($charset, 'utf-8')) or (stristr($charset, 'utf8'))) { + if (function_exists('mb_convert_encoding')) { + $decoded_tmp = @mb_convert_encoding($decoded, 'WINDOWS-1251', 'UTF8'); + if ($decoded_tmp) { + $decoded = $decoded_tmp; + } else { + $decoded = convert_cyr_string(@mb_convert_encoding($decoded, 'ISO-8859-5', 'UTF8'),' i', 'w'); + } + + } } } if (stristr(Lang::getCharset(), 'koi8-r')) { - if (stristr($charset, 'windows-1251')) { +// if (stristr($charset, 'windows-1251')) { + if ((stristr($charset, 'windows-1251')) or (stristr($charset, 'cp1251'))) { $decoded = convert_cyr_string($decoded, 'w', 'k'); + } else if (stristr($charset, 'iso-8859-5')) { + $decoded = convert_cyr_string($decoded, 'i', 'k'); + } else if ((stristr($charset, 'x-cp866')) or + (stristr($charset, 'csibm866')) or (stristr($charset, 'ibm866'))) { + $decoded = convert_cyr_string($decoded, 'd', 'k'); + } else if ((stristr($charset, 'x-mac-cyrillic')) or + (stristr($charset, 'maccyrillic')) or (stristr($charset, 'mac-cyrillic'))) { + $decoded = convert_cyr_string($decoded, 'm', 'k'); + } elseif ((stristr($charset, 'utf-8')) or (stristr($charset, 'utf8'))) { + if (function_exists('mb_convert_encoding')) { + $decoded_tmp = @mb_convert_encoding($decoded, 'KOI8-R', 'UTF8'); + if ($decoded_tmp) { + $decoded = $decoded_tmp; + } else { + $decoded = convert_cyr_string(@mb_convert_encoding($decoded, 'ISO-8859-5', 'UTF8'), 'i', 'k'); + } + + } } } break; --- ./login.php-dist 2003-05-27 00:00:00.000000000 +0300 +++ ./login.php 2004-05-17 21:05:00.000000000 +0300 @@ -49,6 +49,14 @@ } if (Auth::getAuth()) { +// patch for autoredirect to any module after authentification + if (isset($HTTP_GET_VARS['module'])) { + $module = $HTTP_GET_VARS['module']; + foreach ($registry->applications as $app => $info) { + if ($module == $app) header("location: ".$registry->getParam('webroot', $app)); + } + } +// end of patch if (Horde::getFormData('url')) { header('Location: ' . Horde::url(Horde::getFormData('url'), true)); exit; @@ -95,7 +103,11 @@ } } elseif ($registry->hasMethod('auth/login')) { $url = Horde::getFormData('url', Horde::selfURL()); - header('Location: ' . Horde::url($registry->link('auth/login', array('url' => Horde::url($url, true))), true)); +// header('Location: ' . Horde::url($registry->link('auth/login', array('url' => Horde::url($url, true))), true)); +// patch for autoredirect to mail module IMP + $module = 'imp'; + header('Location: ' . Horde::url($registry->link('auth/login', array('url' => Horde::url($url, true))), true).(isset($module) ? "%3Fmodule%3D".$module : '')); +// end of patch exit; } else { $title = _("Horde Login");