Changeset 5235 in subversion
- Timestamp:
- Sep 19, 2011 2:43:57 AM (20 months ago)
- Location:
- branches/release-0.6
- Files:
-
- 11 edited
-
CHANGELOG (modified) (1 diff)
-
INSTALL (modified) (1 diff)
-
program/include/iniset.php (modified) (1 diff)
-
program/include/rcmail.php (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (1 diff)
-
program/include/rcube_ldap.php (modified) (23 diffs)
-
program/include/rcube_session.php (modified) (1 diff)
-
program/js/googiespell.js (modified) (2 diffs)
-
program/lib/MDB2/Driver/Datatype/Common.php (modified) (3 diffs)
-
program/lib/PEAR.php (modified) (1 diff)
-
program/steps/mail/func.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.6/CHANGELOG
r5229 r5235 2 2 =========================== 3 3 4 - Fix locked folder rename option on servers supporting RFC2086 only (#1488089) 5 - Fix encoding of LDAP contacts identifiers (#1488079) 4 6 - Fix session race conditions when composing new messages 5 7 - jQuery 1.6.4 -
branches/release-0.6/INSTALL
r4553 r5235 30 30 - suhosin.session.encrypt disabled 31 31 - mbstring.func_overload disabled 32 - magic_quotes_runtime disabled 32 33 * PHP compiled with OpenSSL to connect to IMAPS and to use the spell checker 33 34 * A MySQL (4.0.8 or newer), PostgreSQL, MSSQL database engine -
branches/release-0.6/program/include/iniset.php
r5076 r5235 29 29 'session.auto_start' => 0, 30 30 'file_uploads' => 1, 31 'magic_quotes_runtime' => 0, 31 32 ); 32 33 foreach ($crit_opts as $optname => $optval) { -
branches/release-0.6/program/include/rcmail.php
r5151 r5235 856 856 if ($created = rcube_user::create($username, $host)) { 857 857 $user = $created; 858 859 // fix default settings according to namespace prefix 860 $this->fix_namespace_settings($user); 861 858 862 // create default folders on first login 859 863 if ($config['create_default_folders']) -
branches/release-0.6/program/include/rcube_imap.php
r5213 r5235 3576 3576 3577 3577 if (!empty($options['rights'])) { 3578 $options['norename'] = !in_array('x', $options['rights']); 3578 $options['norename'] = !in_array('x', $options['rights']) && !in_array('d', $options['rights']); 3579 3579 3580 if (!$options['noselect']) { 3580 3581 $options['noselect'] = !in_array('r', $options['rights']); -
branches/release-0.6/program/include/rcube_ldap.php
r5213 r5235 6 6 | This file is part of the Roundcube Webmail client | 7 7 | Copyright (C) 2006-2011, The Roundcube Dev Team | 8 | Copyright (C) 2011, Kolab Systems AG | 8 9 | Licensed under the GNU GPL | 9 10 | | … … 14 15 | Author: Thomas Bruederli <roundcube@gmail.com> | 15 16 | Andreas Dick <andudi (at) gmx (dot) ch> | 17 | Aleksander Machniak <machniak@kolabsys.com> | 16 18 +-----------------------------------------------------------------------+ 17 19 … … 186 188 else 187 189 $d = $this->mail_domain; 188 190 189 191 $dc = 'dc='.strtr($d, array('.' => ',dc=')); // hierarchal domain string 190 192 … … 455 457 foreach ($entries as $entry) 456 458 { 457 if ($this->group_members[ base64_encode($entry['dn'])])459 if ($this->group_members[self::dn_encode($entry['dn'])]) 458 460 { 459 461 $members[] = $entry; … … 615 617 if ($this->conn && $dn) 616 618 { 617 $dn = base64_decode($dn);619 $dn = self::dn_decode($dn); 618 620 619 621 $this->_debug("C: Read [dn: $dn] [(objectclass=*)]"); … … 714 716 $this->_debug("S: OK"); 715 717 718 $dn = self::dn_encode($dn); 719 716 720 // add new contact to the selected group 717 721 if ($this->groups) 718 $this->add_to_group($this->group_id, base64_encode($dn));719 720 return base64_encode($dn);722 $this->add_to_group($this->group_id, $dn); 723 724 return $dn; 721 725 } 722 726 … … 739 743 $replacedata = array(); 740 744 $deletedata = array(); 741 745 742 746 // flatten composite fields in $record 743 747 if (is_array($record['address'])) { … … 777 781 } // end foreach 778 782 779 $dn = base64_decode($id);783 $dn = self::dn_decode($id); 780 784 781 785 // Update the entry as required. … … 834 838 $this->_debug("S: OK"); 835 839 840 $dn = self::dn_encode($dn); 841 $newdn = self::dn_encode($newdn); 842 836 843 // change the group membership of the contact 837 844 if ($this->groups) 838 845 { 839 $group_ids = $this->get_record_groups( base64_encode($dn));846 $group_ids = $this->get_record_groups($dn); 840 847 foreach ($group_ids as $group_id) 841 848 { 842 $this->remove_from_group($group_id, base64_encode($dn));843 $this->add_to_group($group_id, base64_encode($newdn));849 $this->remove_from_group($group_id, $dn); 850 $this->add_to_group($group_id, $newdn); 844 851 } 845 852 } 846 return base64_encode($newdn); 853 854 return $newdn; 847 855 } 848 856 … … 867 875 868 876 foreach ($ids as $id) { 869 $dn = base64_decode($id);877 $dn = self::dn_decode($id); 870 878 $this->_debug("C: Delete [dn: $dn]"); 871 879 // Delete the record. … … 879 887 880 888 // remove contact from all groups where he was member 881 if ($this->groups) 882 { 883 $group_ids = $this->get_record_groups(base64_encode($dn)); 884 foreach ($group_ids as $group_id) 885 { 886 $this->remove_from_group($group_id, base64_encode($dn)); 889 if ($this->groups) { 890 $dn = self::dn_encode($dn); 891 $group_ids = $this->get_record_groups($dn); 892 foreach ($group_ids as $group_id) { 893 $this->remove_from_group($group_id, $dn); 887 894 } 888 895 } … … 968 975 969 976 if ($rec['dn']) 970 $out[$this->primary_key] = base64_encode($rec['dn']);977 $out[$this->primary_key] = self::dn_encode($rec['dn']); 971 978 972 979 foreach ($this->fieldmap as $rf => $lf) … … 1068 1075 { 1069 1076 if (!empty($cache_members[$i])) 1070 $members[ base64_encode($cache_members[$i])] = 1;1077 $members[self::dn_encode($cache_members[$i])] = 1; 1071 1078 } 1072 1079 $this->group_members = $members; … … 1127 1134 if (!$search || strstr(strtolower($group_name), strtolower($search))) 1128 1135 { 1129 $group_id = base64_encode($group_name);1136 $group_id = self::dn_encode($group_name); 1130 1137 $groups[$group_id]['ID'] = $group_id; 1131 1138 $groups[$group_id]['name'] = $group_name; … … 1153 1160 $base_dn = $this->groups_base_dn; 1154 1161 $new_dn = "cn=$group_name,$base_dn"; 1155 $new_gid = base64_encode($group_name);1162 $new_gid = self::dn_encode($group_name); 1156 1163 1157 1164 $new_entry = array( … … 1223 1230 $old_dn = "cn=$group_name,$base_dn"; 1224 1231 $new_rdn = "cn=$new_name"; 1225 $new_gid = base64_encode($new_name);1232 $new_gid = self::dn_encode($new_name); 1226 1233 1227 1234 $this->_debug("C: Rename [dn: $old_dn] [dn: $new_rdn]"); … … 1258 1265 $new_attrs = array(); 1259 1266 foreach (explode(",", $contact_ids) as $id) 1260 $new_attrs['member'][] = base64_decode($id);1267 $new_attrs['member'][] = self::dn_decode($id); 1261 1268 1262 1269 $this->_debug("C: Add [dn: $group_dn]: ".print_r($new_attrs, true)); … … 1293 1300 $del_attrs = array(); 1294 1301 foreach (explode(",", $contact_ids) as $id) 1295 $del_attrs['member'][] = base64_decode($id);1302 $del_attrs['member'][] = self::dn_decode($id); 1296 1303 1297 1304 $this->_debug("C: Delete [dn: $group_dn]: ".print_r($del_attrs, true)); … … 1324 1331 1325 1332 $base_dn = $this->groups_base_dn; 1326 $contact_dn = base64_decode($contact_id);1333 $contact_dn = self::dn_decode($contact_id); 1327 1334 $filter = strtr("(member=$contact_dn)", array('\\' => '\\\\')); 1328 1335 … … 1343 1350 { 1344 1351 $group_name = $ldap_data[$i]['cn'][0]; 1345 $group_id = base64_encode($group_name);1352 $group_id = self::dn_encode($group_name); 1346 1353 $groups[$group_id] = $group_id; 1347 1354 } … … 1402 1409 * create ber encoding for sort control 1403 1410 * 1404 * @para rm array List of cols to sort by1411 * @param array List of cols to sort by 1405 1412 * @return string BER encoded option value 1406 1413 */ … … 1456 1463 * Returns ascii string encoded in hex 1457 1464 */ 1458 private static function _string2hex($str) { 1465 private static function _string2hex($str) 1466 { 1459 1467 $hex = ''; 1460 1468 for ($i=0; $i < strlen($str); $i++) … … 1463 1471 } 1464 1472 1473 /** 1474 * HTML-safe DN string encoding 1475 * 1476 * @param string $str DN string 1477 * 1478 * @return string Encoded HTML identifier string 1479 */ 1480 static function dn_encode($str) 1481 { 1482 // @TODO: to make output string shorter we could probably 1483 // remove dc=* items from it 1484 return rtrim(strtr(base64_encode($str), '+/', '-_'), '='); 1485 } 1486 1487 /** 1488 * Decodes DN string encoded with _dn_encode() 1489 * 1490 * @param string $str Encoded HTML identifier string 1491 * 1492 * @return string DN string 1493 */ 1494 static function dn_decode($str) 1495 { 1496 $str = str_pad(strtr($str, '-_', '+/'), strlen($str) % 4, '=', STR_PAD_RIGHT); 1497 return base64_decode($str); 1498 } 1465 1499 } -
branches/release-0.6/program/include/rcube_session.php
r5229 r5235 194 194 private function _fixvars($vars, $oldvars) 195 195 { 196 $ts = microtime(true);197 198 196 if ($oldvars !== false) { 199 197 $a_oldvars = $this->unserialize($oldvars); -
branches/release-0.6/program/js/googiespell.js
r5213 r5235 156 156 }; 157 157 158 this.appendCustomMenuBuilder = function(eval , builder) {159 this.custom_menu_builder.push([eval , builder]);158 this.appendCustomMenuBuilder = function(eval_fn, builder) { 159 this.custom_menu_builder.push([eval_fn, builder]); 160 160 }; 161 161 … … 410 410 for (var k=0; k<this.custom_menu_builder.length; k++) { 411 411 var eb = this.custom_menu_builder[k]; 412 if (eb[0]((this.results[id]))){412 if (eb[0](this.results[id])) { 413 413 changed = eb[1](this, list, elm); 414 414 break; -
branches/release-0.6/program/lib/MDB2/Driver/Datatype/Common.php
r3227 r5235 1380 1380 return $db; 1381 1381 } 1382 if (isset($db->function) && is_ a($db->function, 'MDB2_Driver_Function_Common')) {1382 if (isset($db->function) && is_object($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) { 1383 1383 return $db->function->now('date'); 1384 1384 } … … 1409 1409 return $db; 1410 1410 } 1411 if (isset($db->function) && is_ a($db->function, 'MDB2_Driver_Function_Common')) {1411 if (isset($db->function) && is_object($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) { 1412 1412 return $db->function->now('timestamp'); 1413 1413 } … … 1438 1438 return $db; 1439 1439 } 1440 if (isset($db->function) && is_ a($db->function, 'MDB2_Driver_Function_Common')) {1440 if (isset($db->function) && is_object($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) { 1441 1441 return $db->function->now('time'); 1442 1442 } -
branches/release-0.6/program/lib/PEAR.php
r3073 r5235 266 266 function isError($data, $code = null) 267 267 { 268 if (!is_ a($data, 'PEAR_Error')) {268 if (!is_object($data) || !is_a($data, 'PEAR_Error')) { 269 269 return false; 270 270 } -
branches/release-0.6/program/steps/mail/func.inc
r5229 r5235 1449 1449 global $RCMAIL, $IMAP; 1450 1450 1451 if (!is_object($message) || !is_a($message, rcube_message))1451 if (!is_object($message) || !is_a($message, 'rcube_message')) 1452 1452 $message = new rcube_message($message); 1453 1453
Note: See TracChangeset
for help on using the changeset viewer.
