From b504f873e7bf2ab6bd62c9ae18241c72fe5e583f Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 5 May 2009 16:25:13 +0100 Subject: prosodyctl: Reformat note to fit in small-width terminals --- prosodyctl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/prosodyctl b/prosodyctl index 0709bcb9..5bd34ee7 100755 --- a/prosodyctl +++ b/prosodyctl @@ -318,9 +318,10 @@ function commands.status(arg) else show_message("Prosody is not running"); if not switched_user and current_uid ~= 0 then - print("\nNote: You will also see this if prosodyctl is not running under the same"); - print(" user account as Prosody. Try running as root (e.g. with 'sudo' in front) to"); - print(" gain access to Prosody's real status."); + print("\nNote:") + print(" You will also see this if prosodyctl is not running under"); + print(" the same user account as Prosody. Try running as root (e.g. "); + print(" with 'sudo' in front) to gain access to Prosody's real status."); end return 2 end -- cgit v1.2.3 From 6b739c8d9ad38274ed46f718e6ec77f6c550c3f0 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 5 May 2009 16:37:17 +0100 Subject: util.prosodyctl: Return success status of usermanager.create_user() --- util/prosodyctl.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/prosodyctl.lua b/util/prosodyctl.lua index 4c6b6ea4..3b523a78 100644 --- a/util/prosodyctl.lua +++ b/util/prosodyctl.lua @@ -19,7 +19,10 @@ function adduser(params) return false, "invalid-hostname"; end - usermanager.create_user(user, password, host); + local ok = usermanager.create_user(user, password, host); + if not ok then + return false, "unable-to-save-data"; + end return true; end -- cgit v1.2.3 From ceb73bd4358e9dd286cc5757112254606dda7d54 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 5 May 2009 16:37:43 +0100 Subject: prosodyctl: Add message for unable-to-save-data error --- prosodyctl | 1 + 1 file changed, 1 insertion(+) diff --git a/prosodyctl b/prosodyctl index 5bd34ee7..91ed7432 100755 --- a/prosodyctl +++ b/prosodyctl @@ -92,6 +92,7 @@ local error_messages = setmetatable({ ["invalid-hostname"] = "The given hostname is invalid"; ["no-password"] = "No password was supplied"; ["no-such-user"] = "The given user does not exist on the server"; + ["unable-to-save-data"] = "Unable to store, perhaps you don't have permission?"; }, { __index = function (t,k) return "Error: "..(tostring(k):gsub("%-", " "):gsub("^.", string.upper)); end }); hosts = {}; -- cgit v1.2.3