RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > Third Party Contributions > Old Style Plug-Ins

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

Reply
  7 links from elsewhere to this Post. Click to view. #1  
Old 11-14-2008, 08:49 PM
xul xul is offline
Registered User
 
Join Date: Sep 2008
Posts: 2
Default Change password for virtual users

Here's an easy modification to the "Roundcube cPanel Addons" by Roger D. Fedor, I modified it to let virtual users change their passwords (without cpanel).

I followed the Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail Guide
HTML Code:
http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu8.04
to set up a mail server but I wanted RoundCube instead of SquirrelMail. (RoundCube v 0.2 by the way)

Anyway, my rcube_save_password function in password.inc works like this:

PHP Code:
function rcube_save_password($current_password,$new_password)
{
    global 
$OUTPUT$RCMAIL;

    
$db rcmail::get_instance()->get_dbh();
    
    
// change query accordingly
    
$query "UPDATE mail.users SET password = ENCRYPT(".$new_password.") WHERE email = ".$_SESSION['username'].";";
    
    
$db->query($query);
    
    
$_SESSION['password'] = encrypt_password($new_password);

    
$OUTPUT->show_message('successfullysaved''confirmation');
    

Hope it works for you as well.

Last edited by xul; 11-14-2008 at 09:00 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 11-26-2008, 01:29 PM
Registered User
 
Join Date: Nov 2008
Posts: 1
Default

Tell me please, where can i found this "password.inc" in standart instalation of RC v 0.2?
I have qmail+vpopmail+mysql. How is this script for my configuration?
Thank you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 11-28-2008, 04:46 AM
xul xul is offline
Registered User
 
Join Date: Sep 2008
Posts: 2
Default

Hello.

The original password.inc I used is on a file is on the "Roundcube cPanel Addons" by Roger D. Fedor discussion on this forum. You can download the files from that post

I'm not sure about your configuration because I've never used it, but it should work as long as you have your users login and password information stored in a mysql table.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 11-28-2008, 09:32 AM
Registered User
 
Join Date: Nov 2008
Posts: 1
Default Change password for virtual user version 0.2-beta

Hello,

I don't know if you still need a patch for password change but I've written one for Rouncube version 0.2-beta (the last one at this date).

You can find how to install it at :
Extension Roundcube Modification du mot de passe email. - Le Blog de Philippe

It is in french but I think you will be able to see the files to be changed.

Philippe
Edit/Delete Message
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 12-04-2008, 01:40 PM
Registered User
 
Join Date: Dec 2008
Posts: 2
Default

Quote:
Originally Posted by Philippe Leroy View Post
Hello,

...
You can find how to install it at :
Extension Roundcube Modification du mot de passe email. - Le Blog de Philippe

It is in french but I think you will be able to see the files to be changed.

Philippe
Edit/Delete Message
Hello Philippe,

I've applied your patches according the description, but I have two problems..

First, my index.php totally differ from the one you've described. So I did the following modification to index.php:
Code:
  'settings' => array(
    'folders'       => 'manage_folders.inc',
    'create-folder' => 'manage_folders.inc',
    'rename-folder' => 'manage_folders.inc',
    'delete-folder' => 'manage_folders.inc',
    'subscribe'     => 'manage_folders.inc',
    'unsubscribe'   => 'manage_folders.inc',
    'add-identity'  => 'edit_identity.inc',
    'passwd'        => 'passwd.inc',
    'save-passwd'   => 'passwd.inc',
  )
);
The remaining files were modified by following your tutorial. The first problem is that when I go to Settings, the tab "Password" appears fine, but I can't click on it. However when I enter ..&_action=passwd in the url bar, it correctly takes me to the password changing tab.

The other problem is that whenever I try to change my password, it tells me "Wrong original password" and I have no idea, why.

Actually, I have some, just can't fix on my own

The SQL for getting old pass is the following:
Code:
$DB->query('select password from mail.users where email=\''.$emailuser.'\'');
This SQL must be correct, since I have put $row['password'] to the page title for testing purposes and it selects the correct encoded password.

