Skip to content

Commit

Permalink
YDA-5992: rearrange admin scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Dec 2, 2024
1 parent ff7d99e commit 080d5a0
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__copyright__ = 'Copyright (c) 2021-2024, Utrecht University'
__license__ = 'GPLv3, see LICENSE'


import base64
import json
import random
import string
Expand Down Expand Up @@ -53,7 +53,7 @@ def set(ctx, actor, receiver, target, message):
identifier = generate_random_id(ctx)
timestamp = int(time.time())
notification = {"identifier": identifier, "timestamp": timestamp, "actor": actor, "target": target, "message": message}
ctx.uuUserModify(receiver, "{}_{}".format(NOTIFICATION_KEY, identifier), json.dumps(notification), '', '')
ctx.uuAdminUserModify(receiver, "{}_{}".format(NOTIFICATION_KEY, identifier), str(base64.b64encode(bytes(json.dumps(notification), "utf-8")), "utf-8"))

# Send mail notification if immediate notifications are on.
receiver = user.from_str(ctx, receiver)[0]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions tools/admin/admin-user-modify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
user=$1
shift
property=$1
shift
value=`echo $* | base64 -di`
arg='uuUserModify("'$user'", "'$property'", '\'$value\'', *status, *message)'
/bin/irule -r irods_rule_engine_plugin-irods_rule_language-instance "$arg" null ruleExecOut
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions uuGroup.r
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ uuGroupRemoveOrphanVaultIfEmpty(*vaultName) {
writeString("stdout", "*stdout");
}

# \brief Modify user as admin.
uuAdminUserModify(*userName, *property, *b64blob) {
msiExecCmd("admin-user-modify.sh", "*userName *property *b64blob", "", "", 0, *out);
}

# \brief List all groups the user belongs to.
#
# This function has special handling for 'read-*' groups:
Expand Down

0 comments on commit 080d5a0

Please sign in to comment.