Changeset fa4cd20 in github
- Timestamp:
- Aug 4, 2006 8:10:34 AM (7 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 42000a5
- Parents:
- c4e7e4f
- Files:
-
- 6 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/main.inc (modified) (3 diffs)
-
program/include/rcube_imap.inc (modified) (16 diffs)
-
program/js/app.js (modified) (1 diff)
-
program/steps/settings/save_identity.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rf9c107a rfa4cd20 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2006/08/04 (thomasb) 5 ---------- 6 - Fixed Bug in saving identities (Ticket #1483915) 7 - Set folder name in window title (Bug #1483919) 8 - Don't add imap_root to INBOX path (Bug #1483816) 9 - Attempt to create default folders only after login 10 - Avoid usage of $CONFIG in rcube_imap class 11 3 12 4 13 2006/07/30 (thomasb) -
config/main.inc.php.dist
rbac7d17 rfa4cd20 138 138 $rcmail_config['trash_mbox'] = 'Trash'; 139 139 140 // display these folders separately in the mailbox list 140 // display these folders separately in the mailbox list. 141 // these folders will automatically be created if they do not exist 141 142 $rcmail_config['default_imap_folders'] = array('INBOX', 'Drafts', 'Sent', 'Junk', 'Trash'); 142 143 -
program/include/main.inc
r41fa0b9 rfa4cd20 206 206 $IMAP->set_caching(TRUE); 207 207 208 if (is_array($CONFIG['default_imap_folders']))209 $IMAP->set_default_mailboxes($CONFIG['default_imap_folders']);210 211 208 // set pagesize from config 212 209 if (isset($CONFIG['pagesize'])) … … 224 221 if (!empty($CONFIG['imap_root'])) 225 222 $IMAP->set_rootdir($CONFIG['imap_root']); 223 224 if (is_array($CONFIG['default_imap_folders'])) 225 $IMAP->set_default_mailboxes($CONFIG['default_imap_folders']); 226 226 227 227 if (!empty($_SESSION['mbox'])) … … 511 511 $_SESSION['password'] = encrypt_passwd($pass); 512 512 513 // force reloading complete list of subscribed mailboxes 513 // force reloading complete list of subscribed mailboxes 514 rcmail_set_imap_prop(); 514 515 $IMAP->clear_cache('mailboxes'); 516 $IMAP->create_default_folders(); 515 517 516 518 return TRUE; -
program/include/rcube_imap.inc
rc4e7e4f rfa4cd20 37 37 * @package RoundCube Webmail 38 38 * @author Thomas Bruederli <roundcube@gmail.com> 39 * @version 1.3 039 * @version 1.31 40 40 * @link http://ilohamail.org 41 41 */ … … 53 53 var $delimiter = NULL; 54 54 var $caching_enabled = FALSE; 55 var $default_folders = array('inbox', 'drafts', 'sent', 'junk', 'trash'); 55 var $default_folders = array('INBOX'); 56 var $default_folders_lc = array('inbox'); 56 57 var $cache = array(); 57 58 var $cache_keys = array(); … … 209 210 if (is_array($arr)) 210 211 { 211 $this->default_folders = array(); 212 213 // add mailbox names lower case 214 foreach ($arr as $mbox_row) 215 $this->default_folders[] = strtolower($mbox_row); 216 212 $this->default_folders = $arr; 213 $this->default_folders_lc = array(); 214 217 215 // add inbox if not included 218 if (!in_array('inbox', $this->default_folders)) 219 array_unshift($arr, 'inbox'); 216 if (!in_array_nocase('INBOX', $this->default_folders)) 217 array_unshift($this->default_folders, 'INBOX'); 218 219 // create a second list with lower cased names 220 foreach ($this->default_folders as $mbox) 221 $this->default_folders_lc[] = strtolower($mbox); 220 222 } 221 223 } … … 334 336 } 335 337 338 // INBOX should always be available 339 if (!in_array_nocase('INBOX', $a_out)) 340 array_unshift($a_out, 'INBOX'); 341 336 342 // sort mailboxes 337 343 $a_out = $this->_sort_mailbox_list($a_out); … … 362 368 if (!is_array($a_folders) || !sizeof($a_folders)) 363 369 $a_folders = array(); 364 365 // create Default folders if they do not exist366 global $CONFIG;367 foreach ($CONFIG['default_imap_folders'] as $folder)368 {369 if (!in_array_nocase($folder, $a_folders))370 {371 $this->create_mailbox($folder, TRUE);372 $this->subscribe($folder);373 }374 }375 376 $a_folders = iil_C_ListSubscribed($this->conn, $this->_mod_mailbox($root), $filter);377 $a_mailbox_cache = array();378 370 379 371 // write mailboxlist to cache … … 1156 1148 1157 1149 1158 // return an array with all folders available in IMAP server 1150 /** 1151 * Get a list of all folders available on the IMAP server 1152 * 1153 * @param string IMAP root dir 1154 * @return array Inbdexed array with folder names 1155 */ 1159 1156 function list_unsubscribed($root='') 1160 1157 { … … 1198 1195 1199 1196 1200 // subscribe to a specific mailbox(es) 1197 /** 1198 * subscribe to a specific mailbox(es) 1199 */ 1201 1200 function subscribe($mbox_name, $mode='subscribe') 1202 1201 { … … 1211 1210 1212 1211 1213 // unsubscribe mailboxes 1212 /** 1213 * unsubscribe mailboxes 1214 */ 1214 1215 function unsubscribe($mbox_name) 1215 1216 { … … 1224 1225 1225 1226 1226 // create a new mailbox on the server and register it in local cache 1227 /** 1228 * create a new mailbox on the server and register it in local cache 1229 */ 1227 1230 function create_mailbox($name, $subscribe=FALSE) 1228 1231 { … … 1239 1242 $abs_name = $this->_mod_mailbox($name_enc); 1240 1243 $a_mailbox_cache = $this->get_cache('mailboxes'); 1241 1242 if (strlen($abs_name) && (!is_array($a_mailbox_cache) || !in_array ($abs_name, $a_mailbox_cache)))1244 1245 if (strlen($abs_name) && (!is_array($a_mailbox_cache) || !in_array_nocase($abs_name, $a_mailbox_cache))) 1243 1246 $result = iil_C_CreateFolder($this->conn, $abs_name); 1244 1247 1245 // update mailboxlist cache1246 if ($ result && $subscribe)1248 // try to subscribe it 1249 if ($subscribe) 1247 1250 $this->subscribe($name_enc); 1248 1251 … … 1251 1254 1252 1255 1253 // set a new name to an existing mailbox 1256 /** 1257 * set a new name to an existing mailbox 1258 */ 1254 1259 function rename_mailbox($mbox_name, $new_name) 1255 1260 { … … 1280 1285 1281 1286 1282 // remove mailboxes from server 1287 /** 1288 * remove mailboxes from server 1289 */ 1283 1290 function delete_mailbox($mbox_name) 1284 1291 { … … 1297 1304 // unsubscribe mailbox before deleting 1298 1305 iil_C_UnSubscribe($this->conn, $mailbox); 1299 1306 1300 1307 // send delete command to server 1301 1308 $result = iil_C_DeleteFolder($this->conn, $mailbox); … … 1314 1321 } 1315 1322 1323 1324 /** 1325 * Create all folders specified as default 1326 */ 1327 function create_default_folders() 1328 { 1329 $a_folders = iil_C_ListMailboxes($this->conn, $this->_mod_mailbox(''), '*'); 1330 $a_subscribed = iil_C_ListSubscribed($this->conn, $this->_mod_mailbox(''), '*'); 1331 1332 // create default folders if they do not exist 1333 foreach ($this->default_folders as $folder) 1334 { 1335 $abs_name = $this->_mod_mailbox($folder); 1336 if (!in_array_nocase($abs_name, $a_subscribed)) 1337 { 1338 if (!in_array_nocase($abs_name, $a_folders)) 1339 $this->create_mailbox($folder, TRUE); 1340 else 1341 $this->subscribe($folder); 1342 } 1343 } 1344 } 1316 1345 1317 1346 … … 1831 1860 function _mod_mailbox($mbox_name, $mode='in') 1832 1861 { 1833 if ((!empty($this->root_ns) && $this->root_ns == $mbox_name) || ($mbox_name == 'INBOX' && $mode == 'in'))1862 if ((!empty($this->root_ns) && $this->root_ns == $mbox_name) || $mbox_name == 'INBOX') 1834 1863 return $mbox_name; 1835 1864 … … 1853 1882 if ($folder{0}=='.') 1854 1883 continue; 1855 1856 if (($p = array_search(strtolower($folder), $this->default_folders ))!==FALSE)1884 1885 if (($p = array_search(strtolower($folder), $this->default_folders_lc))!==FALSE) 1857 1886 $a_defaults[$p] = $folder; 1858 1887 else -
program/js/app.js
r41fa0b9 rfa4cd20 3213 3213 } 3214 3214 } 3215 3216 // also update mailbox name in window title 3217 if (document.title) 3218 { 3219 var doc_title = String(document.title); 3220 var reg = new RegExp(this.env.mailbox.toLowerCase(), 'i'); 3221 if (this.env.mailbox && doc_title.match(reg)) 3222 document.title = doc_title.replace(reg, mbox).replace(/^\([0-9]+\)\s+/i, ''); 3223 } 3215 3224 3216 3225 this.env.mailbox = mbox; -
program/steps/settings/save_identity.inc
rad57b3ab rfa4cd20 62 62 } 63 63 64 if ($updated )64 if ($updated && !empty($_POST['_standard'])) 65 65 { 66 66 show_message('successfullysaved', 'confirmation');
Note: See TracChangeset
for help on using the changeset viewer.
