summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/controllers/User.php18
-rw-r--r--application/helpers/filebin_helper.php1
2 files changed, 19 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";
+ }
+
}
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php
index 189b35db1..d42b2ad87 100644
--- a/application/helpers/filebin_helper.php
+++ b/application/helpers/filebin_helper.php
@@ -426,6 +426,7 @@ function output_cli_usage() {
echo " file nuke_id <ID> Nukes all IDs sharing the same hash\n";
echo " user cron Cronjob\n";
echo " user add_user Add a user\n";
+ echo " user delete_user Delete a user including all their data\n";
echo " tools update_database Update/Initialise the database\n";
echo "\n";
echo "Functions that shouldn't have to be run:\n";