summaryrefslogtreecommitdiff
path: root/tools/rebuild.php
diff options
context:
space:
mode:
Diffstat (limited to 'tools/rebuild.php')
-rwxr-xr-xtools/rebuild.php33
1 files changed, 1 insertions, 32 deletions
diff --git a/tools/rebuild.php b/tools/rebuild.php
index 56f94aa9..0dfd9899 100755
--- a/tools/rebuild.php
+++ b/tools/rebuild.php
@@ -1,12 +1,5 @@
#!/usr/bin/php
<?php
- require 'inc/functions.php';
- require 'inc/display.php';
- require 'inc/template.php';
- require 'inc/database.php';
- require 'inc/user.php';
- require 'inc/mod.php';
-
require dirname(__FILE__) . '/inc/cli.php';
$mod = Array(
@@ -21,31 +14,7 @@
echo "== Tinyboard {$config['version']} ==\n";
if(!is_writable($config['file_script'])) {
- echo "Dropping priviledges... (I can't operate as user; I need PHP's rights.)\n";
-
- $filename = '.' . md5(rand()) . '.php';
-
- echo "Copying rebuilder to web directory...\n";
- copy(__FILE__, $filename);
- chmod($filename, 0666);
-
- if(preg_match('/^https?:\/\//', $config['root'])) {
- $url = $config['root'] . $filename;
- } else {
- // assume localhost
- $url = 'http://localhost' . $config['root'] . $filename;
- }
-
- echo "Downloading $url\n";
-
- passthru('curl -s -N ' . escapeshellarg($url));
-
- echo "\n".'Cleaning up afterwards...'."\n";
-
- unlink($filename);
-
- echo "Bye!\n";
- exit;
+ get_httpd_privileges();
}
echo "Clearing template cache...\n";