Changeset 1683 in subversion
- Timestamp:
- Aug 27, 2008 6:58:33 AM (5 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 11 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (2 diffs)
-
installer/check.php (modified) (1 diff)
-
installer/config.php (modified) (5 diffs)
-
installer/rcube_install.php (modified) (3 diffs)
-
installer/test.php (modified) (1 diff)
-
program/include/bugs.inc (modified) (1 diff)
-
program/include/main.inc (modified) (1 diff)
-
program/include/rcmail.php (modified) (2 diffs)
-
program/include/rcube_config.php (modified) (1 diff)
-
program/steps/mail/sendmail.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r1681 r1683 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2008/08/27 (alec) 5 ---------- 6 - Added options to use syslog instead of log file (#1484850) 7 - Added Logging & Debugging section in Installer 3 8 4 9 2008/08/26 (alec) -
trunk/roundcubemail/config/main.inc.php.dist
r1649 r1683 19 19 $rcmail_config['debug_level'] = 1; 20 20 21 // log driver: 'syslog' or 'file'. 22 $rcmail_config['log_driver'] = 'file'; 23 24 // Syslog ident string to use, if using the 'syslog' log driver. 25 $rcmail_config['syslog_id'] = 'roundcube'; 26 27 // Syslog facility to use, if using the 'syslog' log driver. 28 // For possible values see installer or http://php.net/manual/en/function.openlog.php 29 $rcmail_config['syslog_facility'] = LOG_USER; 30 31 // use this folder to store log files (must be writebale for apache user) 32 // This is used by the 'file' log driver. 33 $rcmail_config['log_dir'] = 'logs/'; 34 35 // use this folder to store temp files (must be writeable for apache user) 36 $rcmail_config['temp_dir'] = 'temp/'; 37 21 38 // enable caching of messages and mailbox data in the local database. 22 39 // this is recommended if the IMAP server does not run on the same machine … … 97 114 // includes should be interpreted as PHP files 98 115 $rcmail_config['skin_include_php'] = FALSE; 99 100 // use this folder to store temp files (must be writeable for apache user)101 $rcmail_config['temp_dir'] = 'temp/';102 103 // use this folder to store log files (must be writeable for apache user)104 $rcmail_config['log_dir'] = 'logs/';105 116 106 117 // session lifetime in minutes -
trunk/roundcubemail/installer/check.php
r1681 r1683 117 117 $RCI->pass($classname); 118 118 } 119 else if ($classname == 'DB' || ($classname == 'MDB2' && class_exists('DB'))) {120 $RCI->na($classname, 'Use ' . ($classname == 'DB' ? 'MDB2' : 'DB') . ' instead');121 }122 119 else { 123 120 $RCI->fail($classname, "Failed to load $file", $source_urls[$classname]); -
trunk/roundcubemail/installer/config.php
r1681 r1683 16 16 'preview_pane' => 1, 17 17 'htmleditor' => 1, 18 'debug_level' => 1, 18 19 ); 19 20 … … 48 49 <legend>General configuration</legend> 49 50 <dl class="configblock"> 50 <!-- 51 <dt id="cgfblockgeneral" class="propname">debug_level</dt> 52 <dd> 53 <?php 54 /* 51 52 <dt class="propname">product_name</dt> 53 <dd> 54 <?php 55 56 $input_prodname = new html_inputfield(array('name' => '_product_name', 'size' => 30, 'id' => "cfgprodname")); 57 echo $input_prodname->show($RCI->getprop('product_name')); 58 59 ?> 60 <div>The name of your service (used to compose page titles)</div> 61 </dd> 62 63 <dt class="propname">temp_dir</dt> 64 <dd> 65 <?php 66 67 $input_tempdir = new html_inputfield(array('name' => '_temp_dir', 'size' => 30, 'id' => "cfgtempdir")); 68 echo $input_tempdir->show($RCI->getprop('temp_dir')); 69 70 ?> 71 <div>Use this folder to store temp files (must be writebale for webserver)</div> 72 </dd> 73 74 75 <dt class="propname">ip_check</dt> 76 <dd> 77 <?php 78 79 $check_ipcheck = new html_checkbox(array('name' => '_ip_check', 'id' => "cfgipcheck")); 80 echo $check_ipcheck->show(intval($RCI->getprop('ip_check')), array('value' => 1)); 81 82 ?> 83 <label for="cfgipcheck">Check client IP in session authorization</label><br /> 84 85 <p class="hint">This increases security but can cause sudden logouts when someone uses a proxy with changeing IPs.</p> 86 </dd> 87 88 <dt class="propname">des_key</dt> 89 <dd> 90 <?php 91 92 $input_deskey = new html_inputfield(array('name' => '_des_key', 'size' => 30, 'id' => "cfgdeskey")); 93 echo $input_deskey->show($RCI->getprop('des_key')); 94 95 ?> 96 <div>This key is used to encrypt the users imap password before storing in the session record</div> 97 <p class="hint">It's a random generated string to ensure that every installation has it's own key. 98 If you enter it manually please provide a string of exactly 24 chars.</p> 99 </dd> 100 101 <dt class="propname">enable_caching</dt> 102 <dd> 103 <?php 104 105 $check_caching = new html_checkbox(array('name' => '_enable_caching', 'id' => "cfgcache")); 106 echo $check_caching->show(intval($RCI->getprop('enable_caching')), array('value' => 1)); 107 108 ?> 109 <label for="cfgcache">Cache messages in local database</label><br /> 110 </dd> 111 112 <dt class="propname">enable_spellcheck</dt> 113 <dd> 114 <?php 115 116 $check_caching = new html_checkbox(array('name' => '_enable_spellcheck', 'id' => "cfgspellcheck")); 117 echo $check_caching->show(intval($RCI->getprop('enable_spellcheck')), array('value' => 1)); 118 119 ?> 120 <label for="cfgspellcheck">Make use of the built-in spell checker</label><br /> 121 122 <p class="hint">It is based on GoogieSpell what implies that the message content will be sent to Google in order to check the spelling.</p> 123 </dd> 124 125 </dl> 126 </fieldset> 127 128 <fieldset> 129 <legend>Logging & Debugging</legend> 130 <dl class="loggingblock"> 131 132 <dt class="propname">debug_level</dt> 133 <dd> 134 <?php 135 55 136 $value = $RCI->getprop('debug_level'); 56 137 $check_debug = new html_checkbox(array('name' => '_debug_level[]')); … … 59 140 60 141 echo $check_debug->show(($value & 4) ? 4 : 0, array('value' => 4, 'id' => 'cfgdebug4')); 61 echo '<label for="cfgdebug4"> Display errors</label><br />';142 echo '<label for="cfgdebug4">Print errors (to the browser)</label><br />'; 62 143 63 144 echo $check_debug->show(($value & 8) ? 8 : 0, array('value' => 8, 'id' => 'cfgdebug8')); 64 echo '<label for="cfgdebug8">Verbose display</label><br />'; 65 */ 66 ?> 67 </dd> 68 --> 69 70 <dt class="propname">product_name</dt> 71 <dd> 72 <?php 73 74 $input_prodname = new html_inputfield(array('name' => '_product_name', 'size' => 30, 'id' => "cfgprodname")); 75 echo $input_prodname->show($RCI->getprop('product_name')); 76 77 ?> 78 <div>The name of your service (used to compose page titles)</div> 79 </dd> 80 81 <dt class="propname">temp_dir</dt> 82 <dd> 83 <?php 84 85 $input_tempdir = new html_inputfield(array('name' => '_temp_dir', 'size' => 30, 'id' => "cfgtempdir")); 86 echo $input_tempdir->show($RCI->getprop('temp_dir')); 87 88 ?> 89 <div>Use this folder to store temp files (must be writebale for webserver)</div> 145 echo '<label for="cfgdebug8">Verbose display (enables debug console)</label><br />'; 146 147 ?> 148 </dd> 149 150 <dt class="propname">log_driver</dt> 151 <dd> 152 <?php 153 154 $select_log_driver = new html_select(array('name' => '_log_driver', 'id' => "cfglogdriver")); 155 $select_log_driver->add(array('file', 'syslog'), array('file', 'syslog')); 156 echo $select_log_driver->show($RCI->getprop('log_driver', 'file')); 157 158 ?> 159 <div>How to do logging? 'file' - write to files in the log directory, 'syslog' - use the syslog facility.</div> 90 160 </dd> 91 161 … … 98 168 99 169 ?> 100 <div>Use this folder to store log files (must be writebale for webserver)</div> 101 </dd> 102 103 <dt class="propname">ip_check</dt> 104 <dd> 105 <?php 106 107 $check_ipcheck = new html_checkbox(array('name' => '_ip_check', 'id' => "cfgipcheck")); 108 echo $check_ipcheck->show(intval($RCI->getprop('ip_check')), array('value' => 1)); 109 110 ?> 111 <label for="cfgipcheck">Check client IP in session authorization</label><br /> 112 113 <p class="hint">This increases security but can cause sudden logouts when someone uses a proxy with changeing IPs.</p> 114 </dd> 115 116 <dt class="propname">des_key</dt> 117 <dd> 118 <?php 119 120 $input_deskey = new html_inputfield(array('name' => '_des_key', 'size' => 30, 'id' => "cfgdeskey")); 121 echo $input_deskey->show($RCI->getprop('des_key')); 122 123 ?> 124 <div>This key is used to encrypt the users imap password before storing in the session record</div> 125 <p class="hint">It's a random generated string to ensure that every installation has it's own key. 126 If you enter it manually please provide a string of exactly 24 chars.</p> 127 </dd> 128 129 <dt class="propname">enable_caching</dt> 130 <dd> 131 <?php 132 133 $check_caching = new html_checkbox(array('name' => '_enable_caching', 'id' => "cfgcache")); 134 echo $check_caching->show(intval($RCI->getprop('enable_caching')), array('value' => 1)); 135 136 ?> 137 <label for="cfgcache">Cache messages in local database</label><br /> 138 </dd> 139 140 <dt class="propname">enable_spellcheck</dt> 141 <dd> 142 <?php 143 144 $check_caching = new html_checkbox(array('name' => '_enable_spellcheck', 'id' => "cfgspellcheck")); 145 echo $check_caching->show(intval($RCI->getprop('enable_spellcheck')), array('value' => 1)); 146 147 ?> 148 <label for="cfgspellcheck">Make use of the built-in spell checker</label><br /> 149 150 <p class="hint">It is based on GoogieSpell what implies that the message content will be sent to Google in order to check the spelling.</p> 151 </dd> 170 <div>Use this folder to store log files (must be writebale for webserver). Note that this only applies if you are using the 'file' log_driver.</div> 171 </dd> 172 173 <dt class="propname">syslog_id</dt> 174 <dd> 175 <?php 176 177 $input_syslogid = new html_inputfield(array('name' => '_syslog_id', 'size' => 30, 'id' => "cfgsyslogid")); 178 echo $input_syslogid->show($RCI->getprop('syslog_id', 'roundcube')); 179 180 ?> 181 <div>What ID to use when logging with syslog. Note that this only applies if you are using the 'syslog' log_driver.</div> 182 </dd> 183 184 <dt class="propname">syslog_facility</dt> 185 <dd> 186 <?php 187 188 $input_syslogfacility = new html_select(array('name' => '_syslog_facility', 'id' => "cfgsyslogfacility")); 189 $input_syslogfacility->add('user-level messages', LOG_USER); 190 $input_syslogfacility->add('mail subsystem', LOG_MAIL); 191 $input_syslogfacility->add('local level 0', LOG_LOCAL0); 192 $input_syslogfacility->add('local level 1', LOG_LOCAL1); 193 $input_syslogfacility->add('local level 2', LOG_LOCAL2); 194 $input_syslogfacility->add('local level 3', LOG_LOCAL3); 195 $input_syslogfacility->add('local level 4', LOG_LOCAL4); 196 $input_syslogfacility->add('local level 5', LOG_LOCAL5); 197 $input_syslogfacility->add('local level 6', LOG_LOCAL6); 198 $input_syslogfacility->add('local level 7', LOG_LOCAL7); 199 echo $input_syslogfacility->show($RCI->getprop('syslog_facility'), LOG_USER); 200 201 ?> 202 <div>What ID to use when logging with syslog. Note that this only applies if you are using the 'syslog' log_driver.</div> 203 </dd> 204 205 206 152 207 153 208 </dl> 154 209 </fieldset> 210 155 211 156 212 <fieldset> … … 379 435 380 436 ?> 381 <label for="cfgsmtplog">Log sent messages in <tt> logs/sendmail</tt></label><br />437 <label for="cfgsmtplog">Log sent messages in <tt>{log_dir}/sendmail</tt> or to syslog.</label><br /> 382 438 </dd> 383 439 -
trunk/roundcubemail/installer/rcube_install.php
r1354 r1683 101 101 function getprop($name, $default = '') 102 102 { 103 $value = $this-> is_post && (isset($_POST["_$name"]) || $this->config_props[$name]) ? $_POST["_$name"] : $this->config[$name];103 $value = $this->config[$name]; 104 104 105 105 if ($name == 'des_key' && !$this->configured && !isset($_REQUEST["_$name"])) … … 128 128 129 129 // convert some form data 130 if ($prop == 'debug_level' && is_array($value)) {130 if ($prop == 'debug_level') { 131 131 $val = 0; 132 foreach ($value as $i => $dbgval) 133 $val += intval($dbgval); 134 $value = $val; 132 if (isset($value)) 133 foreach ($value as $dbgval) 134 $val += intval($dbgval); 135 $value = $val; 135 136 } 136 137 else if ($prop == 'db_dsnw' && !empty($_POST['_dbtype'])) { … … 169 170 if ($value == $default) 170 171 continue; 171 172 173 // save change 174 $this->config[$prop] = $value; 175 172 176 // replace the matching line in config file 173 177 $out = preg_replace( -
trunk/roundcubemail/installer/test.php
r1681 r1683 36 36 if ($RCI->configured) { 37 37 $pass = false; 38 foreach (array($RCI->config['temp_dir'],$RCI->config['log_dir']) as $dir) { 38 39 $dirs[] = $RCI->config['temp_dir']; 40 if($RCI->config['log_driver'] != 'syslog') 41 $dirs[] = $RCI->config['log_dir']; 42 43 foreach ($dirs as $dir) { 39 44 $dirpath = $dir{0} == '/' ? $dir : INSTALL_PATH . $dir; 40 45 if (is_writable(realpath($dirpath))) { -
trunk/roundcubemail/program/include/bugs.inc
r1291 r1683 85 85 86 86 // try to open specific log file for writing 87 if ($ fp = @fopen($CONFIG['log_dir'].'/errors', 'a'))87 if ($CONFIG['log_driver'] == 'syslog') 88 88 { 89 syslog(LOG_ERR, $log_entry); 90 } 91 else if ($fp = @fopen($CONFIG['log_dir'].'/errors', 'a')) 92 { 93 // log_driver == 'file' is the default, assumed here. 89 94 fwrite($fp, $log_entry); 90 95 fclose($fp); -
trunk/roundcubemail/program/include/main.inc
r1681 r1683 829 829 $line); 830 830 831 if (empty($CONFIG['log_dir'])) 832 $CONFIG['log_dir'] = INSTALL_PATH.'logs'; 831 if ($CONFIG['log_driver'] == 'syslog') { 832 if ($name == 'errors') 833 $prio = LOG_ERR; 834 else 835 $prio = LOG_INFO; 836 syslog($prio, $log_entry); 837 } else { 838 // log_driver == 'file' is assumed here 839 if (empty($CONFIG['log_dir'])) 840 $CONFIG['log_dir'] = INSTALL_PATH.'logs'; 833 841 834 // try to open specific log file for writing835 if ($fp = @fopen($CONFIG['log_dir'].'/'.$name, 'a'))836 {837 fwrite($fp, $log_entry);838 fclose($fp);839 }840 }842 // try to open specific log file for writing 843 if ($fp = @fopen($CONFIG['log_dir'].'/'.$name, 'a')) { 844 fwrite($fp, $log_entry); 845 fclose($fp); 846 } 847 } 848 } 841 849 842 850 -
trunk/roundcubemail/program/include/rcmail.php
r1681 r1683 83 83 $config_all = $this->config->all(); 84 84 85 // initialize syslog 86 if ($this->config->get('log_driver') == 'syslog') { 87 $syslog_id = $this->config->get('syslog_id', 'roundcube'); 88 $syslog_facility = $this->config->get('syslog_facility', LOG_USER); 89 openlog($syslog_id, LOG_ODELAY, $syslog_facility); 90 } 91 85 92 // set task and action properties 86 93 $this->set_task(strip_quotes(get_input_value('_task', RCUBE_INPUT_GPC))); … … 111 118 $_SESSION['temp'] = true; 112 119 } 113 114 120 115 121 // create user object -
trunk/roundcubemail/program/include/rcube_config.php
r1614 r1683 83 83 if ($this->prop['debug_level'] & 1) { 84 84 ini_set('log_errors', 1); 85 ini_set('error_log', $this->prop['log_dir'] . '/errors'); 85 86 if ($this->prop['log_driver'] == 'syslog') { 87 ini_set('error_log', 'syslog'); 88 } else { 89 ini_set('error_log', $this->prop['log_dir'].'/errors'); 90 } 86 91 } 87 92 if ($this->prop['debug_level'] & 4) { -
trunk/roundcubemail/program/steps/mail/sendmail.inc
r1644 r1683 421 421 if ($CONFIG['smtp_log']) 422 422 { 423 $log_entry =sprintf(423 write_log('sendmail', sprintf( 424 424 "[%s] User: %d on %s; Message for %s; %s\n", 425 425 date("d-M-Y H:i:s O", mktime()), … … 427 427 $_SERVER['REMOTE_ADDR'], 428 428 $mailto, 429 !empty($smtp_response) ? join('; ', $smtp_response) : ''); 430 431 if ($fp = @fopen($CONFIG['log_dir'].'/sendmail', 'a')) 432 { 433 fwrite($fp, $log_entry); 434 fclose($fp); 435 } 429 !empty($smtp_response) ? join('; ', $smtp_response) : '')); 436 430 } 437 431
Note: See TracChangeset
for help on using the changeset viewer.
