From: Brion Vibber Date: Thu, 18 Nov 2010 22:40:05 +0000 (-0800) Subject: scripts/deletegroup.php -- basic CLI script to delete a group by id or local nickname... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=573f98c5bc387b64bbce7020c15d63efef2b1d7a;p=quix0rs-gnu-social.git scripts/deletegroup.php -- basic CLI script to delete a group by id or local nickname. Like deleteuser.php, this can be used in batch runs by providing the -y override. --- diff --git a/scripts/deletegroup.php b/scripts/deletegroup.php new file mode 100755 index 0000000000..5a1ac109fd --- /dev/null +++ b/scripts/deletegroup.php @@ -0,0 +1,71 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'i::n::y'; +$longoptions = array('id=', 'nickname=', 'yes'); + +$helptext = <<group_id); +} else { + print "You must provide either an ID or a nickname.\n"; + print "\n"; + print $helptext; + exit(1); +} + +if (!have_option('y', 'yes')) { + print "About to PERMANENTLY delete group '{$group->nickname}' ({$group->id}). Are you sure? [y/N] "; + $response = fgets(STDIN); + if (strtolower(trim($response)) != 'y') { + print "Aborting.\n"; + exit(0); + } +} + +print "Deleting..."; +$group->delete(); +print "DONE.\n";