function upload_error_handler($error) { global $SETTINGS; // only do error check test if the value we get back is purely a number if (is_numeric($error) && strlen($error) == 2) { switch ($error) { case TORRAGE_FILE_NOT_FOUND: echo <<<HTML \t\tError: File empty \t\t<p>If you want to upload another file, go <a href="/">back</a> to the main page.</p> HTML; break; case TORRAGE_FILE_EMPTY: echo <<<HTML \t\tError: File empty \t\t<p>If you want to upload another file, go <a href="/">back</a> to the main page.</p> HTML; break; case TORRAGE_FILE_INVALID: echo <<<HTML \t\tError: Broken torrent file, please recreate it and try again. \t\t<p>If you want to upload another file, go <a href="/">back</a> to the main page.</p> HTML; break; case TORRAGE_FILE_UNKNOWN: echo <<<HTML \t\tError: Something didn't work, please try again later! \t\t<p>If you want to upload another file, go <a href="/">back</a> to the main page.</p> HTML; break; case TORRAGE_FILE_ERROR: echo <<<HTML \t\tError: Something didn't work, please try again later! \t\t<p>If you want to upload another file, go <a href="/">back</a> to the main page.</p> HTML; break; } } else { echo <<<HTML \t\t<p>Your torrentfile is now cached and can be downloaded at:<br /> \t\t<br /><a href="/torrent/{$error}.torrent">http://{$SETTINGS['torrstoredns']}/torrent/{$error}.torrent</a></p> \t\t<p>If you want to upload another file, go <a href="/">back</a> to the main page.</p> HTML; } print_foot(); exit(0); }
<li><a href="singlepage.html"><img src="images/g1.jpg" width="275"></a><p>popular <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g2.jpg" width="275"></a><p>reproduced <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g3.jpg" width="275"></a><p>typesetting <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g5.jpg" width="275"></a><p>standard <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g6.jpg" width="275"></a><p>passages <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g7.jpg" width="275"></a><p>containing <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g5.jpg" width="275"></a><p>versions <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g9.jpg" width="275"></a><p>versions <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g10.jpg" width="275"></a><p>established <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g7.jpg" width="275"></a><p>variations <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g12.jpg" width="275"></a><p>random <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g11.jpg" width="275"></a><p>McClintock <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g13.jpg" width="275"></a><p>passage <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g14.jpg" width="275"></a><p>discovered <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g15.jpg" width="275"></a><p>Malorum <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g16.jpg" width="275"></a><p>Bonorum <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g17.jpg" width="275"></a><p>Finibus <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g18.jpg" width="275"></a><p>alteration <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g19.jpg" width="275"></a><p>Internet <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g9.jpg" width="275"></a><p>available <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g10.jpg" width="275"></a><p>infancy <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g7.jpg" width="275"></a><p>words <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g12.jpg" width="275"></a><p>accompanied <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <li><a href="singlepage.html"><img src="images/g11.jpg" width="275"></a><p>reproduced <span><a href="singlepage.html"><img src="images/view-icon.png" title="view" /><a href="singlepage.html"><img src="images/like.png" title="like" /><a href="singlepage.html"><img src="images/comment.png" title="link" /></a><a href="singlepage.html"><img src="images/priview.png" title="priview" /></a></span></p></li> <!-- End of grid blocks --> </ul> <?php print_foot();
function header_config() { global $cfg, $error_feedbacks, $info_feedbacks, $params, $detail_config; $cfg_password = isset($_POST['cfg_password']) ? $_POST['cfg_password'] : $cfg['cfg_password']; $cfg_root = isset($_POST['cfg_root']) ? $_POST['cfg_root'] : $cfg['cfg_root']; $db_hostname = isset($_POST['db_hostname']) ? $_POST['db_hostname'] : $cfg['db_hostname']; $db_name = isset($_POST['db_name']) ? $_POST['db_name'] : $cfg['db_name']; $db_username = isset($_POST['db_username']) ? $_POST['db_username'] : $cfg['db_username']; $db_password = isset($_POST['db_password']) ? $_POST['db_password'] : $cfg['db_password']; $db_type = 'mysql'; $db_prefix = ''; // Process the form if (isset($_POST['write']) || isset($_POST['download']) || isset($_POST['view'])) { $cfg_path = $cfg_root . '/config.inc.php'; $tpl_path = $cfg_root . '/config.inc.tpl.php'; $values = array('cfg_password' => $cfg_password, 'cfg_root' => $cfg_root, 'db_hostname' => $db_hostname, 'db_name' => $db_name, 'db_username' => $db_username, 'db_password' => $db_password, 'db_type' => $db_type, 'db_prefix' => $db_prefix); if (isset($_POST['write']) && (!file_exists($cfg_path) || is_writable($cfg_path)) && ($fp = @fopen($cfg_path, "wt")) != FALSE) { fwrite($fp, array_to_ini($values)); fclose($fp); // Once we write the config file successfully. Try to use it. $_SESSION['logged'] = 0; header('Location: ' . $_SERVER['PHP_SELF']); return; } else { $error_feedbacks[] = 'Could not write to config.inc.php. Please check access permission or download it and write it manually'; } if (isset($_POST['download'])) { header('Content-Type: text/plain'); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Content-Disposition: attachment; filename="config.inc.php"'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public, no-cache'); header('Content-Transfer-Encoding: binary'); echo array_to_ini($values); exit; } if (isset($_POST['view'])) { header('Content-Type: text/plain'); header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public, no-cache'); header('Content-Transfer-Encoding: binary'); echo array_to_ini($values); exit; } } if (isset($_POST['save'])) { $param_names = array('cfg_relative_url', 'cfg_absolute_url', 'cfg_language', 'cfg_title', 'cfg_webmaster_email', 'cfg_tmpdir', 'cfg_max_users', 'cfg_refresh_rate', 'cfg_user_quota', 'cfg_mailer', 'cfg_smtp_port', 'cfg_smtp_server', 'cfg_max_attachment_size', 'cfg_file_storage'); foreach ($param_names as $name) { if (isset($_POST[$name])) { $params->params[$name] = $_POST[$name]; } } $params->update(); $params->reload(); } // Okay, you are authenticated print_head(); ?> <h1><center>Base Configuration</center></h1> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post"> <table border="0" width="100%"> <tr><td>Config password</td><td><input type="text" name="cfg_password" value="<?php echo $cfg_password; ?> "/></td></tr> <tr><td>Root path</td><td><input type="text" name="cfg_root" value="<?php echo $cfg_root; ?> "/></td></tr> <tr><td>Database hostname</td><td><input type="text" name="db_hostname" value="<?php echo $db_hostname; ?> "/></td></tr> <tr><td>Database name</td><td><input type="text" name="db_name" value="<?php echo $db_name; ?> "/></td></tr> <tr><td>Database username</td><td><input type="text" name="db_username" value="<?php echo $db_username; ?> "/></td></tr> <tr><td>Database password</td><td><input type="text" name="db_password" value="<?php echo $db_password; ?> "/></td></tr> <tr><td colspan="2"><center> <input type="submit" name="write" value="Write"/> <input type="submit" name="download" value="Download"/> <input type="submit" name="view" value="View"/></center></td></tr> </table> <?php if ($detail_config) { ?> <h1><center>Detail Configuration</center></h1> <input type="hidden" name="detail_config" value="<?php echo $detail_config; ?> "/> <table border="0" width="100%"> <tr><td>Relative URL</td><td><input type="text" name="cfg_relative_url" value="<?php echo $params->params['cfg_relative_url']; ?> "/></td></tr> <tr><td>Absolute URL</td><td><input type="text" name="cfg_absolute_url" value="<?php echo $params->params['cfg_absolute_url']; ?> "/></td></tr> <tr><td>Document location</td><td><input type="text" name="cfg_file_storage" value="<?php echo $params->params['cfg_file_storage']; ?> "/></td></tr> <tr><td>Default language</td><td><input type="text" name="cfg_language" value="<?php echo $params->params['cfg_language']; ?> "/></td></tr> <tr><td>Title</td><td><input type="text" name="cfg_title" value="<?php echo $params->params['cfg_title']; ?> "/></td></tr> <tr><td>Webmaster email</td><td><input type="text" name="cfg_webmaster_email" value="<?php echo $params->params['cfg_webmaster_email']; ?> "/></td></tr> <tr><td>Temporary directory</td><td><input type="text" name="cfg_tmpdir" value="<?php echo $params->params['cfg_tmpdir']; ?> "/></td></tr> <tr><td>Max users</td><td><input type="text" name="cfg_max_users" value="<?php echo $params->params['cfg_max_users']; ?> "/></td></tr> <tr><td>Refresh rate</td><td><input type="text" name="cfg_refresh_rate" value="<?php echo $params->params['cfg_refresh_rate']; ?> "/></td></tr> <!-- tr><td>Enable DAV</td><td><input type="text" name="cfg_dav_switch" value="<?php echo $params->params['cfg_dav_switch']; ?> "/></td></tr --> <tr><td>User quota</td><td><input type="text" name="cfg_user_quota" value="<?php echo $params->params['cfg_user_quota']; ?> "/></td></tr> <tr><td>Mailer type</td><td><input type="text" name="cfg_mailer" value="<?php echo $params->params['cfg_mailer']; ?> "/></td></tr> <tr><td>Mail server</td><td><input type="text" name="cfg_smtp_server" value="<?php echo $params->params['cfg_smtp_server']; ?> "/></td></tr> <tr><td>Mail server port</td><td><input type="text" name="cfg_smtp_port" value="<?php echo $params->params['cfg_smtp_port']; ?> "/></td></tr> <tr><td>Max attachment size</td><td><input type="text" name="cfg_max_attachment_size" value="<?php echo $params->params['cfg_max_attachment_size']; ?> "/></td></tr> <tr><td colspan="2"><center> <input type="submit" name="save" value="Save"/></center></td></tr> </table> <?php } ?> </form> <?php print_foot(); }