RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > News and Announcements > General Discussion

For more information about the ads and why they're here, please see the FAQ
Reply
  #1  
Old 10-21-2008, 02:39 PM
Registered User
 
Join Date: Oct 2008
Posts: 11
Default login and redirect to compose page

Hello,

I'm trying to achieve to following transition into RC.

Users login (userid + password) to our website.
Somewhere on our site they find links to send emails to given adresses.

When the user clicks on such a link, I would like to log the user into RC and direct him to the compose page showing a prepared email template (prefilled to, cc, bcc, subject, body etc),

I can achieve both goals individually, i.e. I know how to log the user into RC using a standard form or even by passing the userid + password in the URL and slightly changing index.php to accept parameters from URL.
I can also build a URL with _task=mail&_action=compose&...... to show the compose page ONCE the user is logged into RC.

But currently I can't find a way to achieve both actions in "a single step".

Any help is greatly appreciated.

Alex
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 10-21-2008, 03:24 PM
rosali's Avatar
Super Moderator
 
Join Date: Dec 2007
Location: Germany
Posts: 1,423
Default

I do not see the sense why you want to do this with RoundCube. There are lots of form mailer scripts which are much more suiteable for your purpose (f.e.: Class: sendmail (sendmail) - PHP Classes)

Last edited by rosali; 10-22-2008 at 11:03 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 10-22-2008, 07:09 AM
Registered User
 
Join Date: Oct 2008
Posts: 11
Default

Hi,

thanks for answering my post.

I agree with you and I know about those classes but in this very specific situation people must send those emails from their personal mailbox (i.e. the send email must show up in the Sent Items), the identity of the sender must be "guaranteed" through the mail client.

We need this in an Intranet solution and have an obligation to work like this.

I have done using Squirrelmail but I'm not too eager on using SM, I prefer RC but if RC can't be changed to support our needs, I'll have to go back to SM.

Alex
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 06-18-2009, 06:15 AM
Registered User
 
Join Date: Jun 2009
Posts: 6
Default

I doubt Alex will see this seven months later but...

It can be done.

I am working on the same kind of thing and found this:

Roundcube login via PHP script : Yet another web log

you can change the redirect() redirect code to something like:

$sendto = $_GET['sendto'];

$rcl->redirect("?_task=mail&_action=compose&_to=$sendto ");


I can get this script to meet my needs, but only when using clear text password! I can only pull my mail sites user name and a MD5 of the password from a cookie...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 06-19-2009, 07:04 AM
rosali's Avatar
Super Moderator
 
Join Date: Dec 2007
Location: Germany
Posts: 1,423
Default

By default RC does not store the password, not even an md5 hash of the password. The encrypted password is only available during a valid RC session.

Perhaps I will write a plugin for RC 0.3 to store an md5 hash of the password in the user_prefs database field.

Meanwhile you have to use the weak plain text method.
__________________
Regards,
Rosali

__________________
MyRoundcube Project http://myroundcube.googlecode.com
MyRoundcube Forum http://http://www.roundcubeforum.net...45-myroundcube
MyRoundcube Online Demo http://mail4us.net
MyRoundcube Plugins Generic Installation Guide http://mail4us.net/myroundcube
Mailing List http://mail4us.net/?_action=plugin.nabble
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 06-21-2009, 12:07 PM
rosali's Avatar
Super Moderator
 
Join Date: Dec 2007
Location: Germany
Posts: 1,423
Default

Here is a plugin to get user's password.

You get the md5 hash of the password by ...
PHP Code:
$hash md5(savepassword::getpw("myuser@mydomain.com")); 
Plugin code (folder name "savepassword")
PHP Code:
<?php

/**
 * Save password plugin
 *
 *
 * @version 1.0 - 21.06.2009
 * @author Roland 'rosali' Liebl
 * @website http://dl.roland-liebl.de/RoundCube/plugins/savepassword
 * @licence GNU GPL
 *
 *
 **/
 
/** USAGE
 *
 * #1- Alter RoundCube Database table `users`:
 *
 *     ALTER TABLE `users` ADD `password` TEXT NULL AFTER `last_login` ;
 *
 * #2- Register plugin ("./config/main.inc.php ::: $rcmail_config['plugins']").
 * #3- Get the password when user is not logged in:
 *     
 *     $password = savepassword::getpw("myuser@mydomain.com");
 *
 **/
 
class savepassword extends rcube_plugin
{

    function 
init()
    {
        
$this->add_hook('login_after', array($this'savepw'));
    }

    function 
savepw($args)
    {
    
        
$rcmail rcmail::get_instance();

        if(
$_SESSION['user_id']){ // user has been authenticated successfully
          
$query "UPDATE `".get_table_name('users')."`
                SET  password=? 
                WHERE user_id=?;"
;
                  
          
$ret $rcmail->db->query($query,$_SESSION['password'],$_SESSION['user_id']);
        
        }

        return 
$args;
    }
    
    function 
getpw($username){
    
        
$rcmail rcmail::get_instance();    
    
        
$rcmail->db->query("
                SELECT * FROM "
.get_table_name('users')."
                WHERE  username=?"
,
                
$username);
            
        
$user $rcmail->db->fetch_assoc();
        
        if(isset(
$user['password'])){
          return 
$rcmail->decrypt($user['password']);
        }
        else{
          return 
false;
        }
    }

}

?>
__________________
Regards,
Rosali

__________________
MyRoundcube Project http://myroundcube.googlecode.com
MyRoundcube Forum http://http://www.roundcubeforum.net...45-myroundcube
MyRoundcube Online Demo http://mail4us.net
MyRoundcube Plugins Generic Installation Guide http://mail4us.net/myroundcube
Mailing List http://mail4us.net/?_action=plugin.nabble
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


For more information about the ads and why they're here, please see the FAQ

All times are GMT. The time now is 01:25 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Copyright © 2006-2008 RoundCube Webmail Community