PDA

View Full Version : pop mail and cpanel


magnus127
04-29-2003, 06:48 PM
I know I've posted about this before, but the conversation changed enough I think I should start a new thread.

I'm trying to integrate 2 php scripts...the first is PostNuke - CMS, the second is a pop mail account creation script. The pop mail script works by connecting to my Cpanel to make the user. I'm new to php, but it seems to me to be a fairly task to add the specific lines of script to make it work...take a look at the signup script below. Couldn't I nearly cut/paste the sections that connect to cpanel and create a user into the Postnuke new user script? Specifically I'm looking at:
if(isset($newuser))
{
$newemail = "$newuser@$domain";
$mpassword = $password2;

$link = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname) or die("Could not select database");
$query="SELECT username FROM $dbusertbl WHERE((username = '$newuser'))";
$result= mysql_query($query,$link);
if(mysql_num_rows($result) ==0)
{
$query="INSERT INTO $dbusertbl(name,username,password,email) VALUES ('$name','$newuser','$password1','$replymail');";
mysql_query($query,$link);
$socket = fsockopen($host,2082);
$authstr = "$cpaneluser:$cpanelpass";
$pass = base64_encode($authstr);
$in = "GET /frontend/$cpaneltheme/mail/doaddpop.html?email=$newemail&domain=$domain&password=$mpassword&a=$quota\r\n HTTP/1.0\r\nAuthorization: Basic $pass \r\n";
fputs($socket,$in);
fclose( $socket );
?>

Take a look at the entire pop signup script here (http://quasitown.com/postmail/signup.txt) , and the PostNuke new user script is here (http://quasitown.com/postmail/user.txt) . I'm really not trying to get someone to do this for me....I want to learn it. I'm just not sure where to start, and any help would be greatly appreciated!!

magnus127
05-01-2003, 04:30 PM
I'm not sure how to take the lack of response....is it impossible, or just too much of a pain to work out?

krycek
05-01-2003, 10:06 PM
what you have to realise is that Cpanel is far more involved than that. It's a whole great load of interacting scripts.

Personally, I don;t even want to touch the code because I know it would be too time-consuming.

Sorry.

::] krycek [::

magnus127
05-01-2003, 10:14 PM
Admittedly I don't know that much about it, but it seems like the required parts are already written...It's just a matter or melding the two together correctly...Am I just so far out of my league I don't see the rest?

mordred
05-01-2003, 10:37 PM
I'm just answering because you specifically asked about the lack of responses. I think that's the case because what you ask for is not quite a no-brainer. It's far more than just cut'n-paste some lines together. Judging from the code of the PostNuke example there are quite a lot of actions going on in the login process. So there's a lot of possibilites to wreak havoc if one doesn't know the code very well.

What you need is someone who is both familiar with cpanel and PostNuke, and has a good grasp of PHP to connect these two scripts. I'm not familiar with both of these applications, so sorry I can't help out. I don't think it's impossible, but perhaps you have more look if you ask in a place where more PostNuke users/programmers hang out.