aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/Doxyfile4
-rwxr-xr-xutil/admins60
2 files changed, 63 insertions, 1 deletions
diff --git a/util/Doxyfile b/util/Doxyfile
index 7be774a81..14464df81 100644
--- a/util/Doxyfile
+++ b/util/Doxyfile
@@ -1,7 +1,8 @@
INPUT = README.md index.php boot.php include/ install/ util/ view/ Zotlabs/
RECURSIVE = YES
PROJECT_NAME = "The Hubzilla"
-PROJECT_LOGO = images/rm-64.png
+PROJECT_LOGO = images/hz-64.png
+IMAGE_PATH = images/
EXCLUDE = .htconfig.php library/ doc/ store/ vendor/ .git/ util/zotsh/easywebdav/ util/generate-hooks-index/
EXCLUDE_PATTERNS = *smarty3* *strings.php *.out *test*
OUTPUT_DIRECTORY = doc
@@ -33,5 +34,6 @@ INTERACTIVE_SVG = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = NO
# fix @var (https://bugzilla.gnome.org/show_bug.cgi?id=626105)
+# Should be obsolete with doxygen >= 1.8.15
#INPUT_FILTER = "sed -e 's/@var\s/@see /'"
INPUT_FILTER = "php util/Doxygen_phpvarfilter.php"
diff --git a/util/admins b/util/admins
new file mode 100755
index 000000000..3c7f0e83e
--- /dev/null
+++ b/util/admins
@@ -0,0 +1,60 @@
+#!/usr/bin/env php
+<?php
+
+if(!file_exists('include/cli_startup.php')) {
+ echo 'Run admins from the top level Hubzilla web directory, as util/admins <args>' . PHP_EOL;
+ exit(1);
+}
+
+
+
+require_once('include/cli_startup.php');
+
+cli_startup();
+
+$helpArgs = getopt('h', array('help'));
+if (count($helpArgs) === 1) {
+ echo <<<'EndOfOutput'
+adds, removes, or lists admins
+
+Usage: util/admins
+ util/admins list
+ util/admins add <account_id>
+ util/admins remove <account_id>
+
+EndOfOutput;
+ return;
+}
+
+if($argc == 1) {
+ $r = q("select account_id, account_roles, account_email from account");
+ if($r) {
+ foreach($r as $rr) {
+ echo sprintf('%4u %s %s', $rr['account_id'], $rr['account_email'],(($rr['account_roles'] & 4096) ? '*' : '')) . PHP_EOL;
+ }
+ }
+}
+
+
+
+if($argc > 1 && $argv[1] === 'list') {
+ $r = q("select account_id, account_roles, account_email from account where (account_roles & 4096) > 0");
+ if($r) {
+ foreach($r as $rr) {
+ echo sprintf('%4u %s %s', $rr['account_id'], $rr['account_email'],(($rr['account_roles'] & 4096) ? '*' : '')) . PHP_EOL;
+ }
+ }
+}
+
+
+if($argc > 2 && $argv[1] === 'add' && intval($argv[2])) {
+ $r = q("update account set account_roles = (account_roles | 4096) where account_id = %d",
+ intval($argv[2])
+ );
+}
+
+if($argc > 2 && $argv[1] === 'remove' && intval($argv[2])) {
+ $r = q("update account set account_roles = (account_roles - 4096) where account_id = %d and (account_roles & 4096) > 0",
+ intval($argv[2])
+ );
+}