I'm using RC 0.7.1 and trying to create a web page, from where I could directly login into RC. My source code is below. This only sends me to the login page and an error appears on the top of the page saying "Invalid request! No data was saved.". This code is copied from logout_redirect/ajax_login, author Roland Liebl. I tried to add the "_task" hidden input element, but did not helped. I've also tried to look into the source code of RC, but after some time I was lost. I also looked at some other code found on google, but it never worked for me. I need a page like this, when after submitting the form, I'm logged in and redirected into RC mail application.
Best regards, Tomas
<html>
<body>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>
<!-- edit action url -->
<form name="webmail" action="http://localhost/roundcubemail/index.php" method="post">
<div class="info" style="color:#f00;display:none"></div>
<input name="_action" value="login" type="hidden" />
<input name="_task" value="login" type="hidden" />
<input name="_timezone" id="rcmlogintz" value="_default_" type="hidden" />
<input name="ajax" value="1" type="hidden" />
User <input name="_user" type="text" value="my@email.com"/><br />
Pass <input name="_pass" type="password" value="my_password" /><br />
<input type="submit">
</form>
<script type="text/javascript">
var d = new Date();
document.getElementById("rcmlogintz").value = d.getTimezoneOffset() / -60;
<?PHP
$message = '';
if(isset($_GET['message'])){
$message = urldecode(trim($_GET['message']));
}
?>
$('div.info').html("<?PHP echo $message ?>");
$('div.info').show();
</script>
</body>
</html>