[ Index ] |
|
Code source de dotProject 2.1 RC1 |
1 <?php // $Id: vw_idx_check.php,v 1.8.8.1 2007/01/31 09:36:52 ajdonnison Exp $ 2 3 global $cfgDir, $cfgFile, $failedImg, $filesDir, $locEnDir, $okImg, $tblwidth, $tmpDir; 4 5 $cfgDir = isset($cfgDir) ? $cfgDir : DP_BASE_DIR."/includes"; 6 $cfgFile = isset($cfgFile) ? $cfgFile : DP_BASE_DIR."/includes/config.php"; 7 $filesDir = isset($filesDir) ? $filesDir : DP_BASE_DIR."/files"; 8 $locEnDir = isset($locEnDir) ? $locEnDir : DP_BASE_DIR."/locales/en"; 9 $tmpDir = isset($tmpDir) ? $tmpDir : DP_BASE_DIR."/files/temp"; 10 $tblwidth = isset($tblwidth) ? $tblwidth :'100%'; 11 $chmod = 0777; 12 13 function dPgetIniSize($val) { 14 $val = trim($val); 15 if (strlen($val <= 1)) return $val; 16 $last = $val{strlen($val)-1}; 17 switch($last) { 18 case 'k': 19 case 'K': 20 return (int) $val * 1024; 21 break; 22 case 'm': 23 case 'M': 24 return (int) $val * 1048576; 25 break; 26 default: 27 return $val; 28 } 29 } 30 31 ?> 32 33 <table cellspacing="0" cellpadding="3" border="0" class="tbl" width="<?php echo $tblwidth; ?>" align="center"> 34 <tr> 35 <td class="title" colspan="2">Check for Requirements</td> 36 </tr> 37 <tr> 38 <td class="item"><li>PHP Version >= 4.1</li></td> 39 <td align="left"><?php echo version_compare(phpversion(), '4.1', '<') ? '<b class="error">'.$failedImg.' ('.phpversion().'): dotProject may not work. Please upgrade!</b>' : '<b class="ok">'.$okImg.'</b><span class="item"> ('.phpversion().')</span>';?></td> 40 </tr> 41 <tr> 42 <td class="item"><li>Server API</li></td> 43 <td align="left"><?php echo (php_sapi_name() != "cgi") ? '<b class="ok">'.$okImg.'</b><span class="item"> ('.php_sapi_name().')</span>' : '<b class="error">'.$failedImg.' CGI mode is likely to have problems</b>';?></td> 44 </tr> 45 46 <tr> 47 <td class="item"><li>GD Support (for GANTT Charts)</li></td> 48 <td align="left"><?php echo extension_loaded('gd') ? '<b class="ok">'.$okImg.'</b>' : '<b class="error">'.$failedImg.'</b> GANTT Chart functionality may not work correctly.';?></td> 49 </tr> 50 <tr> 51 <td class="item"><li>Zlib compression Support</li></td> 52 <td align="left"><?php echo extension_loaded('zlib') ? '<b class="ok">'.$okImg.'</b>' : '<b class="error">'.$failedImg.'</b> Some non-core modules such as Backup may have restricted operation.';?></td> 53 </tr> 54 <?php 55 $maxfileuploadsize = min(dPgetIniSize(ini_get('upload_max_filesize')), dPgetIniSize(ini_get('post_max_size'))); 56 $memory_limit = dPgetIniSize(ini_get('memory_limit')); 57 if ($memory_limit > 0 && $memory_limit < $maxfileuploadsize) $maxfileuploadsize = $memory_limit; 58 // Convert back to human readable numbers 59 if ($maxfileuploadsize > 1048576) 60 $maxfileuploadsize = (int)($maxfileuploadsize / 1048576) . 'M'; 61 else if ($maxfileuploadsize > 1024) 62 $maxfileuploadsize = (int)($maxfileuploadsize / 1024) . 'K'; 63 ?> 64 65 <tr> 66 <td class="item"><li>File Uploads</li></td> 67 <td align="left"><?php echo ini_get('file_uploads') ? '<b class="ok">'.$okImg.'</b><span class="item"> (Max File Upload Size: '. $maxfileuploadsize .')</span>' : '<b class="error">'.$failedImg.'</b><span class="warning"> Upload functionality will not be available</span>';?></td> 68 </tr> 69 <tr> 70 <td class="item"><li>Session Save Path writable?</li></td> 71 <td align="left"> 72 <?php 73 $sspath = ini_get('session.save_path'); 74 if (! $sspath) { 75 echo "<b class='error'>$failedImg Fatal:</b> <span class='item'>session.save_path</span> <b class='error'> is not set</b>"; 76 } else if (is_dir($sspath) && is_writable($sspath)) { 77 echo "<b class='ok'>$okImg</b> <span class='item'>($sspath)</span>"; 78 } else { 79 echo "<b class='error'>$failedImg Fatal:</b> <span class='item'>$sspath</span><b class='error'> not existing or not writable</b>"; 80 } 81 ?></td> 82 </tr> 83 <tr> 84 <td class="title" colspan="2"><br />Database Connectors</td> 85 </tr> 86 <tr> 87 <td class="item" colspan="2"><p>The next tests check for database support compiled with php. We use the ADODB database abstraction layer which comes with drivers for 88 many databases. Consult the ADODB documentation for details. <p>For the moment only MySQL is fully supported, so you need to make sure it 89 is available.</td> 90 </tr> 91 <tr> 92 <td class="item"><li>iBase Support</li></td> 93 <td align="left"><?php echo ( function_exists( 'ibase_connect' ) && function_exists( 'ibase_server_info' )) ? '<b class="ok">'.$okImg.'</b><span class="item"> ('.ibase_server_info().')</span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 94 </tr> 95 <tr> 96 <td class="item"><li>Informix Support</li></td> 97 <td align="left"><?php echo function_exists( 'ifx_connect' ) ? '<b class="ok">'.$okImg.'</b><span class="item"> </span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 98 </tr> 99 <tr> 100 <td class="item"><li>LDAP Support</li></td> 101 <td align="left"><?php echo function_exists( 'ldap_connect' ) ? '<b class="ok">'.$okImg.'</b><span class="item"> </span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 102 </tr> 103 <tr> 104 <td class="item"><li>mSQL Support</li></td> 105 <td align="left"><?php echo function_exists( 'msql_connect' ) ? '<b class="ok">'.$okImg.'</b><span class="item"></span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 106 </tr> 107 <tr> 108 <td class="item"><li>MSSQL Server Support</li></td> 109 <td align="left"><?php echo function_exists( 'mssql_connect' ) ? '<b class="ok">'.$okImg.'</b><span class="item"></span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 110 </tr> 111 <tr> 112 <td class="item"><li>MySQL Support</li></td> 113 <td align="left"><?php echo function_exists( 'mysql_connect' ) ? '<b class="ok">'.$okImg.'</b><span class="item"> ('.@mysql_get_server_info().')</span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 114 </tr> 115 <tr> 116 <td class="item"><li>ODBC Support</li></td> 117 <td align="left"><?php echo function_exists( 'odbc_connect' ) ? '<b class="ok">'.$okImg.'</b><span class="item"></span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 118 </tr> 119 <tr> 120 <td class="item"><li>Oracle Support</li></td> 121 <td align="left"><?php echo function_exists( 'oci_connect' ) ? '<b class="ok">'.$okImg.'</b><span class="item"> ('.ociserverversion().')</span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 122 </tr> 123 <tr> 124 <td class="item"><li>PostgreSQL Support</li></td> 125 <td align="left"><?php echo function_exists( 'pg_connect' ) ? '<b class="ok">'.$okImg.'</b><span class="item"></span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 126 </tr> 127 <tr> 128 <td class="item"><li>SQLite Support</li></td> 129 <td align="left"><?php echo function_exists( 'sqlite_open' ) ? '<b class="ok">'.$okImg.'</b><span class="item"> ('.sqlite_libversion().')</span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 130 </tr> 131 <tr> 132 <td class="item"><li>Sybase Support</li></td> 133 <td align="left"><?php echo function_exists( 'sybase_connect' ) ? '<b class="ok">'.$okImg.'</b><span class="item"> </span>' : '<span class="warning">'.$failedImg.' Not available</span>';?></td> 134 </tr> 135 <tr> 136 <td class="title" colspan="2"><br />Check for Directory and File Permissions</td> 137 </tr> 138 <tr> 139 <td class="item" colspan="2">If the message 'World Writable' appears after a file/directory, then Permissions for this File have been set to allow all users to write to this file/directory. 140 Consider changing this to a more restrictive setting to improve security. You will need to do this manually.</td> 141 </tr> 142 <?php 143 $okMessage=""; 144 if ( (file_exists( $cfgFile ) && !is_writable( $cfgFile )) || (!file_exists( $cfgFile ) && !(is_writable( $cfgDir ))) ) { 145 146 @chmod( $cfgFile, $chmod ); 147 @chmod( $cfgDir, $chmod ); 148 $filemode = @fileperms($cfgFile); 149 if ($filemode & 2) 150 $okMessage="<span class='error'> World Writable</span>"; 151 152 } 153 ?> 154 <tr> 155 <td class="item">./includes/config.php writable?</td> 156 <td align="left"><?php echo ( is_writable( $cfgFile ) || is_writable( $cfgDir )) ? '<b class="ok">'.$okImg.'</b>'.$okMessage : '<b class="error">'.$failedImg.'</b><span class="warning"> Configuration process can still be continued. Configuration file will be displayed at the end, just copy & paste this and upload.</span>';?></td> 157 </tr> 158 <?php 159 $okMessage=""; 160 if (!is_writable( $filesDir )) 161 @chmod( $filesDir, $chmod ); 162 163 $filemode = @fileperms($filesDir); 164 if ($filemode & 2) 165 $okMessage="<span class='error'> World Writable</span>"; 166 ?> 167 <tr> 168 <td class="item">./files writable?</td> 169 <td align="left"><?php echo is_writable( $filesDir ) ? '<b class="ok">'.$okImg.'</b>'.$okMessage : '<b class="error">'.$failedImg.'</b><span class="warning"> File upload functionality will be disabled</span>';?></td> 170 </tr> 171 <?php 172 $okMessage=""; 173 if (!is_writable( $tmpDir )) 174 @chmod( $tmpDir, $chmod ); 175 176 $filemode = @fileperms($tmpDir); 177 if ($filemode & 2) 178 $okMessage="<span class='error'> World Writable</span>"; 179 ?> 180 <tr> 181 <td class="item">./files/temp writable?</td> 182 <td align="left"><?php echo is_writable( $tmpDir ) ? '<b class="ok">'.$okImg.'</b>'.$okMessage : '<b class="error">'.$failedImg.'</b><span class="warning"> PDF report generation will be disabled</span>';?></td> 183 </tr> 184 <?php 185 $okMessage=""; 186 if (!is_writable( $locEnDir )) 187 @chmod( $locEnDir, $chmod ); 188 189 $filemode = @fileperms($locEnDir); 190 if ($filemode & 2) 191 $okMessage="<span class='error'> World Writable</span>"; 192 ?> 193 <tr> 194 <td class="item">./locales/en writable?</td> 195 <td align="left"><?php echo is_writable( $locEnDir ) ? '<b class="ok">'.$okImg.'</b>'.$okMessage : '<b class="error">'.$failedImg.'</b><span class="warning"> Translation files cannot be saved. Check /locales and subdirectories for permissions.</span>';?></td> 196 </tr> 197 <tr> 198 <td class="title" colspan="2"><br/>Recommended PHP Settings</td> 199 </tr> 200 <tr> 201 <td class="item">Safe Mode = OFF?</td> 202 <td align="left"><?php echo !ini_get('safe_mode') ? '<b class="ok">'.$okImg.'</b>' : '<b class="error">'.$failedImg.'</b><span class="warning"></span>';?></td> 203 </tr> 204 <tr> 205 <td class="item">Register Globals = OFF?</td> 206 <td align="left"><?php echo !ini_get('register_globals') ? '<b class="ok">'.$okImg.'</b>' : '<b class="error">'.$failedImg.'</b><span class="warning"> There are security risks with this turned ON</span>';?></td> 207 </tr> 208 <tr> 209 <td class="item">Session AutoStart = ON?</td> 210 <td align="left"><?php echo ini_get('session.auto_start') ? '<b class="ok">'.$okImg.'</b>' : '<b class="error">'.$failedImg.'</b><span class="warning"> Try setting to ON if you are experiencing a WhiteScreenOfDeath</span>';?></td> 211 </tr> 212 <tr> 213 <td class="item">Session Use Cookies = ON?</td> 214 <td align="left"><?php echo ini_get('session.use_cookies') ? '<b class="ok">'.$okImg.'</b>' : '<b class="error">'.$failedImg.'</b><span class="warning"> Try setting to ON if you are experiencing problems logging in</span>';?></td> 215 </tr> 216 <tr> 217 <td class="item">Session Use Trans Sid = OFF?</td> 218 <td align="left"><?php echo (!ini_get('session.use_only_cookies') && !ini_get('session.use_trans_sid')) ? '<b class="ok">'.$okImg.'</b>' : '<b class="error">'.$failedImg.'</b><span class="warning"> There are security risks with this turned ON</span>';?></td> 219 </tr> 220 <tr> 221 <td class="title" colspan="2"><br/>Other Recommendations</td> 222 </tr> 223 <tr> 224 <td class="item" colspan="2"> 225 <p>The dotProject team openly recommend Free Open Source software (FOSS). This is not just 226 because dotProject is a FOSS application, but because we believe that the FOSS development 227 method results in better software, with a lower Total Cost of Ownership (TCO). 228 <p>These recommendations reflect that belief, and the fact that as FOSS developers, we 229 develop on FOSS systems, so they will have better support sooner than other non-FOSS 230 systems. 231 </td> 232 </tr> 233 <tr> 234 <td class="item">Free Operating System?</td> 235 <td align="left"><?php echo (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') ? '<b class="ok">'.$okImg.'</b><span class="item"> ('.php_uname().')</span>' : '<b class="error">'.$failedImg.'</b><span class="warning"> 236 It seems you are using a proprietary operating system. You might want to consider a Free Open Source operating system such as Linux. dotProject is usually tested on Linux first and will always have better support for Linux than other operating systems. 237 </span>';?></td> 238 </tr> 239 <tr> 240 <td class="item">Supported Web Server?</td> 241 <td align="left"><?php echo (stristr($_SERVER['SERVER_SOFTWARE'], 'apache') != false) ? '<b class="ok">'.$okImg.'</b><span class="item"> ('.$_SERVER['SERVER_SOFTWARE'].')</span>' : '<b class="error">'.$failedImg.'</b><span class="warning"> 242 It seems you are using an unsupported web server. Only Apache Web server is fully supported by dotProject, and using other web servers may result in unexpected problems. 243 </span>';?></td> 244 </tr> 245 <tr> 246 <td class="item">Standards Compliant Browser?</td> 247 <td align="left"><?php echo (stristr($_SERVER['HTTP_USER_AGENT'], 'msie') == false) ? '<b class="ok">'.$okImg.'</b><span class="item"> ('.$_SERVER['HTTP_USER_AGENT'].')</span>' : '<b class="error">'.$failedImg.'</b><span class="warning"> 248 It seems you are using Internet Explorer. This browser has many known security risks and is not standards compliant. Consider using a browser such as Firefox - the dotProject team in the main develops for Firefox first. 249 </span>';?></td> 250 </tr> 251 </table>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 18 19:46:52 2007 | par Balluche grâce à PHPXref 0.7 |