Skip to content

Instantly share code, notes, and snippets.

@p p/kill-user.php
Created Dec 7, 2012

Embed
What would you like to do?
phpbb kill user script
#!/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);
<?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
You can’t perform that action at this time.