From: Evan Prodromou Date: Sun, 8 Nov 2009 03:35:35 +0000 (-0500) Subject: script for granting/revoking user roles X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=321ac38884125f1af9e8f07323f096505d0b2644;p=quix0rs-gnu-social.git script for granting/revoking user roles --- diff --git a/scripts/userrole.php b/scripts/userrole.php new file mode 100644 index 0000000000..7b6a9b3fd8 --- /dev/null +++ b/scripts/userrole.php @@ -0,0 +1,85 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'i:n:r:d'; +$longoptions = array('id=', 'nickname=', 'role=', 'delete'); + +$helptext = <<nickname' ($user->id)..."; + try { + $user->revokeRole($role); + print "OK\n"; + } catch (Exception $e) { + print "FAIL\n"; + print $e->getMessage(); + print "\n"; + } +} else { + print "Granting role '$role' to user '$user->nickname' ($user->id)..."; + try { + $user->grantRole($role); + print "OK\n"; + } catch (Exception $e) { + print "FAIL\n"; + print $e->getMessage(); + print "\n"; + } +}