cPanel Email Account Creator - ERROR

Started by luca, March 12, 2011, 10:11:36 PM


Hi, I am writing to ask for support on a script recently purchased. I do not know if both of your production, but is remarkably similar.
with your script "cPanel Email Account Creator" I can create email correctly, but with the script "AeonCube cPanel EAC V1.6.2" gives me this error on file "cpemail.php"
Your email account has been created!

Warning: fopen( [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 401 Access Denied in /home1/xxxxxxxx/public_html/posta/registrazione/cpemail.php on line 78
Cannot create email account. Reason for error: fopen function allowed on server

I'm not very expert in php programming, but with your script I can very well use the function "fopen", while it gives me error! below place the file "cpemail.php" script "AeonCube cPanel EAC V1.6.2" I send you in private if you need the complete script, not knowing if I can do, given that the site no longer exists AeronCube

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Email account setup</title>

AeonCube cPanel Email Creator [EAC] Version 1.3
Copyright 2007 AeonCube Networks
Created by AeonCube Developing Staff


// Do not edit below ths line unless you know what you are doing //

// include needed files

// get posted data
$euser = POST($_POST['user']);
$epass = POST($_POST['pass']);
$firstname = POST($_POST['firstname']);
$secondname = POST($_POST['secondname']);
$captcha = POST($_POST['captcha']);

// check if captcha image matches
if($_SESSION['captcha'] != $captcha)
die("Image verification failed!  Please try again");

// check if email is empty
if($euser == "")
die("Email username not specified");
if($epass == "")
die("Password not specified");

// check if the username is taken
$check = "SELECT id FROM accounts WHERE email = '$euser';";
$query = mysql_query($check) or die ("Part 2 : Could not match data because ".mysql_error());
if(mysql_num_rows($query) != 0)
echo "Sorry, there the email address: $username is already taken.<br>";
die("<a href=index.html>Try again</a>");
$new_email = $euser."@".$cpdomain;
// insert the data
$insert = mysql_query("INSERT INTO accounts (email, password, firstname, secondname, status) VALUES ('$new_email', '$epass', '$firstname', '$secondname', '$activate')") or die("Part 3 : Could not insert data because ".mysql_error());

// print a success message
echo "Your email account has been created!<br>";

//cPanel account creating
// if admin activation is not required create account
// else account isn't created until admin approves
$create_email_string = "http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddpop.html?email=$euser&domain=$cpdomain&password=$epass&quota=$equota";
$f = fopen ($create_email_string, "r");
if (!$f) {
die('Cannot create email account. Reason for error: fopen function allowed on server');

$line = fgets ($f, 1024);
if(ereg("already exists!", $line, $out))
die('An email account already exists with that username please try again');
echo "Email account created, please <a href='http://www.$cpdomain:$cplogin'>click here</a> to login";
echo "An admin must activate your account before you can use your email";