Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: XMLRPC change password or register  (Read 7943 times)

0 Members and 1 Guest are viewing this topic.

Daggett

  • Anope User
  • Offline Offline
  • Posts: 8
XMLRPC change password or register
« 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!
« Last Edit: October 22, 2013, 04:23:04 AM by Daggett »
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: XMLRPC change password or register
« Reply #1 on: October 22, 2013, 04:19:50 AM »

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.
Logged

Daggett

  • Anope User
  • Offline Offline
  • Posts: 8
Re: XMLRPC change password or register
« Reply #2 on: October 22, 2013, 04:22:19 AM »

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).
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: XMLRPC change password or register
« Reply #3 on: October 22, 2013, 04:24:33 AM »

I'm pretty sure you can just:

Code: [Select]
$anopexmlrpc = new AnopeXMLRPC("http://127.0.0.1:8080/xmlrpc");
$anopexmlrpc->DoCommand("NickServ", "user", "REGISTER password email");
Logged

Daggett

  • Anope User
  • Offline Offline
  • Posts: 8
Re: XMLRPC change password or register
« Reply #4 on: October 22, 2013, 04:41:50 AM »

Tried out your code, I'm sure it will work great, but I can seem to find out why it refuses to execute.

Code: [Select]
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.
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: XMLRPC change password or register
« Reply #5 on: October 22, 2013, 04:46:52 AM »

/os modinfo m_xmlrpc
Logged

Daggett

  • Anope User
  • Offline Offline
  • Posts: 8
Re: XMLRPC change password or register
« Reply #6 on: October 22, 2013, 04:50:02 AM »

Code: [Select]
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)
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: XMLRPC change password or register
« Reply #7 on: October 22, 2013, 04:55:54 AM »

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.
Logged

Daggett

  • Anope User
  • Offline Offline
  • Posts: 8
Re: XMLRPC change password or register
« Reply #8 on: October 23, 2013, 02:40:16 AM »

Reloading m_xmlrpc did no good. Here are the logs: http://pastebin.com/xbN6wGVf
« Last Edit: October 23, 2013, 02:43:02 AM by Dagget »
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: XMLRPC change password or register
« Reply #9 on: October 23, 2013, 07:21:00 AM »

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.
Logged

Daggett

  • Anope User
  • Offline Offline
  • Posts: 8
Re: XMLRPC change password or register
« Reply #10 on: October 24, 2013, 05:23:00 AM »

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.
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: XMLRPC change password or register
« Reply #11 on: October 24, 2013, 05:33:22 AM »

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.
Logged

Daggett

  • Anope User
  • Offline Offline
  • Posts: 8
Re: XMLRPC change password or register
« Reply #12 on: October 26, 2013, 01:25:07 AM »

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.
« Last Edit: October 26, 2013, 01:26:56 AM by Daggett »
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: XMLRPC change password or register
« Reply #13 on: October 28, 2013, 12:40:43 AM »

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:

Code: [Select]
print_r($anopexmlrpc->DoCommand('NickServ', 'Adam2', 'REGISTER qwerty adam@example.com'));


Note the &#xA is an escaped new line (\n).
Logged

Daggett

  • Anope User
  • Offline Offline
  • Posts: 8
Re: XMLRPC change password or register
« Reply #14 on: October 28, 2013, 03:27:29 AM »

Cool. I'll compile it with these changes soon and let you know how it goes. Thanks!

And congratulations on your 300th post Adam!
Logged
Pages: [1]   Go Up