diff options
author | Mickaël Rémond <mickael.remond@process-one.net> | 2006-07-07 08:06:12 +0000 |
---|---|---|
committer | Mickaël Rémond <mickael.remond@process-one.net> | 2006-07-07 08:06:12 +0000 |
commit | 6290bac932f20de797a9c07da10c4a8de245ef07 (patch) | |
tree | 8e81e9ff6b7fd53d3c8e39aadf28b7dec19d22be /src/web/ejabberd_web_admin.erl | |
parent | * src/mod_muc/mod_muc_room.erl: Fixed the order in which room presence (diff) |
* src/web/ejabberd_web_admin.erl: User creation form now creates
the user for the current virual host only and does not require to type
the hostname (EJAB-116).
* src/jlib.erl: String to JID conversion now returns an error if
the JID string contains two arobases.
SVN Revision: 588
Diffstat (limited to 'src/web/ejabberd_web_admin.erl')
-rw-r--r-- | src/web/ejabberd_web_admin.erl | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/web/ejabberd_web_admin.erl b/src/web/ejabberd_web_admin.erl index d75102e4..1c03e50e 100644 --- a/src/web/ejabberd_web_admin.erl +++ b/src/web/ejabberd_web_admin.erl @@ -1229,7 +1229,7 @@ list_vhosts(Lang) -> list_users(Host, Query, Lang, URLFunc) -> - Res = list_users_parse_query(Query), + Res = list_users_parse_query(Query, Host), Users = ejabberd_auth:get_vh_registered_users(Host), SUsers = lists:sort([{S, U} || {U, S} <- Users]), FUsers = @@ -1262,28 +1262,32 @@ list_users(Host, Query, Lang, URLFunc) -> [?XE("table", [?XE("tr", [?XC("td", ?T("User") ++ ":"), - ?XE("td", [?INPUT("text", "newusername", "")]) + ?XE("td", [?INPUT("text", "newusername", "")]), + ?XE("td", [?C([" @ ", Host])]) ]), ?XE("tr", [?XC("td", ?T("Password") ++ ":"), - ?XE("td", [?INPUT("password", "newuserpassword", "")]) + ?XE("td", [?INPUT("password", "newuserpassword", "")]), + ?X("td") ]), ?XE("tr", [?X("td"), ?XAE("td", [{"class", "alignright"}], - [?INPUTT("submit", "addnewuser", "Add User")]) + [?INPUTT("submit", "addnewuser", "Add User")]), + ?X("td") ])]), ?P] ++ FUsers)]. -list_users_parse_query(Query) -> +%% Parse user creation query and try register: +list_users_parse_query(Query, Host) -> case lists:keysearch("addnewuser", 1, Query) of {value, _} -> - {value, {_, JIDString}} = + {value, {_, Username}} = lists:keysearch("newusername", 1, Query), {value, {_, Password}} = lists:keysearch("newuserpassword", 1, Query), - case jlib:string_to_jid(JIDString) of + case jlib:string_to_jid(Username++"@"++Host) of error -> error; #jid{user = User, server = Server} -> |