However if ($actualCryptedPassword != $row['password']) will alway be false since the passwords in the database are encoded to be 13 characters long somehow, but the generated actualCryptedPassword is much more longer.

How could I fix it? Btw I also think that for the same reaon, the update sql query also will be wrong, since set password=\''.md5($newpassword).'\' will do some wrong thing.. probably it will be password = ENCRYPT(".$new_password.") as described here, however this doesn't helps me since that post doesn't descibe how to fix password verification.

Can you help me?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 12-18-2008, 04:31 AM
Registered User
 
Join Date: Dec 2008
Posts: 11
Default

Quote:
Originally Posted by xul View Post
Here's an easy modification to the "Roundcube cPanel Addons" by Roger D. Fedor, I modified it to let virtual users change their passwords (without cpanel).

I followed the Virtual Users And Domains With Postfix, Courier, MySQL And SquirrelMail Guide
HTML Code:
http://www.howtoforge.com/virtual-users-domains-postfix-courier-mysql-squirrelmail-ubuntu8.04
to set up a mail server but I wanted RoundCube instead of SquirrelMail. (RoundCube v 0.2 by the way)

Anyway, my rcube_save_password function in password.inc works like this:

PHP Code:
function rcube_save_password($current_password,$new_password)
{
    global 
$OUTPUT$RCMAIL;

    
$db rcmail::get_instance()->get_dbh();
    
    
// change query accordingly
    
$query "UPDATE mail.users SET password = ENCRYPT(".$new_password.") WHERE email = ".$_SESSION['username'].";";
    
    
$db->query($query);
    
    
$_SESSION['password'] = encrypt_password($new_password);

    
$OUTPUT->show_message('successfullysaved''confirmation');
    

Hope it works for you as well.

xul

Thanks for making this mod !! This is a exactly what I was looking for. I have almost got it working, but I am running into an error that has stumped me, maybe you can give me a pointer or two?

I copied your rcube_save_password function verbatim, but in my error logs I am getting a syntax error. I followed the same virtual domain setup as you did -- so my db has the same name and tables. Here is the output of the roundcube log file:

[17-Dec-2008 21:42:40] MDB2 Error: syntax error (-2): _doQuery: [Error message: Could not execute statement]
[Last executed query: UPDATE mail.users SET password = ENCRYPT(1234567 WHERE email = tester@domain.com;]
[Native code: 1064]
[Native message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@domain.com' at line 1]

[17-Dec-2008 21:42:40 -0600] DB Error: MDB2 Error: syntax error Query: _doQuery: [Error message: Could not execute statement] [Last executed query: UPDATE mail.users SET password = ENCRYPT(1234567 WHERE email = tester@domain.com;] [Native code: 1064] [Native message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@domain.com' at line 1] in /var/www/domain/webmail/program/include/rcube_mdb2.php on line 533 (POST /?_task=settings&_action=save-password)

Any ideas how the syntax is failing in the update statement? I have tried moving things around a bit, but still no luck . . .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 12-22-2008, 12:11 AM
Registered User
 
Join Date: Dec 2008
Posts: 11
Thumbs up Change password tutorial

FYI - I have put together a tutorial on my site about how to change email password for virtual users with multiple email domains.

Props goes to Nemesis02 and xul for the code snippets.

Change Roundcube Password
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
password, vitual

LinkBacks (?)
LinkBack to this Thread: http://www.roundcubeforum.net/7-third-party-contributions/25-old-style-plug-ins/3839-change-password-virtual-users.html
Posted By For Type Date
Change Virutal User Password in Roundcube - wheaties.us This thread Refback 05-07-2009 11:17 AM
email account creation - HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials This thread Refback 01-06-2009 09:15 AM
email account creation - HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials This thread Refback 12-18-2008 09:29 PM
email account creation - HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials This thread Refback 12-17-2008 01:56 PM
email account creation - HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials This thread Refback 12-16-2008 08:34 PM
email account creation - HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials This thread Refback 12-16-2008 02:29 PM
email account creation - HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials This thread Refback 12-16-2008 02:18 PM

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



All times are GMT. The time now is 02:26 PM.


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