#!/usr/local/bin/perl -w #NOTE, for some reason taintedness #screws up our reminder.. the Net::Jabber library #doesn't like it #the reguser part and notification part #taken from the O'Reilly Programming Jabber Book #Cleaned up and put to the web by me. #So, mostly written by me, Nick (see http://illx.org for more details) #on 2003-07-03 $ENV{'PATH'} = ''; use strict; use warnings; use CGI; use Net::Jabber 1.0022 qw(Client); use constant NS_REGISTER => 'jabber:iq:register'; my $q = new CGI; my $submit = $q->param('submit') || ''; if($submit eq 'signup') { #validate the input my @reqd_fields = qw(username password name email); foreach my $rf (@reqd_fields) { my $value = $q->param("$rf") || ''; if($value eq '') { content(1); } } $q->import_names('Q'); #check to make sure the email is valid use Email::Valid; my $r = Email::Valid->address("$Q::email"); if(!$r) { content(2); } #sign them up, notify the admin, and say thanks reg_user($Q::username,$Q::password,$Q::name,$Q::email); } else { content(); } sub content { my ($err,$error) = @_; print $q->header, qq~