Changeset 5426 in subversion
- Timestamp:
- Nov 15, 2011 5:50:30 AM (19 months ago)
- Location:
- branches/release-0.7
- Files:
-
- 11 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (2 diffs)
-
plugins/password/config.inc.php.dist (modified) (1 diff)
-
plugins/password/drivers/sql.php (modified) (3 diffs)
-
plugins/password/package.xml (modified) (2 diffs)
-
plugins/password/password.php (modified) (3 diffs)
-
program/include/main.inc (modified) (4 diffs)
-
program/include/rcmail.php (modified) (2 diffs)
-
program/include/rcube_imap.php (modified) (6 diffs)
-
program/js/common.js (modified) (1 diff)
-
program/steps/mail/autocomplete.inc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.7/CHANGELOG
r5415 r5426 2 2 =========================== 3 3 4 - Fix listing of folders in hidden namespaces (#1486796) 5 - Don't consider \Noselect flag when building folders tree (#1488004) 6 - Fix sorting autocomplete results (#1488084) 7 - Add option to set session name (#1486433) 4 8 - Add option to skip alternative email addresses in autocompletion 5 9 - Fix inconsistent behaviour of Compose button in Drafts folder, add Edit button for drafts -
branches/release-0.7/config/main.inc.php.dist
r5415 r5426 223 223 $rcmail_config['session_domain'] = ''; 224 224 225 // session name. Default: 'roundcube_sessid' 226 $rcmail_config['session_name'] = null; 227 225 228 // Backend to use for session storage. Can either be 'db' (default) or 'memcache' 226 229 // If set to memcache, a list of servers need to be specified in 'memcache_hosts' … … 419 422 $rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash'); 420 423 421 // automatically create the above listed default folders on login424 // automatically create the above listed default folders on first login 422 425 $rcmail_config['create_default_folders'] = false; 423 426 -
branches/release-0.7/plugins/password/config.inc.php.dist
r4726 r5426 48 48 $rcmail_config['password_query'] = 'SELECT update_passwd(%c, %u)'; 49 49 50 // By default domains in variables are using unicode. 51 // Enable this option to use punycoded names 52 $rcmail_config['password_idn_ascii'] = false; 53 50 54 // Path for dovecotpw (if not in $PATH) 51 55 // $rcmail_config['password_dovecotpw'] = '/usr/local/sbin/dovecotpw'; -
branches/release-0.7/plugins/password/drivers/sql.php
r5323 r5426 38 38 if (strpos($sql, '%c') !== FALSE) { 39 39 $salt = ''; 40 if (CRYPT_MD5) { 41 $len = rand(3, CRYPT_SALT_LENGTH); 40 if (CRYPT_MD5) { 41 // Always use eight salt characters for MD5 (#1488136) 42 $len = 8; 42 43 } else if (CRYPT_STD_DES) { 43 44 $len = 2; … … 45 46 return PASSWORD_CRYPT_ERROR; 46 47 } 48 49 //Restrict the character set used as salt (#1488136) 50 $seedchars = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; 47 51 for ($i = 0; $i < $len ; $i++) { 48 $salt .= chr(rand(ord('.'), ord('z')));52 $salt .= $seedchars[rand(0, 63)]; 49 53 } 54 50 55 $sql = str_replace('%c', $db->quote(crypt($passwd, CRYPT_MD5 ? '$1$'.$salt.'$' : $salt)), $sql); 51 56 } … … 126 131 } 127 132 133 $local_part = $rcmail->user->get_username('local'); 134 $domain_part = $rcmail->user->get_username('domain'); 135 $username = $_SESSION['username']; 136 $host = $_SESSION['imap_host']; 137 138 // convert domains to/from punnycode 139 if ($rcmail->config->get('password_idn_ascii')) { 140 $domain_part = rcube_idn_to_ascii($domain_part); 141 $username = rcube_idn_to_ascii($username); 142 $host = rcube_idn_to_ascii($host); 143 } 144 else { 145 $domain_part = rcube_idn_to_utf8($domain_part); 146 $username = rcube_idn_to_utf8($username); 147 $host = rcube_idn_to_utf8($host); 148 } 149 128 150 // at least we should always have the local part 129 $sql = str_replace('%l', $db->quote($ rcmail->user->get_username('local'), 'text'), $sql);130 $sql = str_replace('%d', $db->quote($ rcmail->user->get_username('domain'), 'text'), $sql);131 $sql = str_replace('%u', $db->quote($ _SESSION['username'],'text'), $sql);132 $sql = str_replace('%h', $db->quote($ _SESSION['imap_host'],'text'), $sql);151 $sql = str_replace('%l', $db->quote($local_part, 'text'), $sql); 152 $sql = str_replace('%d', $db->quote($domain_part, 'text'), $sql); 153 $sql = str_replace('%u', $db->quote($username, 'text'), $sql); 154 $sql = str_replace('%h', $db->quote($host, 'text'), $sql); 133 155 134 156 $res = $db->query($sql, $sql_vars); -
branches/release-0.7/plugins/password/package.xml
r5323 r5426 28 28 <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> 29 29 <notes> 30 - When old and new passwords are the same, do nothing, return success (#1487823) 31 - Fixed Samba password hashing in 'ldap' driver 32 - Added 'password_change' hook for plugin actions after successful password change 33 - Fixed bug where 'doveadm pw' command was used as dovecotpw utility 30 - Added option to use punycode or unicode for domain names (#1488103) 34 31 </notes> 35 32 <contents> … … 265 262 </notes> 266 263 </release> 264 <release> 265 <date>2011-10-26</date> 266 <time>12:00</time> 267 <version> 268 <release>2.3</release> 269 <api>1.6</api> 270 </version> 271 <stability> 272 <release>stable</release> 273 <api>stable</api> 274 </stability> 275 <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> 276 <notes> 277 - When old and new passwords are the same, do nothing, return success (#1487823) 278 - Fixed Samba password hashing in 'ldap' driver 279 - Added 'password_change' hook for plugin actions after successful password change 280 - Fixed bug where 'doveadm pw' command was used as dovecotpw utility 281 - Improve generated crypt() passwords (#1488136) 282 </notes> 283 </release> 267 284 </changelog> 268 285 </package> -
branches/release-0.7/plugins/password/password.php
r5036 r5426 224 224 $config = rcmail::get_instance()->config; 225 225 $driver = $this->home.'/drivers/'.$config->get('password_driver', 'sql').'.php'; 226 226 227 227 if (!is_readable($driver)) { 228 228 raise_error(array( … … 234 234 return $this->gettext('internalerror'); 235 235 } 236 236 237 237 include($driver); 238 238 … … 271 271 272 272 return $reason; 273 } 273 } 274 274 } -
branches/release-0.7/program/include/main.inc
r5402 r5426 1282 1282 1283 1283 if (!isset($arrFolders[$currentFolder])) { 1284 // Check \Noselect attribute (if attributes are in cache)1285 if (!$virtual && ($attrs = $RCMAIL->imap->mailbox_attributes($path))) {1286 $virtual = in_array('\\Noselect', $attrs);1287 }1288 1289 1284 $arrFolders[$currentFolder] = array( 1290 1285 'id' => $path, … … 1314 1309 $msgcounts = $RCMAIL->imap->get_cache('messagecount'); 1315 1310 1316 $idx = 0;1317 1311 $out = ''; 1318 1312 foreach ($arrFolders as $key => $folder) { 1319 $title = null; 1320 1321 if (($folder_class = rcmail_folder_classname($folder['id'])) && !$realnames) { 1313 $title = null; 1314 $folder_class = rcmail_folder_classname($folder['id']); 1315 $collapsed = strpos($CONFIG['collapsed_folders'], '&'.rawurlencode($folder['id']).'&') !== false; 1316 $unread = $msgcounts ? intval($msgcounts[$folder['id']]['UNSEEN']) : 0; 1317 1318 if ($folder_class && !$realnames) { 1322 1319 $foldername = rcube_label($folder_class); 1323 1320 } … … 1339 1336 1340 1337 // set special class for Sent, Drafts, Trash and Junk 1341 if ($folder['id'] == $CONFIG['sent_mbox']) 1342 $classes[] = 'sent'; 1343 else if ($folder['id'] == $CONFIG['drafts_mbox']) 1344 $classes[] = 'drafts'; 1345 else if ($folder['id'] == $CONFIG['trash_mbox']) 1346 $classes[] = 'trash'; 1347 else if ($folder['id'] == $CONFIG['junk_mbox']) 1348 $classes[] = 'junk'; 1349 else if ($folder['id'] == 'INBOX') 1350 $classes[] = 'inbox'; 1351 else 1352 $classes[] = '_'.asciiwords($folder_class ? $folder_class : strtolower($folder['id']), true); 1338 if ($folder_class) 1339 $classes[] = $folder_class; 1353 1340 1354 1341 if ($folder['id'] == $mbox_name) 1355 1342 $classes[] = 'selected'; 1356 1357 $collapsed = strpos($CONFIG['collapsed_folders'], '&'.rawurlencode($folder['id']).'&') !== false;1358 $unread = $msgcounts ? intval($msgcounts[$folder['id']]['UNSEEN']) : 0;1359 1343 1360 1344 if ($folder['virtual']) … … 1391 1375 1392 1376 $out .= "</li>\n"; 1393 $idx++;1394 1377 } 1395 1378 -
branches/release-0.7/program/include/rcmail.php
r5402 r5426 679 679 return; 680 680 681 $sess_name = $this->config->get('session_name'); 682 $sess_domain = $this->config->get('session_domain'); 683 $lifetime = $this->config->get('session_lifetime', 0) * 60; 684 681 685 // set session domain 682 if ($ domain = $this->config->get('session_domain')) {683 ini_set('session.cookie_domain', $ domain);686 if ($sess_domain) { 687 ini_set('session.cookie_domain', $sess_domain); 684 688 } 685 689 // set session garbage collecting time according to session_lifetime 686 $lifetime = $this->config->get('session_lifetime', 0) * 60;687 690 if ($lifetime) { 688 691 ini_set('session.gc_maxlifetime', $lifetime * 2); … … 690 693 691 694 ini_set('session.cookie_secure', rcube_https_check()); 692 ini_set('session.name', 'roundcube_sessid');695 ini_set('session.name', $sess_name ? $sess_name : 'roundcube_sessid'); 693 696 ini_set('session.use_cookies', 1); 694 697 ini_set('session.use_only_cookies', 1); -
branches/release-0.7/program/include/rcube_imap.php
r5415 r5426 1374 1374 1375 1375 $result = 0; 1376 1377 if (empty($old)) { 1378 return $result; 1379 } 1380 1376 1381 $new = $this->get_folder_stats($mailbox); 1377 1382 … … 3000 3005 3001 3006 /** 3002 * Private method for mailbox listing 3007 * Private method for mailbox listing (LSUB) 3003 3008 * 3004 3009 * @param string $root Optional root folder … … 3007 3012 * @param string $rights Optional ACL requirements 3008 3013 * 3009 * @return array List of mailboxes/folders3014 * @return array List of subscribed folders 3010 3015 * @see rcube_imap::list_mailboxes() 3011 3016 * @access private … … 3110 3115 else { 3111 3116 // retrieve list of folders from IMAP server 3112 $a_mboxes = $this-> conn->listMailboxes($root, $name);3117 $a_mboxes = $this->_list_unsubscribed($root, $name); 3113 3118 } 3114 3119 … … 3141 3146 3142 3147 return $a_mboxes; 3148 } 3149 3150 3151 /** 3152 * Private method for mailbox listing (LIST) 3153 * 3154 * @param string $root Optional root folder 3155 * @param string $name Optional name pattern 3156 * 3157 * @return array List of folders 3158 * @see rcube_imap::list_unsubscribed() 3159 */ 3160 private function _list_unsubscribed($root='', $name='*') 3161 { 3162 $result = $this->conn->listMailboxes($root, $name); 3163 3164 if (!is_array($result)) { 3165 return array(); 3166 } 3167 3168 // #1486796: some server configurations doesn't 3169 // return folders in all namespaces, we'll try to detect that situation 3170 // and ask for these namespaces separately 3171 if ($root == '' && $name = '*') { 3172 $delim = $this->get_hierarchy_delimiter(); 3173 $namespace = $this->get_namespace(); 3174 $search = array(); 3175 3176 // build list of namespace prefixes 3177 foreach ((array)$namespace as $ns) { 3178 if (is_array($ns)) { 3179 foreach ($ns as $ns_data) { 3180 if (strlen($ns_data[0])) { 3181 $search = $ns_data[0]; 3182 } 3183 } 3184 } 3185 } 3186 3187 if (!empty($search)) { 3188 // go through all folders detecting namespace usage 3189 foreach ($result as $folder) { 3190 foreach ($search as $idx => $prefix) { 3191 if (strpos($folder, $prefix) === 0) { 3192 unset($search[$idx]); 3193 } 3194 } 3195 if (empty($search)) { 3196 break; 3197 } 3198 } 3199 3200 // get folders in hidden namespaces and add to the result 3201 foreach ($search as $prefix) { 3202 $list = $this->conn->listMailboxes($prefix, $name); 3203 3204 if (!empty($list)) { 3205 $result = array_merge($result, $list); 3206 } 3207 } 3208 } 3209 } 3210 3211 return $result; 3143 3212 } 3144 3213 … … 3416 3485 if (is_array($namespace)) { 3417 3486 foreach ($namespace as $ns) { 3418 if ( strlen($ns[0])) {3419 if (( strlen($ns[0])>1 && $mailbox == substr($ns[0], 0, -1))3487 if ($len = strlen($ns[0])) { 3488 if (($len > 1 && $mailbox == substr($ns[0], 0, -1)) 3420 3489 || strpos($mailbox, $ns[0]) === 0 3421 3490 ) { -
branches/release-0.7/program/js/common.js
r5285 r5426 543 543 }; 544 544 545 // make a string URL safe 545 // make a string URL safe (and compatible with PHP's rawurlencode()) 546 546 function urlencode(str) 547 547 { 548 return window.encodeURIComponent ? encodeURIComponent(str) : escape(str); 548 if (window.encodeURIComponent) 549 return encodeURIComponent(str).replace('*', '%2A'); 550 551 return escape(str) 552 .replace('+', '%2B') 553 .replace('*', '%2A') 554 .replace('/', '%2F') 555 .replace('@', '%40'); 549 556 }; 550 557 -
branches/release-0.7/program/steps/mail/autocomplete.inc
r5415 r5426 55 55 if (!empty($book_types) && strlen($search)) { 56 56 $contacts = array(); 57 $sort_keys = array(); 57 58 $books_num = count($book_types); 58 59 $search_lc = mb_strtolower($search); … … 67 68 $email_arr = (array)$abook->get_col_values('email', $sql_arr, true); 68 69 $email_cnt = count($email_arr); 70 $idx = 0; 69 71 foreach ($email_arr as $email) { 70 72 if (empty($email)) { … … 81 83 // skip duplicates 82 84 if (!in_array($contact, $contacts)) { 83 $contacts[] = $contact; 85 $contacts[] = $contact; 86 $sort_keys[] = sprintf('%s %03d', $sql_arr['name'] , $idx++); 87 84 88 if (count($contacts) >= $MAXNUM) 85 89 break 2; … … 103 107 // group (distribution list) with email address(es) 104 108 if ($group_prop['email']) { 109 $idx = 0; 105 110 foreach ((array)$group_prop['email'] as $email) { 106 $contacts[] = format_email_recipient($email, $group['name']); 111 $contacts[] = format_email_recipient($email, $group['name']); 112 $sort_keys[] = sprintf('%s %03d', $group['name'] , $idx++); 113 107 114 if (count($contacts) >= $MAXNUM) 108 115 break 2; … … 111 118 // show group with count 112 119 else if (($result = $abook->count()) && $result->count) { 113 $contacts[] = array('name' => $group['name'] . ' (' . intval($result->count) . ')', 'id' => $group['ID'], 'source' => $id); 120 $contacts[] = array('name' => $group['name'] . ' (' . intval($result->count) . ')', 'id' => $group['ID'], 'source' => $id); 121 $sort_keys[] = $group['name']; 122 114 123 if (count($contacts) >= $MAXNUM) 115 124 break; … … 119 128 } 120 129 121 usort($contacts, 'contact_results_sort'); 130 if (count($contacts)) { 131 // sort contacts index 132 asort($sort_keys, SORT_LOCALE_STRING); 133 // re-sort contacts according to index 134 foreach ($sort_keys as $idx => $val) { 135 $sort_keys[$idx] = $contacts[$idx]; 136 } 137 $contacts = array_values($sort_keys); 138 } 122 139 } 123 140 124 141 $OUTPUT->command('ksearch_query_results', $contacts, $search, $sid); 125 142 $OUTPUT->send(); 126 127 128 function contact_results_sort($a, $b)129 {130 $name_a = is_array($a) ? $a['name'] : $a;131 $name_b = is_array($b) ? $b['name'] : $b;132 return strcoll(trim($name_a, '" '), trim($name_b, '" '));133 }134
Note: See TracChangeset
for help on using the changeset viewer.
