Does anyone know how to roundcube thru a php script rather than form.
the biggest question i have for you is why?
you can login using open() or some core-http request methods and sending a POST request... but why?
all your going to get back is a LOT of html/javascript that your going to waste a lot of time parsing, and for what?
just to have your php script send an email ?
On Fri, 16 Dec 2005 17:24:12 +1100, Shaun Lloyd slloydie@optusnet.com.au wrote:
Does anyone know how to roundcube thru a php script rather than form.
Hi,
I am looking for the same thing, I need to log-in user from my application writen in PHP to roundcubemail directly. I need to skip the login/password window (yes, I have their password in my scripts - session)
Pavol
On Tuesday 06 December 2005 13:25, Thomas -Balu- Walter wrote:
On Fri, Dec 16, 2005 at 05:24:12PM +1100, Shaun Lloyd wrote:
Does anyone know how to roundcube thru a php script rather than form.
I'm not sure if I get you correctly? You want to login into roundcube using a php-script? Why do you want to do so?
Balu
This is the response I gave to Shaun Lloyd yesterday. He seemed to be able to get it working: I gave the tips, he put together the code.
Couple of things, just to make you aware.
are set with the real username, password, and host. If you don't then you can't login because it will be sending USERNAME, PASSWORD, and HOST as actual words to the server. Honestly, this is a security problem because if you hard-code that information anyone who access that page will be logged right into that email account. There are ways around this but it would require a lot of extra coding. 2) make sure you don't have that session ID hard-coded either. Again, if its not dynamically pulled from roundcube then your app wont work.
<?php session_start(); ?>
<html> <head> <script type="text/javascript" src="program/js/common.js" <http://mail.lloydie.org/program/js/common.js%22> ></script> <script type="text/javascript" src="/program/js/app.js" <http://mail.lloydie.org/program/js/app.js%22> ></script> <script type= "text/javascript"> <!-- var rcmail = new rcube_webmail(); rcmail.set_env('comm_path','?_auth= <http://mail.lloydie.org/?_auth=> <?session_id()?>&_task=mail'); rcmail.set_env('task', 'login'); rcmail.gui_object('message', 'message'); rcmail.gui_object('loginform', 'form'); //--> </script> </head> <body onload="document.form.submit();"> <form name="form" action="./" method="post"> <input type="hidden" name="_auth" value="<?session_id()?>" /> <input name="_action" value="login" type="hidden" /> <input name="_user" size="30" type="hidden" value="USERNAME" /> <input name="_pass" size="30" type="hidden"value="PASSWORD" /> <input name="_host" size="30" type="hidden" value="HOST" /> </form> </body> </html>
It probably works if you do the following:
$_POST['_user'] = 'username'; $_POST['_pass'] = 'password'; $_POST['_action'] = 'login'; require 'roundcubemail/index.php';
This is very ugly though, overwritting superglobal values; but it works ;)
What's with the underscore before each variabel by the way? Personal preference of Thomas probably, but is it really a good idea to do so? :)
Regards, Sjon
Pavol Cvengros wrote:
Hi,
I am looking for the same thing, I need to log-in user from my application writen in PHP to roundcubemail directly. I need to skip the login/password window (yes, I have their password in my scripts - session)
Pavol
On Tuesday 06 December 2005 13:25, Thomas -Balu- Walter wrote:
On Fri, Dec 16, 2005 at 05:24:12PM +1100, Shaun Lloyd wrote:
Does anyone know how to roundcube thru a php script rather than form.
I'm not sure if I get you correctly? You want to login into roundcube using a php-script? Why do you want to do so?
Balu
On Dec 6, 2005, at 12:18 PM, Sjon wrote:
It probably works if you do the following:
$_POST['_user'] = 'username'; $_POST['_pass'] = 'password'; $_POST['_action'] = 'login'; require 'roundcubemail/index.php';
This is very ugly though, overwritting superglobal values; but it
works ;)What's with the underscore before each variabel by the way?
Personal preference of Thomas probably, but is it really a good
idea to do so? :)
That's what the array containing all POST variables is called in
php. It's not a personal preference, it's The Way Things Are.
--david
(not so) obviously I was talking about the underscore before user, pass and action; these are used in almost each variable. I know how the PHP superglobals work ;)
david l goodrich wrote:
On Dec 6, 2005, at 12:18 PM, Sjon wrote:
What's with the underscore before each variabel by the way? Personal preference of Thomas probably, but is it really a good idea to do so? :)
That's what the array containing all POST variables is called in php.
It's not a personal preference, it's The Way Things Are. --david