Fix message list selection + new pngbehavior + use strpos() instead of strstr()

release-0.6
thomascube 17 years ago
parent 1094cda9a0
commit 0d1dd7c80c

@ -1,4 +1,5 @@
# AddDefaultCharset UTF-8 # AddDefaultCharset UTF-8
AddType text/x-component .htc
<IfModule mod_php4.c> <IfModule mod_php4.c>
php_flag display_errors Off php_flag display_errors Off

@ -1,6 +1,13 @@
CHANGELOG RoundCube Webmail CHANGELOG RoundCube Webmail
--------------------------- ---------------------------
2007/09/05 (thomasb)
----------
- Fix message list selection (#1484550)
- Better fix lowercased usernames (#1484473)
- Update pngbehavior Script as suggested in #1484490
2007/08/29 (richs) 2007/08/29 (richs)
---------- ----------
- Fixed moving/deleting messages when more than 1 is selected - Fixed moving/deleting messages when more than 1 is selected

@ -532,7 +532,6 @@ function rcmail_login($user, $pass, $host=NULL)
{ {
global $CONFIG, $IMAP, $DB, $sess_user_lang; global $CONFIG, $IMAP, $DB, $sess_user_lang;
$user_id = NULL; $user_id = NULL;
$user = strtolower($user); // fix case: #1484473
if (!$host) if (!$host)
$host = $CONFIG['default_host']; $host = $CONFIG['default_host'];
@ -573,7 +572,7 @@ function rcmail_login($user, $pass, $host=NULL)
Inspired by Marco <P0L0_notspam_binware.org> Inspired by Marco <P0L0_notspam_binware.org>
*/ */
// Check if we need to add domain // Check if we need to add domain
if (!empty($CONFIG['username_domain']) && !strstr($user, '@')) if (!empty($CONFIG['username_domain']) && !strpos($user, '@'))
{ {
if (is_array($CONFIG['username_domain']) && isset($CONFIG['username_domain'][$host])) if (is_array($CONFIG['username_domain']) && isset($CONFIG['username_domain'][$host]))
$user .= '@'.$CONFIG['username_domain'][$host]; $user .= '@'.$CONFIG['username_domain'][$host];
@ -581,6 +580,9 @@ function rcmail_login($user, $pass, $host=NULL)
$user .= '@'.$CONFIG['username_domain']; $user .= '@'.$CONFIG['username_domain'];
} }
// lowercase username if it's an e-mail address (#1484473)
if (strpos($user, '@'))
$user = strtolower($user);
// query if user already registered // query if user already registered
$sql_result = $DB->query("SELECT user_id, username, language, preferences $sql_result = $DB->query("SELECT user_id, username, language, preferences
@ -598,7 +600,7 @@ function rcmail_login($user, $pass, $host=NULL)
} }
// try to resolve email address from virtuser table // try to resolve email address from virtuser table
if (!empty($CONFIG['virtuser_file']) && strstr($user, '@')) if (!empty($CONFIG['virtuser_file']) && strpos($user, '@'))
$user = rcmail_email2user($user); $user = rcmail_email2user($user);
@ -671,7 +673,7 @@ function rcmail_create_user($user, $host)
$user_email = ''; $user_email = '';
// try to resolve user in virtusertable // try to resolve user in virtusertable
if (!empty($CONFIG['virtuser_file']) && strstr($user, '@')==FALSE) if (!empty($CONFIG['virtuser_file']) && !strpos($user, '@'))
$user_email = rcmail_user2email($user); $user_email = rcmail_user2email($user);
$DB->query("INSERT INTO ".get_table_name('users')." $DB->query("INSERT INTO ".get_table_name('users')."
@ -687,7 +689,7 @@ function rcmail_create_user($user, $host)
$mail_domain = rcmail_mail_domain($host); $mail_domain = rcmail_mail_domain($host);
if ($user_email=='') if ($user_email=='')
$user_email = strstr($user, '@') ? $user : sprintf('%s@%s', $user, $mail_domain); $user_email = strpos($user, '@') ? $user : sprintf('%s@%s', $user, $mail_domain);
$user_name = $user!=$user_email ? $user : ''; $user_name = $user!=$user_email ? $user : '';

@ -1,52 +1,74 @@
<public:component> <public:component>
<public:attach event="onpropertychange" onevent="propertyChanged()" /> <public:attach event="onpropertychange" onevent="propertyChanged()" />
<public:attach event="onbeforeprint" for="window" onevent="beforePrint()" />
<public:attach event="onafterprint" for="window" onevent="afterPrint()" />
<script> <script>
var supported = /MSIE (5\.5)|[6789]/.test(navigator.userAgent) && navigator.platform == "Win32"; /*
var realSrc = null; * PNG Behavior
var blankSrc = "skins/default/images/blank.gif"; *
* This script was created by Erik Arvidsson (erik(at)eae.net)
* for WebFX (http://webfx.eae.net)
* Copyright 2002
*
* For usage see license at http://webfx.eae.net/license.html
*
* Version: 1.01a
*
*/
var IS_PNG = /\.png$/i;
var supported = /MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == 'Win32';
var realSrc, realHeight, realWidth;
var blankSrc = 'skins/default/images/blank.gif';
if (supported) fixImage(); if (supported) fixImage();
function propertyChanged() { function propertyChanged() {
if (!supported) return; if (supported && event.propertyName == 'src') {
var i = element.src.lastIndexOf(blankSrc);
var pName = event.propertyName; if (i == -1 || i != element.src.length - blankSrc.length) {
if (pName != "src") return;
// if not set to blank
if ( ! new RegExp(blankSrc).test(src))
fixImage(); fixImage();
}; }
}
}
function fixImage() { function fixImage() {
// get src if (realSrc && element.src == realSrc) {
var src = element.src; // this is an attempt to set the image to itself!
// pointless - leave the filter as-is, restore the blank image
// check for real change element.src = blankSrc;
if (src == realSrc) { } else {
// set the image to something different
if (IS_PNG.test(element.src)) {
// fixable PNG
realSrc = element.src;
realWidth = element.width;
realHeight = element.height;
element.src = blankSrc; element.src = blankSrc;
return; element.style.width = realWidth + 'px';
} element.style.height = realHeight + 'px';
element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + encodeURI(realSrc) + "',sizingMethod='scale')";
if ( ! new RegExp(blankSrc).test(src)) { } else {
// backup old src // ordinary image - make sure the fix is removed
realSrc = src; if (realSrc) {
element._original_src = realSrc; realSrc = null;
} element.runtimeStyle.filter = '';
}
// test for png }
if ( realSrc && /\.png$/.test( realSrc.toLowerCase() ) ) { }
// set blank image }
element.src = blankSrc; function beforePrint() {
// set filter if (realSrc) {
element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + supported = false;
src + "',sizingMethod='crop')"; element.src = realSrc;
} element.runtimeStyle.filter = '';
else { supported = true;
// remove filter }
element.runtimeStyle.filter = ""; }
} function afterPrint() {
if (realSrc) {
var rs = realSrc;
realSrc = null;
element.src = rs;
}
} }
</script> </script>
</public:component> </public:component>

Loading…
Cancel
Save