Hello prosodiers:

Today i found a problem with prosodyctl and the register function. I have a 
jabber server running prosody 0.9.6 with a web interface that use 
prosodyctl in order to register accounts with a browser. The problem is 
that prosodyctl register doesn't take care of already registered accounts 
and if you try to use it with registered accounts the behaviour is to 
overwrite the password with the new one rather than throw an error.

I’m wrote a small patch to util.prosodyctl.lua in order to warn about the 
registered accounts, I think that patch here is the correct place, 
util.prosodyctl.adduser should take care of that.


*** prosodyctl.lua      2014-11-03 12:18:29.454778944 +0100
--- /datos/prosody/lib/util/prosodyctl.lua      2014-11-03 
12:02:37.008468870 +0100
***************
*** 147,156 ****
                usermanager.initialize_host(host);
        end

!       local ok, errmsg = usermanager.create_user(user, password, host);
!       if not ok then
!               return false, errmsg;
!       end
        return true;
  end

--- 147,163 ----
                usermanager.initialize_host(host);
        end

!       local exists, usererrmsg = _M.user_exists(params);
!
!       if not exists then
!       local ok, errmsg = usermanager.create_user(user, password, host);
!       if not ok then
!               return false, errmsg;
!       end
!     else
!         return false, "user-already-exists";
!     end
!
        return true;
  end


-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To post to this group, send email to prosody-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/prosody-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to