summaryrefslogtreecommitdiffstats
path: root/application/controllers/User.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-06-14 11:48:12 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-06-14 11:48:12 +0200
commitf34668f94b6a69fa777c6025ccc798b5e3c1110f (patch)
tree9797b1ebb1bf845481cd3d50df369fb558bb860e /application/controllers/User.php
parent9fc9f2005e750aeb433609a583c8b1c460c4b78b (diff)
Add cli user deletion
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers/User.php')
-rw-r--r--application/controllers/User.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/application/controllers/User.php b/application/controllers/User.php
index 26704f3e5..c98784d50 100644
--- a/application/controllers/User.php
+++ b/application/controllers/User.php
@@ -696,4 +696,22 @@ class User extends MY_Controller {
echo "User added\n";
}
+
+ function delete_user()
+ {
+ $this->_require_cli_request();
+ $this->duser->require_implemented("can_delete_account");
+
+ echo "\nWARNING: Deleting a user will delete ALL their data permanently.\n\n";
+
+ $username = $this->_get_line_cli("Username", function($username) {
+ if (get_instance()->muser->username_exists($username)) {
+ return true;
+ }
+ return false;
+ });
+ $this->muser->delete_user_real($username);
+ echo "User removed\n";
+ }
+
}