25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Test: Update to the new webadmin pages

This commit is contained in:
Badlop 2024-06-04 21:37:15 +02:00
parent 5a34020d23
commit 4819baaa07
2 changed files with 9 additions and 7 deletions

View File

@ -108,6 +108,7 @@ max_fsm_queue: 1000
queue_type: file
modules:
mod_adhoc: []
mod_admin_extra: []
mod_admin_update_sql: []
mod_announce: []
mod_configure: []

View File

@ -76,10 +76,11 @@ adduser(Config) ->
Body = make_query(
Config,
"server/" ++ binary_to_list(Server) ++ "/users/",
<<"newusername=", (mue(User))/binary, "&newuserpassword=",
(mue(Password))/binary, "&addnewuser=Add+User">>),
<<"register/user=", (mue(User))/binary, "&register/password=",
(mue(Password))/binary, "&register=Register">>),
Password = ejabberd_auth:get_password(User, Server),
?match({_, _}, binary:match(Body, <<"<a href='../user/">>)).
?match({_, _}, binary:match(Body, <<"User ", User/binary, "@", Server/binary,
" successfully registered">>)).
changepassword(Config) ->
User = <<"userwebadmin-", (?config(user, Config))/binary>>,
@ -89,10 +90,10 @@ changepassword(Config) ->
Config,
"server/" ++ binary_to_list(Server)
++ "/user/" ++ binary_to_list(mue(User)) ++ "/",
<<"password=", (mue(Password))/binary,
"&chpassword=Change+Password">>),
<<"change_password/newpass=", (mue(Password))/binary,
"&change_password=Change+Password">>),
?match(Password, ejabberd_auth:get_password(User, Server)),
?match({_, _}, binary:match(Body, <<"<p class='result'>Submitted</p>">>)).
?match({_, _}, binary:match(Body, <<"<div class='result'><code>ok</code></div>">>)).
removeuser(Config) ->
User = <<"userwebadmin-", (?config(user, Config))/binary>>,
@ -101,7 +102,7 @@ removeuser(Config) ->
Config,
"server/" ++ binary_to_list(Server)
++ "/user/" ++ binary_to_list(mue(User)) ++ "/",
<<"password=&removeuser=Remove+User">>),
<<"&unregister=Unregister">>),
false = ejabberd_auth:user_exists(User, Server),
?match(nomatch, binary:match(Body, <<"<h3>Last Activity</h3>20">>)).