Created
December 7, 2012 08:27
-
-
Save p/4231787 to your computer and use it in GitHub Desktop.
phpbb kill user script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
if ($_SERVER['argc'] != 2) { | |
echo "Usage: kill-user user-id\n"; | |
exit(2); | |
} | |
require(dirname(__FILE__).'/../lib/phpbb/script_init.php'); | |
require($phpbb_root_path . 'includes/functions_user.' . $phpEx); | |
$user_id = $_SERVER['argv'][1]; | |
user_delete('remove', $user_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('IN_PHPBB', true); | |
$root = null; | |
foreach (array('webroot/forums') as $dir) { | |
$abs_dir = dirname(__FILE__)."/../../$dir"; | |
if (file_exists("$abs_dir/config.php")) { | |
$root = $abs_dir; | |
break; | |
} | |
} | |
if (!$root) { | |
echo "Unable to determine root\n"; | |
exit(3); | |
} | |
$phpbb_root_path = "$root/"; | |
$phpEx = 'php'; | |
require($phpbb_root_path . 'common.' . $phpEx); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment