Changeset bac7d17 in github
- Timestamp:
- Jul 18, 2006 5:02:43 PM (7 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 66e2bfa
- Parents:
- 321302e
- Files:
-
- 8 edited
-
.htaccess (modified) (1 diff)
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
index.php (modified) (7 diffs)
-
program/include/main.inc (modified) (9 diffs)
-
program/include/rcube_imap.inc (modified) (2 diffs)
-
program/include/rcube_shared.inc (modified) (2 diffs)
-
program/steps/mail/func.inc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
.htaccess
ra8b87f6 rbac7d17 1 1 # AddDefaultCharset UTF-8 2 2 php_flag display_errors Off 3 php_flag log_errors On 4 php_value error_log logs/errors 3 5 php_value upload_max_filesize 2M 4 6 -
CHANGELOG
r321302e rbac7d17 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2006/07/18 5 ---------- 6 - Fixed password with spaces issue (Bug #1364122) 7 - Replaced _auth hash with second cookie (Ticket #1483811) 8 - Don't use get_input_value() for passwords (Bug #1468895) 9 - Made password encryption key configurable 10 - Minor bugfixes with charset encoding 11 3 12 4 13 2006/07/07 -
config/main.inc.php.dist
rb4b0817 rbac7d17 99 99 // check client IP in session athorization 100 100 $rcmail_config['ip_check'] = TRUE; 101 102 // this key is used to encrypt the users imap password which is stored 103 // in the session record (and the client cookie if remember password is enabled). 104 // please provide a string of exactly 24 chars. 105 $rcmail_config['des_key'] = 'rcmail-!24ByteDESkey*Str'; 101 106 102 107 // the default locale setting -
index.php
r321302e rbac7d17 3 3 +-----------------------------------------------------------------------+ 4 4 | RoundCube Webmail IMAP Client | 5 | Version 0.1-20060 505|5 | Version 0.1-20060718 | 6 6 | | 7 7 | Copyright (C) 2005, RoundCube Dev. - Switzerland | … … 41 41 */ 42 42 43 define('RCMAIL_VERSION', '0.1-200607 07');43 define('RCMAIL_VERSION', '0.1-20060718'); 44 44 45 45 // define global vars … … 54 54 else 55 55 $INSTALL_PATH .= '/'; 56 56 57 58 // make sure path_separator is defined 59 if (!defined('PATH_SEPARATOR')) 60 define('PATH_SEPARATOR', (eregi('win', PHP_OS) ? ';' : ':')); 61 62 57 63 // RC include folders MUST be included FIRST to avoid other 58 64 // possible not compatible libraries (i.e PEAR) to be included … … 90 96 91 97 // catch some url/post parameters 92 $_auth = get_input_value('_auth', RCUBE_INPUT_GPC);98 //$_auth = get_input_value('_auth', RCUBE_INPUT_GPC); 93 99 $_task = get_input_value('_task', RCUBE_INPUT_GPC); 94 100 $_action = get_input_value('_action', RCUBE_INPUT_GPC); … … 105 111 106 112 // set session related variables 107 $COMM_PATH = sprintf('./?_ auth=%s&_task=%s', $sess_auth, $_task);108 $SESS_HIDDEN_FIELD = sprintf('<input type="hidden" name="_auth" value="%s" />', $sess_auth);113 $COMM_PATH = sprintf('./?_task=%s', $_task); 114 $SESS_HIDDEN_FIELD = ''; 109 115 110 116 … … 147 153 } 148 154 else if (isset($_POST['_user']) && isset($_POST['_pass']) && 149 rcmail_login(get_input_value('_user', RCUBE_INPUT_POST), 150 get_input_value('_pass', RCUBE_INPUT_POST), 151 $host)) 155 rcmail_login(get_input_value('_user', RCUBE_INPUT_POST), $_POST['_pass'], $host)) 152 156 { 153 157 // send redirect … … 169 173 } 170 174 171 // check session cookie and auth string172 else if ($_action!='login' && $ sess_auth && $_SESSION['user_id'])173 { 174 if ( $_auth !== $sess_auth || $_auth != rcmail_auth_hash($_SESSION['client_id'], $_SESSION['auth_time']) ||175 // check session and auth cookie 176 else if ($_action!='login' && $_SESSION['user_id']) 177 { 178 if (!rcmail_authenticate_session() || 175 179 ($CONFIG['session_lifetime'] && isset($SESS_CHANGED) && $SESS_CHANGED + $CONFIG['session_lifetime']*60 < mktime())) 176 180 { -
program/include/main.inc
rc8c1e0ef rbac7d17 47 47 rcmail_load_host_config($CONFIG); 48 48 49 $CONFIG['skin_path'] = $CONFIG['skin_path'] ? preg_replace('/\/$/', '',$CONFIG['skin_path']) : 'skins/default';49 $CONFIG['skin_path'] = $CONFIG['skin_path'] ? unslashify($CONFIG['skin_path']) : 'skins/default'; 50 50 51 51 // load db conf … … 56 56 $CONFIG['log_dir'] = $INSTALL_PATH.'logs'; 57 57 else 58 $CONFIG['log_dir'] = ereg_replace('\/$', '',$CONFIG['log_dir']);58 $CONFIG['log_dir'] = unslashify($CONFIG['log_dir']); 59 59 60 60 // set PHP error logging according to config … … 68 68 else 69 69 ini_set('display_errors', 0); 70 70 71 71 72 // set session garbage collecting time according to session_lifetime 72 73 if (!empty($CONFIG['session_lifetime'])) … … 82 83 83 84 // we can use the database for storing session data 84 // session queries do not work with MDB285 85 if (!$DB->is_error()) 86 86 include_once('include/session.inc'); … … 91 91 92 92 // create session and set session vars 93 if (!$_SESSION['client_id']) 94 { 95 $_SESSION['client_id'] = $sess_id; 93 if (!isset($_SESSION['auth_time'])) 94 { 96 95 $_SESSION['user_lang'] = rcube_language_prop($CONFIG['locale_string']); 97 96 $_SESSION['auth_time'] = mktime(); 98 $_SESSION['auth'] = rcmail_auth_hash($sess_id, $_SESSION['auth_time']); 99 unset($GLOBALS['_auth']); 97 setcookie('sessauth', rcmail_auth_hash($sess_id, $_SESSION['auth_time'])); 100 98 } 101 99 102 100 // set session vars global 103 $sess_auth = $_SESSION['auth'];104 101 $sess_user_lang = rcube_language_prop($_SESSION['user_lang']); 105 102 … … 149 146 } 150 147 } 151 148 152 149 153 150 // create authorization hash … … 168 165 } 169 166 167 168 // compare the auth hash sent by the client with the local session credentials 169 function rcmail_authenticate_session() 170 { 171 $now = mktime(); 172 $valid = ($_COOKIE['sessauth'] == rcmail_auth_hash(session_id(), $_SESSION['auth_time'])); 173 174 // renew auth cookie every 5 minutes 175 if (!$valid || ($now-$_SESSION['auth_time'] > 300)) 176 { 177 $_SESSION['auth_time'] = $now; 178 setcookie('sessauth', rcmail_auth_hash(session_id(), $now)); 179 } 180 181 return $valid; 182 } 170 183 171 184 … … 719 732 720 733 734 // encrypt IMAP password using DES encryption 721 735 function encrypt_passwd($pass) 722 736 { 723 $cypher = des( 'rcmail?24BitPwDkeyF**ECB', $pass, 1, 0, NULL);737 $cypher = des(get_des_key(), $pass, 1, 0, NULL); 724 738 return base64_encode($cypher); 725 739 } 726 740 727 741 742 // decrypt IMAP password using DES encryption 728 743 function decrypt_passwd($cypher) 729 744 { 730 $pass = des('rcmail?24BitPwDkeyF**ECB', base64_decode($cypher), 0, 0, NULL); 731 return trim($pass); 745 $pass = des(get_des_key(), base64_decode($cypher), 0, 0, NULL); 746 return preg_replace('/\x00/', '', $pass); 747 } 748 749 750 // return a 24 byte key for the DES encryption 751 function get_des_key() 752 { 753 $key = !empty($GLOBALS['CONFIG']['des_key']) ? $GLOBALS['CONFIG']['des_key'] : 'rcmail?24BitPwDkeyF**ECB'; 754 $len = strlen($key); 755 756 // make sure the key is exactly 24 chars long 757 if ($len<24) 758 $key .= str_repeat('_', 24-$len); 759 else if ($len>24) 760 substr($key, 0, 24); 761 762 return $key; 732 763 } 733 764 … … 803 834 global $CONFIG; 804 835 805 $temp_dir = $CONFIG['temp_dir'].(!eregi('\/$', $CONFIG['temp_dir']) ? '/' : '');836 $temp_dir = slashify($CONFIG['temp_dir']); 806 837 $cache_dir = $temp_dir.$sess_id; 807 838 -
program/include/rcube_imap.inc
r25d8ba6 rbac7d17 1733 1733 * @access static 1734 1734 */ 1735 function decode_mime_string($input )1735 function decode_mime_string($input, $recursive=false) 1736 1736 { 1737 1737 $out = ''; … … 1754 1754 return $out; 1755 1755 } 1756 1756 1757 1757 // no encoding information, defaults to what is specified in the class header 1758 1758 return rcube_charset_convert($input, 'ISO-8859-1'); -
program/include/rcube_shared.inc
rdd53e2b rbac7d17 1335 1335 1336 1336 1337 1337 // replace the middle part of a string with ... 1338 // if it is longer than the allowed length 1338 1339 function abbrevate_string($str, $maxlength, $place_holder='...') 1339 1340 { … … 1350 1351 } 1351 1352 1353 1354 // make sure the string ends with a slash 1355 function slashify($str) 1356 { 1357 return unslashify($str).'/'; 1358 } 1359 1360 1361 // remove slash at the end of the string 1362 function unslashify($str) 1363 { 1364 return preg_replace('/\/$/', '', $str); 1365 } 1366 1352 1367 1353 1368 // delete all files within a folder -
program/steps/mail/func.inc
r5f383dc rbac7d17 215 215 $class_name = 'junk'; 216 216 217 $out .= sprintf('<li id="rcmbx%s" class="mailbox %s %s%s%s"><a href="%s& _mbox=%s"'.217 $out .= sprintf('<li id="rcmbx%s" class="mailbox %s %s%s%s"><a href="%s&_mbox=%s"'. 218 218 ' onclick="return %s.command(\'list\',\'%s\')"'. 219 219 ' onmouseup="return %s.mbox_mouse_up(\'%s\')"%s>%s</a>', … … 438 438 $cont = rep_specialchars_output($IMAP->decode_header($header->$col), 'html', 'all'); 439 439 // firefox/mozilla temporary workaround to pad subject with content so that whitespace in rows responds to drag+drop 440 $cont .= sprintf('<img src="%s%s" height="11" width="1000">', $skin_path, "/images/cleardot.png");440 $cont .= '<img src="./program/blank.gif" height="5" width="1000" alt="" />'; 441 441 } 442 442 else if ($col=='size') … … 1018 1018 $header_value = format_date(strtotime($headers[$hkey])); 1019 1019 else if (in_array($hkey, array('from', 'to', 'cc', 'bcc', 'reply-to'))) 1020 $header_value = rep_specialchars_output(rcmail_address_string($ IMAP->decode_header($headers[$hkey]), NULL, $attrib['addicon']));1020 $header_value = rep_specialchars_output(rcmail_address_string($headers[$hkey], NULL, $attrib['addicon'])); 1021 1021 else 1022 1022 $header_value = rep_specialchars_output($IMAP->decode_header($headers[$hkey]), '', 'all');
Note: See TracChangeset
for help on using the changeset viewer.
