]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/userrole.php
Make attachment fit better in notice: drop text and link
[quix0rs-gnu-social.git] / scripts / userrole.php
old mode 100644 (file)
new mode 100755 (executable)
index a2cc7de..428abb8
@@ -18,7 +18,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
+define('INSTALLDIR', dirname(__DIR__));
+define('PUBLICDIR', INSTALLDIR . DIRECTORY_SEPARATOR . 'public');
 
 $shortoptions = 'i:n:r:d';
 $longoptions = array('id=', 'nickname=', 'role=', 'delete');
@@ -27,6 +28,8 @@ $helptext = <<<END_OF_USERROLE_HELP
 userrole.php [options]
 modifies a role for the given user
 
+Available roles: owner moderator administrator sandboxed silenced deleted
+
   -d --delete   delete the role
   -i --id       ID of the user
   -n --nickname nickname of the user
@@ -38,14 +41,14 @@ require_once INSTALLDIR.'/scripts/commandline.inc';
 
 if (have_option('i', 'id')) {
     $id = get_option_value('i', 'id');
-    $profile = Profile::staticGet('id', $id);
+    $profile = Profile::getKV('id', $id);
     if (empty($profile)) {
         print "Can't find user with ID $id\n";
         exit(1);
     }
 } else if (have_option('n', 'nickname')) {
     $nickname = get_option_value('n', 'nickname');
-    $user = User::staticGet('nickname', $nickname);
+    $user = User::getKV('nickname', $nickname);
     if (empty($user)) {
         print "Can't find user with nickname '$nickname'\n";
         exit(1);