Jump to content

[Solved] Domain Change Script Failed!


Syntych

Recommended Posts

Hello. I have recently registered a new domain and i'm trying to change my main domain using the script you have provided. When i submit the form it keeps saying "You did not enter the correct password. Please click the back button and try again." while i am sure that the username and the password are correct.

 

My cPanel username is "syntych" and my site is on stevie. The current domain is undergroundunion.co.cc and i want to change it to undergroundunion.org and delete the co.cc domain.

 

Thanks in advance.

 

 

Link to comment
Share on other sites

Did you try changing your password yet using the tool that I linked? The reason I suggested it is because maybe you're using a character in your password that is escaped properly and works for cPanel login, but the domain name change script doesn't escape it properly or handles it slightly differently causing it to think your password is wrong.

 

Worst case scenario your account becomes slightly more secure (because you should change your passwords regularly anyways) and you help us troubleshoot why this script has worked for hundreds if not thousands of other users and it only fails for your particular case.

 

If you're in a hurry to get the new domain up and running faster you could also add it as a addon domain or a parked domain through cPanel.

Link to comment
Share on other sites

So.. I have reset the password and initially used the random one generated that got me into the cPanel but again the domain change script failed with the same error. Then i changed the password again with one of my own but different from the first one and again the same error...

 

I don't think it's a client side problem but just in case i have tried different browsers and computers with different operating systems.

 

I have added the domain as parked but i would like to get rid of the co.cc one.

 

Link to comment
Share on other sites

I think those settings are set correctly already. HTTP authentication is definitely enabled, but I can't seem to get the auth dialog to pop up...

 

Would it be possible for byron to change his script to work with the newer version of cPanel?

Link to comment
Share on other sites

[little bit offtopic]

 

I don't quite understand the purpose of the whole process of changing the main domain of the account in majority of the cases. Why?

 

As long as the old/previous domain name won't be used anymore on the same server by anyone (either by current or by any future owner) it doesn't really matter if it's pointed to the account or not. The new one can be set as parked or addon and used, old can be forgotten completely, as long as DNS won't be set properly to point it here the domain won't be accessible from here anyway.

 

In this specific case of undergroundunion.co.cc - as long as no-one in the future will try to add this domain name to any other account on Stevie it can be left on Syntych's account forever, I see no necessity to remove it.

 

 

And just for peace of mind and to avoid any unexpected surprises, I am always, on any hosting, registering account with the free subdomain that the hosting is providing as the main domain (I don't use it for any website, though) and then all my own domain names I am pointing either as addon or parked domains. I suggest to all the people the same.

 

[/little bit offtopic]

Link to comment
Share on other sites

@Piotr_GRD: I agree, but if a user wanted their old domain completely deactivated then domain change is the way to go.

 

Anyways, here is a new script I just made following a tutorial from HTML-Form-Guide:

 

<?php

//create array of data to be posted
$post_data['user'] = 'ENTERUSER';
$post_data['pass'] = 'ENTERPASS';
$post_data['login_theme'] = 'cpanel';
$post_data['goto_uri'] = '/';

//traverse array and prepare data for posting (key1=value1)
foreach ( $post_data as $key => $value) {
    $post_items[] = $key . '=' . $value;
}

//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);

//create cURL connection
$curl_connection =
  curl_init('http://stevie.heliohost.org:2082/login');

//set options
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT,
  "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);

//set data to be posted
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);

//perform our request
$result = curl_exec($curl_connection);

// get request information
$getinfo = curl_getinfo($curl_connection);
$info = explode("post_login", $getinfo['url']);
if(isset($info[1])) {
        echo "Correct";
}else{
        echo "Fail";
}

// For debugging purposes:
// echo curl_errno($curl_connection) . '-' .
//                curl_error($curl_connection);

//close the connection
curl_close($curl_connection);

?>

 

I haven't added these changes to the domain script though

Link to comment
Share on other sites

[little bit offtopic]

 

I don't quite understand the purpose of the whole process of changing the main domain of the account in majority of the cases. Why?

 

As long as the old/previous domain name won't be used anymore on the same server by anyone (either by current or by any future owner) it doesn't really matter if it's pointed to the account or not. The new one can be set as parked or addon and used, old can be forgotten completely, as long as DNS won't be set properly to point it here the domain won't be accessible from here anyway.

 

In this specific case of undergroundunion.co.cc - as long as no-one in the future will try to add this domain name to any other account on Stevie it can be left on Syntych's account forever, I see no necessity to remove it.

 

 

And just for peace of mind and to avoid any unexpected surprises, I am always, on any hosting, registering account with the free subdomain that the hosting is providing as the main domain (I don't use it for any website, though) and then all my own domain names I am pointing either as addon or parked domains. I suggest to all the people the same.

 

[/little bit offtopic]

 

Yeah, well users kept asking us to change their main domain even when we told them they didn't need to, and so we wrote this script so we don't have to waste our time changing their domain.

Link to comment
Share on other sites

Yeah... for a while when we had less support admins, I would ask a couple "are you really sure?" questions before bothering to change anyone's domain. I don't see the point either, but some users are quite adamant about it.

Link to comment
Share on other sites

From what I can tell the login on Stevie is now taking us to the html version of cpanel. This no longer works for me:

 

http://stevie.heliohost.org:2082/frontend/x3/index.phpcp

 

When I login through:

 

http://stevie.heliohost.org:2082/

 

It takes me here:

 

http://stevie.heliohost.org:2082/frontend/x3/index.html

 

Which is also missing the iframe that takes us through the renew script.

 

And that is the reason for the deletion script and the domain name change script breaking, which can be fixed by seeing my previous post.

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...