Changeset b08caf5 in github
- Timestamp:
- Aug 31, 2011 8:49:44 AM (22 months ago)
- Branches:
- release-0.6
- Children:
- 853696b1
- Parents:
- fd6146b
- Files:
-
- 20 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
plugins/acl/acl.js (modified) (5 diffs)
-
plugins/acl/acl.php (modified) (4 diffs)
-
plugins/acl/skins/default/acl.css (modified) (1 diff)
-
plugins/new_user_dialog/new_user_dialog.php (modified) (2 diffs)
-
plugins/new_user_dialog/newuserdialog.css (modified) (1 diff)
-
program/include/main.inc (modified) (4 diffs)
-
program/include/rcmail.php (modified) (2 diffs)
-
program/include/rcube_config.php (modified) (1 diff)
-
program/include/rcube_html_page.php (modified) (5 diffs)
-
program/include/rcube_imap.php (modified) (4 diffs)
-
program/include/rcube_message.php (modified) (5 diffs)
-
program/include/rcube_plugin_api.php (modified) (1 diff)
-
program/js/app.js (modified) (8 diffs)
-
program/steps/mail/func.inc (modified) (1 diff)
-
program/steps/mail/get.inc (modified) (3 diffs)
-
program/steps/mail/show.inc (modified) (1 diff)
-
program/steps/settings/save_prefs.inc (modified) (1 diff)
-
skins/default/common.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rfd6146b rb08caf5 2 2 =========================== 3 3 4 - Fix imap_cache setting to values other than 'db' (#1488060) 5 - Fix handling of attachments inside message/rfc822 parts (#1488026) 6 - Make list of mimetypes that open in preview window configurable (#1487625) 7 - Added plugin hook 'message_part_get' for attachment downloads 4 8 - Fixed selecting identity on reply/forward (#1487981) 5 9 - Fix image type check for contact photo uploads -
config/main.inc.php.dist
r5c9d1ff rb08caf5 326 326 // 3 - one identity with possibility to edit all params but not email address 327 327 $rcmail_config['identities_level'] = 0; 328 329 // Mimetypes supported by the browser. 330 // attachments of these types will open in a preview window 331 // either a comma-separated list or an array: 'text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,application/pdf' 332 $rcmail_config['client_mimetypes'] = null; # null == default 328 333 329 334 // mime magic database -
plugins/acl/acl.js
rb6cd452 rb08caf5 2 2 * ACL plugin script 3 3 * 4 * @version 0.6 4 * @version 0.6.1 5 5 * @author Aleksander Machniak <alec@alec.pl> 6 6 */ … … 12 12 // enable autocomplete on user input 13 13 if (rcmail.env.acl_users_source) { 14 rcmail.init_address_input_events($('#acluser'), {action:' plugin.acl-autocomplete'});14 rcmail.init_address_input_events($('#acluser'), {action:'settings/plugin.acl-autocomplete'}); 15 15 // fix inserted value 16 16 rcmail.addEventListener('autocomplete_insert', function(e) { … … 53 53 54 54 if (users && users.length && confirm(this.get_label('acl.deleteconfirm'))) { 55 this.http_request(' plugin.acl', '_act=delete&_user='+urlencode(users.join(','))55 this.http_request('settings/plugin.acl', '_act=delete&_user='+urlencode(users.join(',')) 56 56 + '&_mbox='+urlencode(this.env.mailbox), 57 57 this.set_busy(true, 'acl.deleting')); … … 83 83 } 84 84 85 this.http_request(' plugin.acl', '_act=save'85 this.http_request('settings/plugin.acl', '_act=save' 86 86 + '&_user='+urlencode(user) 87 87 + '&_acl=' +rights … … 121 121 this.env.acl_advanced = !this.env.acl_advanced; 122 122 this.enable_command('acl-delete', 'acl-edit', false); 123 this.http_request(' plugin.acl', '_act=list'123 this.http_request('settings/plugin.acl', '_act=list' 124 124 + '&_mode='+(this.env.acl_advanced ? 'advanced' : 'simple') 125 125 + '&_mbox='+urlencode(this.env.mailbox), -
plugins/acl/acl.php
rb6cd452 rb08caf5 4 4 * Folders Access Control Lists Management (RFC4314, RFC2086) 5 5 * 6 * @version 0.6 6 * @version 0.6.1 7 7 * @author Aleksander Machniak <alec@alec.pl> 8 8 * … … 26 26 class acl extends rcube_plugin 27 27 { 28 public $task = 'settings|addressbook ';28 public $task = 'settings|addressbook|calendar'; 29 29 30 30 private $rc; … … 45 45 // kolab_addressbook plugin 46 46 $this->add_hook('addressbook_form', array($this, 'folder_form')); 47 $this->add_hook('calendar_form_kolab', array($this, 'folder_form')); 47 48 // Plugin actions 48 49 $this->register_action('plugin.acl', array($this, 'acl_actions')); … … 527 528 $attrib = array( 528 529 'name' => 'rcmyrights', 529 'style' => ' padding:0 15px;',530 'style' => 'margin:0; padding:0 15px;', 530 531 ); 531 532 -
plugins/acl/skins/default/acl.css
r5375e84 rb08caf5 82 82 #aclform 83 83 { 84 top: 100px;84 top: 80px; 85 85 width: 480px; 86 86 padding: 10px; -
plugins/new_user_dialog/new_user_dialog.php
r5375e84 rb08caf5 67 67 ))); 68 68 69 $table->add('title', $this->gettext('organization')); 70 $table->add(null, html::tag('input', array( 71 'type' => 'text', 72 'name' => '_organization', 73 'value' => $identity['organization'] 74 ))); 75 76 $table->add('title', $this->gettext('signature')); 77 $table->add(null, html::tag('textarea', array( 78 'name' => '_signature', 79 'rows' => '3', 80 ),$identity['signature'] 81 )); 82 69 83 // add overlay input box to html page 70 84 $rcmail->output->add_footer(html::div(array('id' => 'newuseroverlay'), … … 107 121 'name' => get_input_value('_name', RCUBE_INPUT_POST), 108 122 'email' => get_input_value('_email', RCUBE_INPUT_POST), 123 'organization' => get_input_value('_organization', RCUBE_INPUT_POST), 124 'signature' => get_input_value('_signature', RCUBE_INPUT_POST), 109 125 ); 110 126 -
plugins/new_user_dialog/newuserdialog.css
r5375e84 rb08caf5 49 49 } 50 50 51 #newuseroverlay table td input 51 #newuseroverlay table td input, 52 #newuseroverlay table td textarea 52 53 { 53 54 width: 20em; -
program/include/main.inc
r81fd879 rb08caf5 1022 1022 function format_date($date, $format=NULL) 1023 1023 { 1024 global $ CONFIG;1024 global $RCMAIL, $CONFIG; 1025 1025 1026 1026 $ts = NULL; … … 1033 1033 1034 1034 // get user's timezone 1035 if ($CONFIG['timezone'] === 'auto') 1036 $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600; 1037 else { 1038 $tz = $CONFIG['timezone']; 1039 if ($CONFIG['dst_active']) 1040 $tz++; 1041 } 1035 $tz = $RCMAIL->config->get_timezone(); 1042 1036 1043 1037 // convert time to user's timezone … … 1660 1654 * @param array $mailto Array of recipient address strings 1661 1655 * @param array $smtp_error SMTP error array (reference) 1662 * @param string $body_file Location of file with saved message body (reference) 1656 * @param string $body_file Location of file with saved message body (reference), 1657 * used when delay_file_io is enabled 1663 1658 * @param array $smtp_opts SMTP options (e.g. DSN request) 1664 1659 * 1665 1660 * @return boolean Send status. 1666 1661 */ 1667 function rcmail_deliver_message(&$message, $from, $mailto, &$smtp_error, &$body_file , $smtp_opts=null)1662 function rcmail_deliver_message(&$message, $from, $mailto, &$smtp_error, &$body_file=null, $smtp_opts=null) 1668 1663 { 1669 1664 global $CONFIG, $RCMAIL; … … 1824 1819 function rcmail_user_date() 1825 1820 { 1826 global $ CONFIG;1821 global $RCMAIL, $CONFIG; 1827 1822 1828 1823 // get user's timezone 1829 if ($CONFIG['timezone'] === 'auto') { 1830 $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600; 1831 } 1832 else { 1833 $tz = $CONFIG['timezone']; 1834 if ($CONFIG['dst_active']) 1835 $tz++; 1836 } 1824 $tz = $RCMAIL->config->get_timezone(); 1837 1825 1838 1826 $date = time() + $tz * 60 * 60; -
program/include/rcmail.php
rfe91e2f rb08caf5 414 414 415 415 // use existing instance 416 if (isset($this->address_books[$id]) && is_a($this->address_books[$id], 'rcube_addressbook') && (!$writeable || !$this->address_books[$id]->readonly)) { 416 if (isset($this->address_books[$id]) && is_object($this->address_books[$id]) 417 && is_a($this->address_books[$id], 'rcube_addressbook') 418 && (!$writeable || !$this->address_books[$id]->readonly) 419 ) { 417 420 $contacts = $this->address_books[$id]; 418 421 } … … 1184 1187 1185 1188 foreach ($this->address_books as $book) { 1186 if (is_ a($book, 'rcube_addressbook'))1189 if (is_object($book) && is_a($book, 'rcube_addressbook')) 1187 1190 $book->close(); 1188 1191 } -
program/include/rcube_config.php
r18371736 rb08caf5 221 221 } 222 222 223 /** 224 * Special getter for user's timezone 225 */ 226 public function get_timezone() 227 { 228 $tz = $this->get('timezone'); 229 if ($tz == 'auto') 230 $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z') / 3600; 231 else 232 $tz = intval($tz) + intval($this->get('dst_active')); 233 234 return $tz; 235 } 223 236 224 237 /** -
program/include/rcube_html_page.php
r909a3ac rb08caf5 213 213 $this->add_script('$(document).ready(function(){ ' . $this->scripts['docready'] . "\n});", 'foot'); 214 214 } 215 215 216 216 if (is_array($this->script_files['foot'])) { 217 217 foreach ($this->script_files['foot'] as $file) { … … 247 247 // add page hader 248 248 if ($hpos) { 249 $output = substr ($output,0,$hpos) . $page_header . substr($output,$hpos,strlen($output));249 $output = substr_replace($output, $page_header, $hpos, 0); 250 250 } 251 251 else { … … 255 255 // add page footer 256 256 if (($fpos = strripos($output, '</body>')) || ($fpos = strripos($output, '</html>'))) { 257 $output = substr ($output, 0, $fpos) . "$page_footer\n" . substr($output, $fpos);257 $output = substr_replace($output, $page_footer."\n", $fpos, 0); 258 258 } 259 259 else { … … 269 269 $css .= sprintf($this->link_css_file, $file); 270 270 } 271 $output = substr ($output, 0, $pos) . $css . substr($output, $pos);271 $output = substr_replace($output, $css, $pos, 0); 272 272 } 273 273 … … 290 290 } 291 291 } 292 292 293 293 /** 294 294 * Callback function for preg_replace_callback in write() -
program/include/rcube_imap.php
rd43d4bc rb08caf5 3075 3075 $a_folders = $data['folders']; 3076 3076 } 3077 else if (!$this->conn->connected()) { 3078 return array(); 3079 } 3077 3080 else { 3078 3081 // Server supports LIST-EXTENDED, we can use selection options … … 3835 3838 * Enable or disable indexes caching 3836 3839 * 3837 * @param boolean$type Cache type (@see rcmail::get_cache)3840 * @param string $type Cache type (@see rcmail::get_cache) 3838 3841 * @access public 3839 3842 */ … … 3841 3844 { 3842 3845 if ($type) { 3843 $this->caching = true;3846 $this->caching = $type; 3844 3847 } 3845 3848 else { … … 3858 3861 if ($this->caching && !$this->cache) { 3859 3862 $rcmail = rcmail::get_instance(); 3860 $this->cache = $rcmail->get_cache('IMAP', $t ype);3863 $this->cache = $rcmail->get_cache('IMAP', $this->caching); 3861 3864 } 3862 3865 -
program/include/rcube_message.php
rdd0ae62 rb08caf5 287 287 $structure->type = 'content'; 288 288 $this->parts[] = &$structure; 289 289 290 290 // Parse simple (plain text) message body 291 291 if ($message_ctype_secondary == 'plain') … … 307 307 foreach ($structure->parts as $p => $sub_part) { 308 308 $sub_mimetype = $sub_part->mimetype; 309 309 310 310 // check if sub part is 311 311 if ($sub_mimetype == 'text/plain') … … 324 324 $this->parse_structure($structure->parts[$related_part], true); 325 325 $this->parse_alternative = false; 326 326 327 327 // if plain part was found, we should unset it if html is preferred 328 328 if ($this->opt['prefer_html'] && count($this->parts)) … … 433 433 } 434 434 // part message/* 435 else if ($primary_type =='message') {435 else if ($primary_type == 'message') { 436 436 $this->parse_structure($mail_part, true); 437 437 … … 496 496 $this->attachments[] = $mail_part; 497 497 } 498 } 499 // attachment part as message/rfc822 (#1488026) 500 else if ($mail_part->mimetype == 'message/rfc822') { 501 $this->parse_structure($mail_part); 498 502 } 499 503 } -
program/include/rcube_plugin_api.php
r8ec1b91 rb08caf5 177 177 // ... task, request type and framed mode 178 178 if ((!$plugin->task || preg_match('/^('.$plugin->task.')$/i', $rcmail->task)) 179 && (!$plugin->noajax || is_a($rcmail->output, 'rcube_template'))179 && (!$plugin->noajax || (is_object($rcmail->output) && is_a($rcmail->output, 'rcube_template'))) 180 180 && (!$plugin->noframe || empty($_REQUEST['_framed'])) 181 181 ) { -
program/js/app.js
rfd6146b rb08caf5 41 41 this.identifier_expr = new RegExp('[^0-9a-z\-_]', 'gi'); 42 42 43 // mimetypes supported by the browser (default settings)44 this.mimetypes = new Array('text/plain', 'text/html', 'text/xml',45 'image/jpeg', 'image/gif', 'image/png',46 'application/x-javascript', 'application/pdf', 'application/x-shockwave-flash');47 48 43 // default environment vars 49 44 this.env.keep_alive = 60; // seconds … … 91 86 92 87 this.buttons[command].push(button_prop); 88 89 if (this.loaded) 90 init_button(command, button_prop); 93 91 }; 94 92 … … 96 94 this.gui_object = function(name, id) 97 95 { 98 this.gui_objects[name] = id;96 this.gui_objects[name] = this.loaded ? rcube_find_object(id) : id; 99 97 }; 100 98 … … 749 747 750 748 // open attachment in frame if it's of a supported mimetype 751 if (this.env.uid && props.mimetype && $.inArray(props.mimetype, this.mimetypes)>=0) {749 if (this.env.uid && props.mimetype && this.env.mimetypes && $.inArray(props.mimetype, this.env.mimetypes)>=0) { 752 750 if (props.mimetype == 'text/html') 753 751 qstring += '&_safe=1'; … … 3506 3504 case 27: // escape 3507 3505 this.ksearch_hide(); 3508 break;3506 return; 3509 3507 3510 3508 case 37: // left … … 4915 4913 /*********************************************************/ 4916 4914 4915 var init_button = function(cmd, prop) 4916 { 4917 var elm = document.getElementById(prop.id); 4918 if (!elm) 4919 return; 4920 4921 var preload = false; 4922 if (prop.type == 'image') { 4923 elm = elm.parentNode; 4924 preload = true; 4925 } 4926 4927 elm._command = cmd; 4928 elm._id = prop.id; 4929 if (prop.sel) { 4930 elm.onmousedown = function(e){ return rcmail.button_sel(this._command, this._id); }; 4931 elm.onmouseup = function(e){ return rcmail.button_out(this._command, this._id); }; 4932 if (preload) 4933 new Image().src = prop.sel; 4934 } 4935 if (prop.over) { 4936 elm.onmouseover = function(e){ return rcmail.button_over(this._command, this._id); }; 4937 elm.onmouseout = function(e){ return rcmail.button_out(this._command, this._id); }; 4938 if (preload) 4939 new Image().src = prop.over; 4940 } 4941 }; 4942 4917 4943 // enable/disable buttons for page shifting 4918 4944 this.set_page_buttons = function() … … 4930 4956 4931 4957 for (var i=0; i< this.buttons[cmd].length; i++) { 4932 var prop = this.buttons[cmd][i]; 4933 var elm = document.getElementById(prop.id); 4934 if (!elm) 4935 continue; 4936 4937 var preload = false; 4938 if (prop.type == 'image') { 4939 elm = elm.parentNode; 4940 preload = true; 4941 } 4942 4943 elm._command = cmd; 4944 elm._id = prop.id; 4945 if (prop.sel) { 4946 elm.onmousedown = function(e){ return rcmail.button_sel(this._command, this._id); }; 4947 elm.onmouseup = function(e){ return rcmail.button_out(this._command, this._id); }; 4948 if (preload) 4949 new Image().src = prop.sel; 4950 } 4951 if (prop.over) { 4952 elm.onmouseover = function(e){ return rcmail.button_over(this._command, this._id); }; 4953 elm.onmouseout = function(e){ return rcmail.button_out(this._command, this._id); }; 4954 if (preload) 4955 new Image().src = prop.over; 4956 } 4958 init_button(cmd, this.buttons[cmd][i]); 4957 4959 } 4958 4960 } … … 5567 5569 5568 5570 // overwrite task name 5569 if (query._action.match(/([a-z]+)\/([a-z-_ ]+)/)) {5571 if (query._action.match(/([a-z]+)\/([a-z-_.]+)/)) { 5570 5572 query._action = RegExp.$2; 5571 5573 base = base.replace(/\_task=[a-z]+/, '_task='+RegExp.$1); -
program/steps/mail/func.inc
r782d859 rb08caf5 1449 1449 global $RCMAIL, $IMAP; 1450 1450 1451 if (!is_ a($message, rcube_message))1451 if (!is_object($message) || !is_a($message, rcube_message)) 1452 1452 $message = new rcube_message($message); 1453 1453 -
program/steps/mail/get.inc
rf5e7b353 rb08caf5 80 80 $mimetype = sprintf('%s/%s', $ctype_primary, $ctype_secondary); 81 81 82 // allow post-processing of the message body 83 $plugin = $RCMAIL->plugins->exec_hook('message_part_get', 84 array('id' => $part->mime_id, 'mimetype' => $mimetype, 'part' => $part, 'download' => !empty($_GET['_download']))); 85 86 if ($plugin['abort']) 87 exit; 88 89 // overwrite modified vars from plugin 90 $mimetype = $plugin['mimetype']; 91 list($ctype_primary, $ctype_secondary) = explode('/', $mimetype); 92 if ($plugin['body']) 93 $part->body = $plugin['body']; 94 82 95 $browser = $RCMAIL->output->browser; 83 96 84 97 // send download headers 85 if ($ _GET['_download']) {98 if ($plugin['download']) { 86 99 header("Content-Type: application/octet-stream"); 87 100 if ($browser->ie) … … 98 111 99 112 // deliver part content 100 if ($ctype_primary == 'text' && $ctype_secondary == 'html' && empty($ _GET['_download'])) {113 if ($ctype_primary == 'text' && $ctype_secondary == 'html' && empty($plugin['download'])) { 101 114 // get part body if not available 102 115 if (!$part->body) … … 120 133 $filename = addcslashes($filename, '"'); 121 134 122 $disposition = !empty($ _GET['_download']) ? 'attachment' : 'inline';135 $disposition = !empty($plugin['download']) ? 'attachment' : 'inline'; 123 136 124 137 header("Content-Disposition: $disposition; filename=\"$filename\""); -
program/steps/mail/show.inc
r40a1860 rb08caf5 53 53 $OUTPUT->set_env('mailbox', $mbox_name); 54 54 55 // mimetypes supported by the browser (default settings) 56 $mimetypes = $RCMAIL->config->get('client_mimetypes', 'text/plain,text/html,text/xml,image/jpeg,image/gif,image/png,application/x-javascript,application/pdf,application/x-shockwave-flash'); 57 $OUTPUT->set_env('mimetypes', is_string($mimetypes) ? explode(',', $mimetypes) : (array)$mimetypes); 58 55 59 if ($CONFIG['trash_mbox']) 56 60 $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']); -
program/steps/settings/save_prefs.inc
r1d5779b rb08caf5 142 142 $a_user_prefs['pagesize'] = (int) $CONFIG['max_pagesize']; 143 143 144 $a_user_prefs['timezone'] = $_SESSION['timezone'] =(string) $a_user_prefs['timezone'];144 $a_user_prefs['timezone'] = (string) $a_user_prefs['timezone']; 145 145 146 146 break; -
skins/default/common.css
r7f5a849 rb08caf5 97 97 { 98 98 color: black; 99 } 100 101 input.button[disabled], 102 input.button[disabled]:hover 103 { 104 color: #aaa; 105 border-color: #ccc; 99 106 } 100 107
Note: See TracChangeset
for help on using the changeset viewer.
