Skip to content

Instantly share code, notes, and snippets.

@p
Created December 7, 2012 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p/4231787 to your computer and use it in GitHub Desktop.
Save p/4231787 to your computer and use it in GitHub Desktop.
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