Hi everyone,
I hope I post this question in the right section.
On my webhost mochahost i'm trying to login to my cpanel and redirect to the roundcube webmail.
Because I made a customized login form on my website for the webmail and I want to use that rather than the cpanel style.
I don't have much experience with cURL, but after some tries I got a 200 header.
Now I got the page after login, which is good, but with this host I have to chose between 3 mailapps (squirrel, horde and roundcube). And this is where I got stuck. I can't find out how to redirect to roundcube without losing the authentication.
Here is my code:
I want to get in to roundcube so I looked into the link with firebug and I tried to change the
to
which I tought should do the trick, but unfortunately it wasn't that easy.
Now i got an error:
But also no luck there.
Hope somebody can help me out, thanks in advance!
I hope I post this question in the right section.
On my webhost mochahost i'm trying to login to my cpanel and redirect to the roundcube webmail.
Because I made a customized login form on my website for the webmail and I want to use that rather than the cpanel style.
I don't have much experience with cURL, but after some tries I got a 200 header.
Now I got the page after login, which is good, but with this host I have to chose between 3 mailapps (squirrel, horde and roundcube). And this is where I got stuck. I can't find out how to redirect to roundcube without losing the authentication.
Here is my code:
Code:
$post = array();
$post['user'] = 'myusername';
$post['pass'] = 'mypassword';
$post['goto_uri'] = '/';
$post['login_theme'] = 'cpanel';
$url = 'https://eleanor.mochahost.com:2096/login/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
// grab URL and pass it to the browser
$response = curl_exec($ch);
echo $response;
// close cURL resource, and free up system resources
curl_close($ch);
Code:
$post['goto_uri'] = '/';
Code:
$post['goto_uri'] = '/3rdparty/roundcube/index.php';
Now i got an error:
I also tried the sample php authentication script from the "Authenticating API Function Calls "-page.CONFIGURATION ERROR
main.inc.php was not found.
db.inc.php was not found.
Please read the INSTALL instructions!
But also no luck there.
Hope somebody can help me out, thanks in advance!