Anope IRC Services
Anope Support => 2.0.x/1.9.x Support => Topic started by: Daggett on October 22, 2013, 04:15:22 AM
-
Hey! I'm trying to register users with nickserv over XMLRPC (I currently have a system by using curl & Webpanel) or more importantly, be able to change user passwords via xmlrpc or by curl with webpanel. Anyone have any insight? Thanks!
-
By 'XMLRPC' are you referring to m_xmlrpc, or actually to just curl+webpanel? It doesn't look like users can change their passwords in the web panel currently, you could do it via m_xmlrpc by executing /ns set password 'from' the user.
-
I was wondering if it was possible to accomplish changing passwords with either method. Thanks! Also, I was wondering if it was possible to register users via xmlrpc (my workaround currently is to use curl & the webpanel).
-
I'm pretty sure you can just:
$anopexmlrpc = new AnopeXMLRPC("http://127.0.0.1:8080/xmlrpc");
$anopexmlrpc->DoCommand("NickServ", "user", "REGISTER password email");
-
Tried out your code, I'm sure it will work great, but I can seem to find out why it refuses to execute.
PHP Warning: file_get_contents(http://192.168.1.6:8080/xmlrpc): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
I have m_httpd, m_xmlrpc, m_xmlrpc_main, and m_webcpanel all loaded into my config, but I cannot get it to work. I've looked on the forums and couldn't find any relevant answers. Any insight as to what I might be doing wrong? And yes, http://192.168.1.6:8080 is the server and port anope is listening on.
-
/os modinfo m_xmlrpc
-
OperServ PRIVMSG #spooty-admin ADMIN: Daggett used MODINFO on m_xmlrpc
OperServ NOTICE Module: m_xmlrpc Version: 1.9.9 (gc0dea5e) Author: Anope Loaded: Oct 21 22:32:51 2013 Central Daylight Time (16 minutes ago)
-
Hmm not sure. Unload and reload it? If m_httpd gets reloaded at any time it invalidates m_xmlrpc (and really any other module that adds web pages). If that doesn't work start services with -support and pastebin the logs.
-
Reloading m_xmlrpc did no good. Here are the logs: http://pastebin.com/xbN6wGVf
-
The fact that the log says "Serving page /xmlrpc to 192.168.1.7" means that the "page" was found and is being served, not sure why you're still seeing a 404.
-
Hmm. What php extensions need to be enabled? I already enabled xmlrpc in php.ini and I am using the php file found in the docs on github.
-
Hm I went back to read your previous paste but it has been removed, did you run the query while services were in debug mode? If it successfully hit the page you will see the XML parse printing out several messages as it parses the message.
I think PHP would tell you if you didn't have the right extensions. Try running the script from CLI? Can also echo $xmlquery and see just what it's sending.
-
Hey! Sorry here is the log again: http://pastebin.com/miVbJPKU
I didn't find any output regarding XML output.
EDIT: To clarify, I did execute the php page while services were in debug mode.
-
Looks like this is a bug in 1.9.9, I've fixed it in https://github.com/anope/anope/commit/fe31b0a666fbae7b34b749fd08a08293a454ce45.patch and confirmed its working again:
$ php xmlrpc.php
Array
(
[result] => Success
[return] => Nickname Adam2 registered.

)
$
with:
print_r($anopexmlrpc->DoCommand('NickServ', 'Adam2', 'REGISTER qwerty adam@example.com'));
Note the 
 is an escaped new line (\n).
-
Cool. I'll compile it with these changes soon and let you know how it goes. Thanks!
And congratulations on your 300th post Adam!