Changeset 1988169 in github
- Timestamp:
- Feb 11, 2008 6:21:15 PM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 6f99263
- Parents:
- ddbdb85
- File:
-
- 1 moved
-
check.php-dist (moved) (moved from check.php) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
check.php-dist
r731e0e5 r1988169 38 38 * @todo HTML/CSS to make it pretty. 39 39 * @todo In devel-next, use bootstrap. 40 * @todo Refactor to use RoundCube classes. 41 */ 42 43 $rctest_config = array(); 44 $rctest_config['from'] = '_yourfrom_'; 45 46 /* 47 ******************************************** 48 ******************************************** 49 ** Don't edit anything else in this file. ** 50 ** Unless (of course) you know what you ** 51 ** are doing. ** 52 ******************************************** 53 ******************************************** 40 54 */ 41 55 … … 53 67 $path = dirname(__FILE__) . '/'; 54 68 ?> 55 <html> 69 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd"> 70 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 56 71 <head> 57 72 <link rel="shortcut icon" href="skins/default/images/favicon.ico"/> 58 73 <link rel="stylesheet" type="text/css" href="skins/default/common.css" /> 74 <style type="text/css"> 75 /* <![CDATA[ */ 76 label { display:block; } 77 .success { color:#006400;font-weight:bold !important; } 78 .fail { color:#ff0000 !important;font-weight:bold !important; } 79 /* ]]> */ 80 </style> 59 81 <title>RoundCube :: check</title> 60 82 </head> … … 62 84 <img src="skins/default/images/roundcube_logo.png" width="165" height="55" border="0" alt="RoundCube Webmail" hspace="12" vspace="2"/> 63 85 86 <h3>Check <?php echo basename(__FILE__); ?> Configuration</h3> 87 From correctly set: 88 <?php 89 if ($rctest_config['from'] == '_yourfrom_') { 90 echo '<span class="fail">NOT OK</span></span>'; 91 } else { 92 echo $rctest_config['from'] . '<br /><br />'; 93 echo '<i>We do not check if this is a <b>valid</b> email address. Since this serves as from & to, make sure it is correct!</i>'; 94 } 95 ?> 96 <br /> 64 97 <?php 65 98 echo '<h3>Check if directories are writable</h3>'; … … 69 102 echo "Directory $dir: "; 70 103 if (!is_writable($path . $dir)) { 71 echo ' NOT OK';72 } else { 73 echo ' OK';104 echo '<span class="fail">NOT OK</span></span>'; 105 } else { 106 echo '<span class="success">OK</span>'; 74 107 } 75 108 echo "<br />"; … … 82 115 echo "File $file: "; 83 116 if (file_exists($path . $file) && is_readable($path . $file)) { 84 echo ' OK';85 } else { 86 echo ' NOT OK';117 echo '<span class="success">OK</span>'; 118 } else { 119 echo '<span class="fail">NOT OK</span></span>'; 87 120 } 88 121 echo '<br />'; … … 98 131 $db = MDB2::connect($rcmail_config['db_dsnw']); 99 132 if (!MDB2::IsError($db)) { 100 echo ' OK';133 echo '<span class="success">OK</span>'; 101 134 $db->disconnect(); 102 135 $db_working = true; 103 136 } else { 104 echo ' NOT OK';137 echo '<span class="fail">NOT OK</span></span>'; 105 138 } 106 139 echo '<br />'; … … 125 158 126 159 if ($tz_db != $tz_local) { 127 echo ' NOT OK';128 } else { 129 echo ' OK';160 echo '<span class="fail">NOT OK</span></span>'; 161 } else { 162 echo '<span class="success">OK</span>'; 130 163 } 131 164 } else { … … 142 175 echo 'status: '; 143 176 if ($auto_start == 1) { 144 echo ' NOT OK';145 } else { 146 echo ' OK';177 echo '<span class="fail">NOT OK</span></span>'; 178 } else { 179 echo '<span class="success">OK</span>'; 147 180 } 148 181 echo '<br />'; … … 151 184 echo 'status: '; 152 185 if ($file_uploads == 1) { 153 echo ' OK';154 } else { 155 echo ' NOT OK';186 echo '<span class="success">OK</span>'; 187 } else { 188 echo '<span class="fail">NOT OK</span></span>'; 156 189 } 157 190 … … 162 195 $save_path = ini_get('session.save_path'); 163 196 if (empty($save_path)) { 164 echo ' NOT OK';165 } else { 166 echo " OK: $save_path";197 echo '<span class="fail">NOT OK</span></span>'; 198 } else { 199 echo "<span class="success">OK</span>: $save_path"; 167 200 if (!file_exists($save_path)) { 168 201 echo ', but it does not exist'; … … 175 208 echo '<br />'; 176 209 */ 210 211 @include_once $path . '/config/main.inc.php'; 212 ?> 213 <h3>Check email settings</h3> 214 <h4>SMTP Settings</h4> 215 <?php 216 echo 'Fetch config from config/main.inc.php: '; 217 if (is_array($rcmail_config) && count($rcmail_config)) { 218 echo '<span class="success">OK</span><br />'; 219 echo 'server: ' . $rcmail_config['smtp_server'] . '<br />'; 220 echo 'port: ' . $rcmail_config['smtp_port'] . '<br />'; 221 echo 'user: ' . (($rcmail_config['smtp_user'] == '%u')?'<i>use current session</i>':$rcmail_config['smtp_user']) . '<br />'; 222 echo 'pass: ' . (($rcmail_config['smtp_pass'] == '%p')?'<i>use current session</i>':$rcmail_config['smtp_pass']) . '<br />'; 223 //var_dump($rcmail_config); 224 ?> 225 <h3>Test SMTP settings - send an email</h3> 226 <p>Don't abuse this!</p> 227 <form action="check.php" method="post"> 228 <?php 229 if ($rcmail_config['smtp_server'] != ''): 230 if ($rcmail_config['smtp_user'] == '%u'): 231 ?> 232 <label>Username:</label><input type="text" name="smtp_test[user]" /> 233 <label>Passwort:</label><input type="text" name="smtp_test[pass]" /><br /> 234 <?php 235 endif; 236 endif; 237 ?> 238 Recipient:<br /> 239 <?php echo $rctest_config['from']; ?><br /><br /> 240 <input type="submit" value="send an email" /> 241 </form> 242 <?php 243 if ($_SERVER['REQUEST_METHOD'] == 'POST') { 244 245 echo 'Trying to send email: '; 246 if ($rctest_config['from'] == '_yourfrom_') { 247 echo '<span class="fail">NOT OK</span></span><br />'; 248 echo '<i>Please edit $rctest_config in ' . basename(__FILE__) . '</i><br />'; 249 } else { 250 251 $data = $_POST['smtp_test']; 252 253 require_once 'Mail.php'; 254 255 $recipients = $rctest_config['from']; 256 257 $headers['From'] = $rctest_config['from']; 258 $headers['To'] = $recipients; 259 $headers['Subject'] = 'Test message from RoundCube'; 260 261 $body = 'This is a test to confirm that RoundCube can send email.'; 262 263 $params = array(); 264 $mail_driver = ''; 265 266 if ($rcmail_config['smtp_server'] != '') { 267 $mail_driver = 'smtp'; 268 269 if (isset($data['user'])) { 270 $params['username'] = $data['user']; 271 $params['password'] = $data['pass']; 272 $params['auth'] = true; 273 } 274 275 $params['host'] = $rcmail_config['smtp_server']; 276 $params['port'] = $rcmail_config['smtp_port']; 277 278 } else { 279 $mail_driver = 'mail'; 280 } 281 282 $mail_object =& Mail::factory($mail_driver, $params); 283 $status = $mail_object->send($recipients, $headers, $body); 284 if (!PEAR::isError($status)) { 285 echo '<span class="success">OK</span><br />'; 286 } else { 287 echo '<span class="fail">NOT OK</span></span>'; 288 echo '<br />' . $status->getMessage(); 289 } 290 } 291 } 292 } else { 293 echo '<span class="fail">NOT OK</span></span>'; 294 } 177 295 ?> 178 296 </body>
Note: See TracChangeset
for help on using the changeset viewer.
