I have been working on a custom webmail login page for my site, but one thing keeps being an issue.
I can't get the failurl parameter to work properly. No matter what instead of redirecting back to the page (/https://domain/login/example/index.php) , it will default to the cPanel webmail page (/https://domain:2096/login/).
Based off of cPanel documentation I have been using this code for the login form. And it does work to log in.
And I have added these two lines to the "/usr/local/cpanel/failurls" file, I wasn't sure which was was proper as the documentation on failurls is a bit iffy. After adding them I ran the command "/usr/local/cpanel/startup"
I am stumped and any help on this would be very appreciated.
I can't get the failurl parameter to work properly. No matter what instead of redirecting back to the page (/https://domain/login/example/index.php) , it will default to the cPanel webmail page (/https://domain:2096/login/).
Based off of cPanel documentation I have been using this code for the login form. And it does work to log in.
Code:
<div id="main">
<h1 class="cec"></h1>
<fieldset class="cec">
<font size="+1" color="#0000a0">Webmail Login</font>
<?php
print "<form class=\"cec\" action=\"https://" . $_SERVER['HTTP_HOST'] . ":2096/login/\" method=\"post\">";
?>
<div class="cec">
<label class="cec">User:</label>
<input type="text" name="user" class="short" id="user">
</div>
<div class="cec">
<label class="cec">Password:</label>
<input type="password" name="pass" class="short" id="pass">
</div>
<?php
print "<input type=\"hidden\" name=\"failurl\" value=\"http://" . $_SERVER['HTTP_HOST'] .
$_SERVER['PHP_SELF'] . "?failed=1\">";
echo "failurl is: http://" . $_SERVER['HTTP_HOST'] .
$_SERVER['PHP_SELF'] . "?failed=1\""; //User readable, to verify url
?>
<div class="cec2">
<label class="cec"> </label>
<div class="right-div">
<input type="submit" src="press this"/>
</div>
</div>
</fieldset>
</form>
</div>
And I have added these two lines to the "/usr/local/cpanel/failurls" file, I wasn't sure which was was proper as the documentation on failurls is a bit iffy. After adding them I ran the command "/usr/local/cpanel/startup"
Code:
https://domain/login/example/index.php
https://domain/login/example/