$absent_dirs = array(); foreach ($test_dirs as $my_dir) { if (@file_exists($my_dir)) { @umask(0); // If Apache is the owner of the file if (!test_write($my_dir)) { @chmod($my_dir, 0700); } // I doubt this will work, if above failed, but try anyway if (!test_write($my_dir)) { @chmod($my_dir, 0770); } if (!test_write($my_dir)) { @chmod($my_dir, 0777); } if (!test_write($my_dir)) { array_push($bad_dirs, "<li>" . $my_dir . "</li>\n"); } } else { array_push($absent_dirs, "<li>" . $my_dir . "</li>\n"); } } if (!empty($bad_dirs)) { $bad_dirs = join(" ", $bad_dirs); bad_dirs($bad_dirs, $test_dir, $install); } else { if (!empty($absent_dirs)) { $absent_dirs = join(" ", $absent_dirs); absent_dirs($absent_dirs, $test_dir); } else { if ($install) {
</tr> </thead> <tbody id="dir_mod"> <?php foreach ($sp_testdirs as $d) { ?> <tr> <td><?php echo $d; ?> </td> <?php $fulld = $web_root . str_replace('/*', '', $d); $rsta = is_readable($fulld) ? '<font color=green> [√]读</font>' : '<font color=red>[×]读</font>'; $wsta = test_write($fulld) ? '<font color=green>[√]写</font>' : '<font color=red>[×]写</font>'; echo "\n <td>{$rsta}</td>\n <td>{$wsta}</td>\n \r\n"; ?> </tr> <?php } ?> </tbody> <tfoot> <tr> <th></th> <th></th> </tr> </tfoot> </table> <div class="form-actions row margin">