| View previous topic :: View next topic |
| Author |
Message |
boy143878
Joined: 31 Mar 2008 Posts: 3
|
Posted: Mon Mar 31, 2008 11:03 am Post subject: Help please with login script |
|
|
Hello all,
I have tried posting this questions in many forums with no response yet. I hope I get lucky here. I pulled this script to create a custom webmail login page. The script works when using a valid user/password. However, if the user/password is incorrect I get sent to the cpanel default webmail login page. I would like to be redirected back to the custom webmail login page if the user/password are incorrect.
Thanks in advance.
Lance
<?php
#Webmail
$protocol = 'http';
$port = 2095;
?>
<html>
<b>cPanel Login</b><br>
<?php
if ($_GET['failed'] == "1") {
echo "Your login attempt failed!";
}
echo "<form action=\"" . $protocol . "://";
echo $_SERVER['HTTP_HOST'] . ":" . $port . "/login/\" ";
echo "method=POST>";
?>
User: <input type=text name=user><br>
Pass: <input type=password name=pass><br>
<?php
echo "<input type=hidden name=failurl value=\"http://" ;
echo $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
echo "?failed=1\">";
?>
<input type=submit value=Login>
</form>
</html> |
|
| Back to top |
|
 |
|
|
webmaster Site Admin

Joined: 17 Aug 2004 Posts: 3640 Location: Sweden
|
Posted: Mon Mar 31, 2008 9:57 pm Post subject: Re: Help please with login script |
|
|
Hi and welcome to DEVPPL.
Try changing:
echo "?failed=1\">";
To:
echo "?failed=0\">";
Or just:
echo "\">"; |
|
| Back to top |
|
 |
boy143878
Joined: 31 Mar 2008 Posts: 3
|
Posted: Thu Apr 03, 2008 7:04 am Post subject: Re: Help please with login script |
|
|
I'm sorry, that did not work. I've been doing some research and it seems to be a cPanel bug. Unless anyone has a fix for it right now.
Someone at another post advised me to use Curl to post and parse the results. Look for differences between a failed and success and modify your redirect accordingly. But I have no idea what that means.  |
|
| Back to top |
|
 |
webmaster Site Admin

Joined: 17 Aug 2004 Posts: 3640 Location: Sweden
|
Posted: Thu Apr 03, 2008 8:58 am Post subject: Re: Help please with login script |
|
|
| Well, the problem does not lie in the code you posted here then. |
|
| Back to top |
|
 |
boy143878
Joined: 31 Mar 2008 Posts: 3
|
Posted: Thu Apr 03, 2008 10:01 am Post subject: Re: Help please with login script |
|
|
| Yes, the code doesn't have a problem, it is a confirmed bug. |
|
| Back to top |
|
 |
|