Zubrag.com
September 21, 2018, 12:05:52 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: cPanel Email Account Creator - ERROR  (Read 6458 times)
luca
Newbie
*
Posts: 1


« on: March 12, 2011, 02: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"
Code:
Your email account has been created!

Warning: fopen(http://...@xxxxxx.net:2082/frontend/bluehost/mail/doaddpop.html?email=adrianodd&domain=xxxxxx.net&password=asdasd&quota=5120) [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

cpemail.php
Code:
<?
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Email account setup</title>
</head>
<body>
<?PHP

/*
DO NOT REMOVE THIS
AeonCube cPanel Email Creator [EAC] Version 1.3
Copyright 2007 AeonCube Networks
Created by AeonCube Developing Staff

Website: http://aeoncube.com/
*/

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


// include needed files
require_once("config.php");
require_once("settings.php");

// 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>");
}
else
{
$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
if($activate)
{
$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');
}

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

mysql_close($link);
?>
</body>
</html>

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC