Nickserv registration via PHP

The UnrealIRCd team does not officially provide support for any services packages that you may be using or want to use. This forum is provided so the community can help each other with services issues.

Moderator: Supporters

Locked
ChevronNine
Posts: 5
Joined: Fri Mar 19, 2004 4:50 am
Location: Minneapolis, MN
Contact:

Nickserv registration via PHP

Post by ChevronNine »

Here's the deal... Got a portal website for the new Stargate Atlantis show at http://www.chevronnine.com. Part of the site upgrade (when we reach around 500 members) will be to add chat via our own IRC network. Cool, great, everything is in place.

What I would like to do is have it set up so that when you reegister to the site, it also registers your nickname to my NickServ by dropping that info into a text file (or MySQL database). This would allow me to use JIRC and have it auto-identify when you open it up (assuming the user is logged into the site). This would also allow users to use their own IRC Client and already know what their username/passowrd will be. It would be a slick solution for the community.

So far I have two problems:

1 - I have yet to find IRC Services that work with Unreal *and* run on Windows or Mac OS X which has a file that I can write to (text or MySQL).

2 - I don't know what sort of performance hit, if any, I will take should I use a flat-file services database. Maybe they are all flat-file, and I just never bothered to look.

Anyone have any idea on what services package would be able to do this? The PHP coding I can have taken care of, but I need the services to be able to read the users file that the site creates.

Thanks all,

Benjamin
http://www.chevronnine.com
jewles
Posts: 263
Joined: Thu Mar 11, 2004 7:41 pm
Location: Herndon, VA

Windows

Post by jewles »

1 - I have yet to find IRC Services that work with Unreal *and* run on Windows or Mac OS X which has a file that I can write to (text or MySQL).
I'm not sure you'll find any windows services that will work will with mysql... I'm pretty sure Auspice and anope (which both work on windows and link to Unreal) have modules out that use mysql.
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight »

If you want to be able to register through a portal, then why not just have the registration open a socket to connect to the IRC? Then it can execute:

Code: Select all

USER <username> www.youserver.com irc.yourserver.com :NickServ Registration Form
NICK <username>
NICKSERV :REGISTER <pwd> <email>
Then when JIRC connects:

Code: Select all

PASS :<nspwd>
USER <username> <userhost> irc.yourserver.com :Java IRC Chat User
NICK <username>
You don't need to share DBs unless you are going to provide a WWW frontend to NickServ's options.
Certus
Posts: 2
Joined: Sat Mar 20, 2004 4:07 pm

Post by Certus »

we're working on a new extsocket system to allow websites to communicate with anope so you will be able to reg nicks via PHP. this feature will be in anope 1.7
greetings,

Certus
w00t
Posts: 1136
Joined: Thu Mar 25, 2004 3:31 am
Location: Nowra, Australia

Mistake??

Post by w00t »

"NICKSERV :REGISTER <pwd> <email>"

^--- Wouldnt that be PRIVMSG NICKSERV :REGISTER .. etc? :?
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf »

To w00t: If the proper command aliases for Services are configured in UnrealIRCd (Unreal3.2/aliases/*.conf), then aquanight's code will work. By the way I agree with you a bit, since the PRIVMSG command always works.
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight »

With the aliases, you could go so far as just "REGISTER :<pwd> <email>". I don't know if the colon is necessary, though.

Plus the aliases are more secure than PRIVMSG, because of the check against the services server.
w00t
Posts: 1136
Joined: Thu Mar 25, 2004 3:31 am
Location: Nowra, Australia

Post by w00t »

Err... its secure?! News to me...

I thought [email protected] would be fine...

The colon is needed, I believe as a seperator. Check the RFC.

http://www.rfc-editor.org
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
ChevronNine
Posts: 5
Joined: Fri Mar 19, 2004 4:50 am
Location: Minneapolis, MN
Contact:

Post by ChevronNine »

The only problem with this solution is the password. The passwords are all encrypted in MD5 I believe... So if I tell the login script to send the password, it would send a really long string that would fail.

I'm not sure that moving to a MySQL system would help either. I think that would have the same problem.

So how in the world do I get around the password issue? I was thinking of adding another field to my database, but that would be pretty insecure, and I'm not sure I like that. Ideas?

Thanks for you help everyone!

BJH
DeMiNe0
Posts: 50
Joined: Sat Feb 28, 2004 4:11 am

Post by DeMiNe0 »

it wouldnt fail, you would just need to check it agenst another md5 string and see if they match. Thats how most php scripts do it.

WIRCDs have a windows ported anope out that runs mysql.

Otherwise though you could make a php script that connects to the network (or connects a bot to the network) and does this command. I have yet to find a script to do that and i am having some problems doing that as well.
upinsmoke
Posts: 5
Joined: Sun Apr 18, 2004 4:31 am
Contact:

Post by upinsmoke »

this is a script ive used for sometime on my site the nickserv register function works great it will connect to your irc network and register the nick to your services database using a simple form with 3 fields nick,email and password. its written in php
The Awesome Christians User Page is set of PHP scripts that allow you to access IRC services such as nickserv, memoserv, chanserv, and statserv through a Web interface.
http://sourceforge.net/projects/awesome/

hopefully this will help you

smoke

http://paradise-chat.com
Locked