RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > Third Party Contributions > Plug-Ins

For more information about the ads and why they're here, please see the FAQ
Reply
  #1  
Old 11-27-2006, 04:05 PM
Registered User
 
Join Date: Nov 2006
Posts: 2
Downloads: 0
Uploads: 0
Default [Direct Admin] Auto User Signup

I Have the following perl script that i currently use to make accouts for direct admin you can view this in action @ www.gookaa.com/mail/

Code:
#!/usr/bin/perl -w

# Read the standard input (sent by the form):
read(STDIN, $FormData, $ENV{'CONTENT_LENGTH'});
# Get the name and value for each form input:
@pairs = split(/&/, $FormData);
# Then for each name/value pair....
foreach $pair (@pairs) {
	# Separate the name and value:
	($name, $value) = split(/=/, $pair);
	# Convert + signs to spaces:
	$value =~ tr/+/ /;
	# Convert hex pairs (%HH) to ASCII characters:
	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
	# Store values in a hash called %FORM:
	$FORM{$name} = $value;
}

use HTTP::Request::Common qw(POST);
use LWP::UserAgent;

print "Content-type: text/html\n\n";

@QUERY_STRING = split (/\&/, $ENV{QUERY_STRING});
foreach $line (@QUERY_STRING) {
( $var, $val ) = split (/\=/,$line);
$val =~ s/(\@|\%40)/\\\@/g;
eval "\$" . $var . " = \"" . $val . "\"\n"; print "<br>";
}
$browser = LWP::UserAgent->new();
$browser->agent('Mozilla/4.76 [en] (Win98; U)');
$browser->cookie_jar({});
push @{ $browser->requests_redirectable }, 'POST';

# change the username, password and ip address to your server information.
$url = 'http://USERNAME:PASSWORD@IP:PORT/CMD...AIN_NAME';
$response = $browser->post( $url,
[
action => 'create',
add => 'Submit',
user => "$FORM{'user'}",
passwd => "$FORM{'passwd'}",
passwd2 =>"$FORM{'passwd2'}",
quota => '$FORM{'quota}',
]
);

die "Can't access admin tool -- ", $response->status_line
unless $response->is_success;

print $response->content;
I'm not a coder and was woundering if someone can mod the cpanel script to work with direct admin. I can also get the php version of this script from the Direct Admins API.

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

For more information about the ads and why they're here, please see the FAQ

All times are GMT. The time now is 06:07 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright © 2006-2008 RoundCube Webmail Community