if ($result = mysql_query($sql)) { $f = mysql_fetch_array($result); $nextid = $f[0] + 1; mysql_free_result($result); $sql = "ALTER TABLE problem AUTO_INCREMENT = {$nextid}"; mysql_query($sql); } echo "done!"; } else { echo "fail..."; } } } $show_form = true; if (!isset($OJ_SAE) || !$OJ_SAE) { if (!writable($OJ_DATA)) { echo " You need to add {$OJ_DATA} into your open_basedir setting of php.ini,<br>\r\n\t\t\t\t\tor you need to execute:<br>\r\n\t\t\t\t\t <b>chmod 775 -R {$OJ_DATA} && chgrp -R www-data {$OJ_DATA}</b><br>\r\n\t\t\t\t\tyou can't use import function at this time.<br>"; $show_form = false; } } if ($show_form) { ?> <b>Change ProblemID</b> <ol> <li>Problem <form action='problem_changeid.php' method=post> Move<input type=input name='from'>-> <input type=input name='to'> <input type='hidden' name='do' value='do'> <input type=submit value=submit> <?php
echo $i_message['install_license']; ?> </textarea> </p> <form action="install.php?v=2" method="post"> <p class="center"><input type="submit" style="width:200px;" class="submit" name="next" value="同意协议并安装" /></p> </form> <?php } elseif ($v == '2') { if ($agree == 'no') { echo '<script>alert(' . $i_message['install_disagree_license'] . ');history.go(-1)</script>'; } $dirarray = array('data', 'storage', 'install', 'config'); $writeable = array(); foreach ($dirarray as $key => $dir) { if (writable($dir)) { $writeable[$key] = $dir . result(1, 0); } else { $writeable[$key] = $dir . result(0, 0); $quit = true; } } ?> <h2><?php echo $i_message['install_env']; ?> </h2> <div class="shade"> <h5><?php echo $i_message['php_os']; ?>
$maxfile = min(ini_get("upload_max_filesize"), ini_get("post_max_size")); ?> Import FPS data ,please make sure you file is smaller than [<?php echo $maxfile; ?> ] <br/> or set upload_max_filesize and post_max_size in PHP.ini<br/> if you fail on import big files[10M+],try enlarge your [memory_limit] setting in php.ini.<br> <?php $show_form = true; if (!isset($OJ_SAE) || !$OJ_SAE) { if (!writable($OJ_DATA)) { echo " You need to add {$OJ_DATA} into your open_basedir setting of php.ini,<br>\r\n\t\t\t\t\tor you need to execute:<br>\r\n\t\t\t\t\t <b>chmod 775 -R {$OJ_DATA} && chgrp -R www-data {$OJ_DATA}</b><br>\r\n\t\t\t\t\tyou can't use import function at this time.<br>"; $show_form = false; } if (!writable("../upload")) { echo "../upload is not writable, <b>chmod 770</b> to it.<br>"; $show_form = false; } } if ($show_form) { ?> <br> <form action='problem_import_xml.php' method=post enctype="multipart/form-data"> <b>Import Problem:</b><br /> <input type=file name=fps > <?php require_once "../include/set_post_key.php"; ?> <input type=submit value='Import'>
$folders[$ri->jpgSavePath] = [R, W]; $folders[$ri->movieImgSavePath] = [R, W]; $folders[$ri->vidSavePath] = [R, W]; } else { echo 'Skipping cover folders check, as you have not set up a database yet. You can rerun this script after running install.' . PHP_EOL; } // Check folders. foreach ($folders as $folder => $check) { exists($folder); foreach ($check as $type) { switch ($type) { case R: readable($folder); break; case W: writable($folder); break; case E: executable($folder); break; } } } echo 'Your permissions seem right for this user. Note, this script does not verify all paths, only the most important ones.' . PHP_EOL; if (!nzedb\utility\Misc::isWin()) { $user = posix_getpwuid(posix_geteuid()); if ($user['name'] !== 'www-data') { echo 'If you have not already done so, please rerun this script using the www-data user: sudo -u www-data php verify_permissions.php yes' . PHP_EOL; } } function readable($folder)
?> </h2> <?php if (ini_get('file_uploads')) { ?> <h3><?php echo translate('installnewext'); ?> </h3> <?php $writable = true; if (!writable(FORUM_ROOT . '/temp')) { $writable = false; echo '<p style="color:#A00; font-weight:bold">' . translate('forumnotwritable') . '</p>'; } if (!file_exists(FORUM_ROOT . '/app_config/extensions') || !writable(FORUM_ROOT . '/app_config/extensions')) { $writable = false; echo '<p style="color:#A00; font-weight:bold">' . translate('noextdir') . '</p>'; } ?> <form action="<?php echo $base_config['baseurl']; ?> /admin/extensions" method="post" enctype="multipart/form-data"> <p><input type="file" name="ext_file" accept="application/x-zip-compressed" /><br /><input type="submit" name="form_sent" value="<?php echo translate('install'); ?> "<?php if (!$writable) { echo ' disabled="disabled"'; }
/** * 往文件内容最后添加一行 * @param string $filename 目标文件 * @param string $string 添加内容字串 * @return boolean */ function writeline($filename, $string) { if (!writable($filename)) { return false; } $string = (string) $string; if (empty($string)) { return error('input string is empty'); } $file = fopen($filename, 'a+b'); $length = fwrite($file, $string . "\r\n"); fclose($file); return $length; }
echo '<p style="color:#F00; font-weight:bold">' . $error . '</p>'; } //check if necessary directories are writable if (!file_exists(FORUM_ROOT . '/temp') || !is_dir(FORUM_ROOT . '/temp')) { $ok = false; echo '<p style="color:#F00; font-weight:bold">The directory "temp" does not exist in the forum root directory. Please create it.</p>'; } if (!writable(FORUM_ROOT . '/static/avatars/')) { $ok = false; echo '<p style="color:#F00; font-weight:bold">The directory "static/avatars" is not writable. Please change the permissions so that it is (chmod to 0777 if in doubt)</p>'; } if (!writable(FORUM_ROOT . '/temp/')) { $ok = false; echo '<p style="color:#F00; font-weight:bold">The directory "temp" is not writable. Please change the permissions so that it is (chmod to 0777 if in doubt)</p>'; } if (!writable(FORUM_ROOT . '/app_config/cache/')) { $ok = false; echo '<p style="color:#F00; font-weight:bold">The directory "app_config/cache" is not writable. Please change the permissions so that it is (chmod to 0777 if in doubt)</p>'; } if (strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') && function_exists('apache_get_modules') && !in_array('mod_rewrite', apache_get_modules())) { //check for mod_rewrite $ok = false; echo '<p style="color:#F00; font-weight:bold">mod_rewrite is not installed in Apache. This means that the URL system will not work. Please install it.</p>'; } if (!strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) { echo '<p style="color:#A00; font-weight:bold">You are not running Apache. Please do not continue setting up this software unless you know what you are doing and are familiar with how to operate your server software. Specifically, you need to be knowledgeable about the available URL rewrite tools.</p>'; } ?> <form action="install.php" method="post" enctype="multipart/form-data"> <p><?php echo translate('selectlang');