RoundCube Webmail Forum  

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

For more information about the ads and why they're here, please see the FAQ
Reply
  #1  
Old 06-27-2006, 06:59 AM
Registered User
 
Join Date: Jun 2006
Posts: 27
Downloads: 0
Uploads: 0
Default RoundCube Webmail 0.1-beta changepassword patch

REPOST
originally posted by poison

this patch/plugin will allow you to change your password

please note: i did not make/create this hack therefore i am not offering any support for this hack or any gurantee that this hack will work for you

Quote:
When I was deploying the new corporate mailserver I needed to re-install the webmail client. We used to work with SquirrelMail (http://www.squirrelmail.org/), a very decent and extendable webmail client. But we all know that the UI of SquirrelMail is ugly, really ugly.

So after some googling I came across this new great webmail client named RoundCube (http://www.roundcube.net/). This is a new fully featured AJAX-based webmail client with a very slick UI. From the first moment I saw that RoundCube was the way to go.

After I did the installation and played around with the webclient I wanted to extend it and give the ability to my users to change their password. The basic idea was to add a tab ‘Password’ in the settings window. Since I’ve configured my mailserver (postfix) with mysql (user fields are created dynamically) it’s just a matter of updating the correct row in the database and reconnect to the IMAP server (courier-imap).
The only problem is that the framework of RoundCube is creap, and I mean really crap. It took me 6 hours to create the tab and the underlaying forms / code. Not because I work that slow but because it’s not intuitive and you have to mess in 5 files in order to add a new action (Ok, I only worked at night on it so my mind wasn’t that clear but anyway).
Below I’ve attached the patch, so if some of you want to make your own tab you can read through the patch and see how it works.

It uses an external script (ext/change_password_function.inc) with one function in it: change_password_function ($user, $currentpass, $newpass).
In my case, it just updates the postfix mailbox database but you can modify this code to fit your needs (eg. if you use the courierpassd you can connect to the password-daemon and change the user’s password here).
Enjoy it,
Nicolas
download: click here

Source: http://www.poison.be/?p=8
__________________
Don't click here!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 06-27-2006, 07:17 AM
Super Moderator
 
Join Date: Jun 2006
Posts: 431
Downloads: 0
Uploads: 0
Send a message via ICQ to skaero Send a message via AIM to skaero Send a message via MSN to skaero Send a message via Yahoo to skaero
Default Re: RoundCube Webmail 0.1-beta changepassword patch

Thanks For posting this, It will be a good tool!
__________________
[size=8pt]SKaero.com <br />&nbsp; [/size]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 07-09-2006, 02:51 AM
Registered User
 
Join Date: Jul 2006
Posts: 1
Downloads: 0
Uploads: 0
Default Little change in change_password_function.inc to work with vpopmail (mysql)

I made a few changes in the original file to work with vpopmail (mysql).

Code:
<?php

/*
 +-----------------------------------------------------------------------+
 | program/steps/settings/change_password.inc              |
 |                                    |
 | This file is part of the RoundCube Webmail client           |
 | Copyright (C) 2005, RoundCube Dev. - Switzerland           |
 | Licensed under the GNU GPL                      |
 |                                    |
 | PURPOSE:                               |
 |  Show edit form for a identity record or to add a new one      |
 |                                    |
 +-----------------------------------------------------------------------+
 | Author: Nicolas Van Eenaeme <nicolas@poison.be>            |
 +-----------------------------------------------------------------------+

 $Id: edit_identity.inc,v 1.1 2006/05/21 05:19:43 roundcube Exp $

*/

 // The host of the database
 define ('RCUBE_EXT_CHANGE_PASS_HOST', 'localhost');

 // The username to connect to the database
 define ('RCUBE_EXT_CHANGE_PASS_USER', 'user');

 // The password to connect to the database
 define ('RCUBE_EXT_CHANGE_PASS_PASS', 'password');

 // The name of the database
 define ('RCUBE_EXT_CHANGE_PASS_NAME', 'vpopmail');

 // The update query. You can use '%clear%' for the clear password,
 //                '%md5%'  for the md5 encrypted password,
 //                '%user%'  for the username,
 //                '%old%'  for the old password and
 //                '%oldmd5%' for the old md5 encrypted password.
 define ('RCUBE_EXT_CHANGE_PASS_UPDATEQUERY', 'UPDATE vpopmail SET pw_clear_passwd = "%clear%", pw_passwd = "%md5%" WHERE pw_name = "%user%" AND pw_passwd = "%oldmd5%" AND pw_domain = "%domain%"');

 // The select query (needed to verify the md5.
 define ('RCUBE_EXT_CHANGE_PASS_SELECTQUERY', 'SELECT pw_passwd FROM vpopmail WHERE pw_name = "%user%" AND pw_domain = "%domain%"');

 function split_user ($user)
  {
   list($s_user, $s_domain) = split('[@]', $user);
   return array($s_user,$s_domain);
  }

 function change_password_function ($s_user, $currentpass, $newpass)
  {
	list ($user, $domain) = split_user ($s_user);

  $dbh =& mysql_connect (RCUBE_EXT_CHANGE_PASS_HOST, RCUBE_EXT_CHANGE_PASS_USER, RCUBE_EXT_CHANGE_PASS_PASS);
  if (!is_resource ($dbh))
   return FALSE;

  if (!mysql_select_db (RCUBE_EXT_CHANGE_PASS_NAME, $dbh))
   return FALSE;

  $q = str_replace (array ('%user%', '%domain%'), array ($user, $domain), RCUBE_EXT_CHANGE_PASS_SELECTQUERY);
 
  $dbr =& mysql_query ($q, $dbh);
  if (!is_resource ($dbr))
   return FALSE;

  $data = mysql_fetch_row ($dbr);
  mysql_free_result ($dbr);

  $newpassmd5 = crypt ($newpass, $data[0]);
  $currentpassmd5 = crypt ($currentpass, $data[0]);
  $q = str_replace (array ('%user%', '%domain%', '%clear%', '%md5%', '%old%', '%oldmd5%'), array ($user, $domain, $newpass, $newpassmd5, $currentpass, $currentpassmd5), RCUBE_EXT_CHANGE_PASS_UPDATEQUERY);

  $dbr =& mysql_query ($q, $dbh);
  if (!$dbr || mysql_affected_rows ($dbh) != 1)
    return FALSE;

  mysql_close ($dbh);
  return TRUE;
  }

?>
Thx for the original tool.
Attached Files
File Type: inc change_password_function.inc (3.3 KB, 29 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 07-30-2006, 07:37 AM
Registered User
 
Join Date: Jul 2006
Posts: 1
Downloads: 0
Uploads: 0
Default Re: RoundCube Webmail 0.1-beta changepassword patch

Here are the changes if you are using Roundcube with hMailServer...

Code:
<?php

/*
 +-----------------------------------------------------------------------+
 | program/steps/settings/change_password.inc              |
 |                                    |
 | This file is part of the RoundCube Webmail client           |
 | Copyright (C) 2005, RoundCube Dev. - Switzerland           |
 | Licensed under the GNU GPL                      |
 |                                    |
 | PURPOSE:                               |
 |  Show edit form for a identity record or to add a new one      |
 |                                    |
 +-----------------------------------------------------------------------+
 | Author: Nicolas Van Eenaeme <nicolas@poison.be>            |
 +-----------------------------------------------------------------------+

 $Id: edit_identity.inc,v 1.1 2006/05/21 05:19:43 roundcube Exp $

*/

 // The host of the database
 define ('RCUBE_EXT_CHANGE_PASS_HOST', 'localhost');

 // The username to connect to the database
 define ('RCUBE_EXT_CHANGE_PASS_USER', 'user');

 // The password to connect to the database
 define ('RCUBE_EXT_CHANGE_PASS_PASS', 'password');

 // The name of the database
 define ('RCUBE_EXT_CHANGE_PASS_NAME', 'database');

 // The update query. You can use '%clear%' for the clear password,
 //                '%md5%'  for the md5 encrypted password,
 //                '%user%'  for the username,
 //                '%old%'  for the old password and
 //                '%oldmd5%' for the old md5 encrypted password.
 define ('RCUBE_EXT_CHANGE_PASS_UPDATEQUERY', 'UPDATE hm_accounts SET accountpassword = "%md5%" WHERE accountaddress = "%user%" AND accountpassword = "%oldmd5%"');

 // The select query (needed to verify the md5.
 define ('RCUBE_EXT_CHANGE_PASS_SELECTQUERY', 'SELECT accountpassword FROM hm_accounts WHERE accountaddress = "%user%"');


 function change_password_function ($user, $currentpass, $newpass)
  {
  $dbh =& mysql_connect (RCUBE_EXT_CHANGE_PASS_HOST, RCUBE_EXT_CHANGE_PASS_USER, RCUBE_EXT_CHANGE_PASS_PASS);
  if (!is_resource ($dbh))
   return FALSE;

  if (!mysql_select_db (RCUBE_EXT_CHANGE_PASS_NAME, $dbh))
   return FALSE;

  $q = str_replace ('%user%', $user, RCUBE_EXT_CHANGE_PASS_SELECTQUERY);
  $dbr =& mysql_query ($q, $dbh);
  if (!is_resource ($dbr))
   return FALSE;

  $data = mysql_fetch_row ($dbr);
  mysql_free_result ($dbr);

  $newpassmd5 = md5($newpass);
  $currentpassmd5 = md5($currentpass);
  $q = str_replace (array ('%user%', '%clear%', '%md5%', '%old%', '%oldmd5%'), array ($user, $newpass, $newpassmd5, $currentpass, $currentpassmd5), RCUBE_EXT_CHANGE_PASS_UPDATEQUERY);

  $dbr =& mysql_query ($q, $dbh);
  if (!$dbr || mysql_affected_rows ($dbh) != 1)
    return FALSE;

  mysql_close ($dbh);
  return TRUE;
  }

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 08-14-2006, 05:40 AM
Registered User
 
Join Date: Jul 2006
Posts: 2
Downloads: 0
Uploads: 0
Default Re: RoundCube Webmail 0.1-beta changepassword patch

I can use one of these Password patches if my server uses Qmail? I use a Virtual Server provided by a hosting company and can access the backend via Plesk configurations. The server comes with Horde (ugly interface) to handle "webmail functions." I am using RoundCube for my site members, but have to refer them to Horde to be able make a password change on their own. Can one of these patched noted here allow my members to change their email through RoundCube. If the change is made via RoundCube/MySQL, does it change it everywhere like Horde does or just on MySQL? Sorry, if I should know this. I would love to just forget Horde, but it is the only option I have at the moment to let members change their own PWs.

Any advice or suggestions will be greatly apprecaited. -- Rick
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 08-14-2006, 04:40 PM
Registered User
 
Join Date: Aug 2006
Posts: 13
Downloads: 0
Uploads: 0
Default Re: RoundCube Webmail 0.1-beta changepassword patch

can someone tell how to install the patch ;/

when i press download i get this :

Quote:
diff -ruN roundcubemail-0.1beta.orig/ext/change_password_function.inc roundcubemail-0.1beta/ext/change_password_function.inc
--- roundcubemail-0.1beta.orig/ext/change_password_function.inc 1970-01-01 01:00:00.000000000 +0100
+++ roundcubemail-0.1beta/ext/change_password_function.inc 2006-05-21 05:19:43.000000000 +0200
@@ -0,0 +1,74 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/settings/change_password.inc |
+ | |
+ | This file is part of the RoundCube Webmail client |
+ | Copyright (C) 2005, RoundCube Dev. - Switzerland |
+ | Licensed under the GNU GPL |
+ | |
+ | PURPOSE: |
+ | Show edit form for a identity record or to add a new one |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Nicolas Van Eenaeme <nicolas@poison.be> |
+ +-----------------------------------------------------------------------+
+
+ $Id: edit_identity.inc,v 1.1 2006/05/21 05:19:43 roundcube Exp $
+
+*/
+
+ // The host of the database
+ define ('RCUBE_EXT_CHANGE_PASS_HOST', 'localhost');
+
+ // The username to connect to the database
+ define ('RCUBE_EXT_CHANGE_PASS_USER', 'postfix');
+
+ // The password to connect to the database
+ define ('RCUBE_EXT_CHANGE_PASS_PASS', 'password');
+
+ // The name of the database
+ define ('RCUBE_EXT_CHANGE_PASS_NAME', 'postfix');
+
+ // The update query. You can use '%clear%' for the clear password,
+ // '%md5%' for the md5 encrypted password,
+ // '%user%' for the username,
+ // '%old%' for the old password and
+ // '%oldmd5%' for the old md5 encrypted password.
+ define ('RCUBE_EXT_CHANGE_PASS_UPDATEQUERY', 'UPDATE mailbox SET password = "%md5%" WHERE username = "%user%" AND password = "%oldmd5%"');
+
+ // The select query (needed to verify the md5.
+ define ('RCUBE_EXT_CHANGE_PASS_SELECTQUERY', 'SELECT password FROM mailbox WHERE username = "%user%"');
+
+
+ function change_password_function ($user, $currentpass, $newpass)
+ {
+ $dbh =& mysql_connect (RCUBE_EXT_CHANGE_PASS_HOST, RCUBE_EXT_CHANGE_PASS_USER, RCUBE_EXT_CHANGE_PASS_PASS);
+ if (!is_resource ($dbh))
+ return FALSE;
+
+ if (!mysql_select_db (RCUBE_EXT_CHANGE_PASS_NAME, $dbh))
+ return FALSE;
+
+ $q = str_replace ('%user%', $user, RCUBE_EXT_CHANGE_PASS_SELECTQUERY);
+ $dbr =& mysql_query ($q, $dbh);
+ if (!is_resource ($dbr))
+ return FALSE;
+
+ $data = mysql_fetch_row ($dbr);
+ mysql_free_result ($dbr);
+
+ $newpassmd5 = crypt ($newpass, $data[0]);
+ $currentpassmd5 = crypt ($currentpass, $data[0]);
+ $q = str_replace (array ('%user%', '%clear%', '%md5%', '%old%', '%oldmd5%'), array ($user, $newpass, $newpassmd5, $currentpass, $currentpassmd5), RCUBE_EXT_CHANGE_PASS_UPDATEQUERY);
+
+ $dbr =& mysql_query ($q, $dbh);
+ if (!$dbr || mysql_affected_rows ($dbh) != 1)
+ return FALSE;
+
+ mysql_close ($dbh);
+ return TRUE;
+ }
+
+?>
diff -ruN roundcubemail-0.1beta.orig/index.php roundcubemail-0.1beta/index.php
--- roundcubemail-0.1beta.orig/index.php 2006-02-21 00:29:13.000000000 +0100
+++ roundcubemail-0.1beta/index.php 2006-05-21 03:46:20.000000000 +0200
@@ -330,6 +330,8 @@
if ($_action=='folders' || $_action=='subscribe' || $_action=='unsubscribe' || $_action=='create-folder' || $_action=='delete-folder')
include('program/steps/settings/manage_folders.inc');

+ if ($_action=='password' || $_action=='change-password')
+ include('program/steps/settings/change_password.inc');
}


--- roundcubemail-0.1beta.orig/program/include/main.inc 2006-02-21 00:29:13.000000000 +0100
+++ roundcubemail-0.1beta/program/include/main.inc 2006-05-20 02:04:38.000000000 +0200
@@ -1072,7 +1072,8 @@
'identityform' => 'rcube_identity_form',
'foldersubscription' => 'rcube_subscription_form',
'createfolder' => 'rcube_create_folder_form',
- 'composebody' => 'rcmail_compose_body'
+ 'composebody' => 'rcmail_compose_body',
+ 'changepassform' => 'rcmail_change_pass_form'
);


diff -ruN roundcubemail-0.1beta.orig/program/js/app.js roundcubemail-0.1beta/program/js/app.js
--- roundcubemail-0.1beta.orig/program/js/app.js 2006-02-19 21:21:58.000000000 +0100
+++ roundcubemail-0.1beta/program/js/app.js 2006-05-21 15:37:23.000000000 +0200
@@ -194,7 +194,7 @@


case 'settings':
- this.enable_command('preferences', 'identities', 'save', 'folders', true);
+ this.enable_command('preferences', 'identities', 'save', 'folders', 'password', true);

if (this.env.action=='identities' || this.env.action=='edit-identity' || this.env.action=='add-identity')
this.enable_command('edit', 'add', 'delete', true);
@@ -205,6 +205,9 @@
if (this.env.action=='folders')
this.enable_command('subscribe', 'unsubscribe', 'create-folder', 'delete-folder', true);

+ if (this.env.action=='password')
+ this.enable_command('change-password', true);
+
var identities_list = this.gui_objects.identitieslist;
if (identities_list)
this.init_identitieslist(identities_list);
@@ -946,6 +949,41 @@
this.delete_folder(props);
break;

+ case 'password':
+ location.href = this.env.comm_path+'&_action=password';
+ break;
+
+ case 'change-password':
+ if (this.gui_objects.editform)
+ {
+ var input_currentpass = rcube_find_object('_currentpass');
+ var input_newpass = rcube_find_object('_newpass');
+ var input_confirmpass = rcube_find_object('_confirmpass');
+
+ if (input_currentpass.value == "")
+ {
+ alert(this.get_label('nocurrentpasswarning'));
+ input_currentpass.focus();
+ break;
+ }
+
+ if (input_newpass.value == "")
+ {
+ alert(this.get_label('nonewpasswarning'));
+ input_newpass.focus();
+ break;
+ }
+
+ if (input_newpass.value != input_confirmpass.value)
+ {
+ alert(this.get_label('nomatchpasswarning'));
+ input_confirmpass.focus();
+ break;
+ }
+
+ this.gui_objects.editform.submit();
+ }
+ break;
}

return obj ? false : true;
diff -ruN roundcubemail-0.1beta.orig/program/localization/en_US/labels.inc roundcubemail-0.1beta/program/localization/en_US/labels.inc
--- roundcubemail-0.1beta.orig/program/localization/en_US/labels.inc 2006-02-04 19:05:36.000000000 +0100
+++ roundcubemail-0.1beta/program/localization/en_US/labels.inc 2006-05-21 03:53:49.000000000 +0200
@@ -179,6 +179,12 @@
$labels['newitem'] = 'New item';
$labels['edititem'] = 'Edit item';

+$labels['changepassword'] = 'Change your password';
+
+$labels['currentpass'] = 'Current password';
+$labels['newpass'] = 'New password';
+$labels['confirmpass'] = 'Confirm new password';
+
$labels['setdefault'] = 'Set default';
$labels['language'] = 'Language';
$labels['timezone'] = 'Time zone';
diff -ruN roundcubemail-0.1beta.orig/program/localization/en_US/messages.inc roundcubemail-0.1beta/program/localization/en_US/messages.inc
--- roundcubemail-0.1beta.orig/program/localization/en_US/messages.inc 2006-01-25 21:10:12.000000000 +0100
+++ roundcubemail-0.1beta/program/localization/en_US/messages.inc 2006-05-21 14:46:15.000000000 +0200
@@ -88,4 +88,12 @@

$messages['nosearchname'] = 'Please enter a contact name or email address';

+$messages['nocurrentpasswarning'] = 'Please enter your current password';
+
+$messages['nonewpasswarning'] = 'Please enter your new password';
+
+$messages['nomatchpasswarning'] = 'The new password and it\'s confirmation doesn\'t match';
+
+$messages['invalidpassword'] = 'Your current password is invalid';
+
?>
diff -ruN roundcubemail-0.1beta.orig/program/steps/settings/change_password.inc roundcubemail-0.1beta/program/steps/settings/change_password.inc
--- roundcubemail-0.1beta.orig/program/steps/settings/change_password.inc 1970-01-01 01:00:00.000000000 +0100
+++ roundcubemail-0.1beta/program/steps/settings/change_password.inc 2006-05-21 14:46:33.000000000 +0200
@@ -0,0 +1,103 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | program/steps/settings/change_password.inc |
+ | |
+ | This file is part of the RoundCube Webmail client |
+ | Copyright (C) 2005, RoundCube Dev. - Switzerland |
+ | Licensed under the GNU GPL |
+ | |
+ | PURPOSE: |
+ | Change the current password into a new one |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Nicolas Van Eenaeme <nicolas@poison.be> |
+ +-----------------------------------------------------------------------+
+
+ $Id: edit_identity.inc,v 1.1 2006/05/21 14:46:33 roundcube Exp $
+
+*/
+
+// init IAMP connection
+rcmail_imap_init(TRUE);
+
+if ($_POST['_action'] == 'change-password')
+ {
+ include ('ext/change_password_function.inc');
+ if ($_SESSION['password'] != encrypt_passwd($_POST['_currentpass']))
+ {
+ show_message('invalidpassword', 'error');
+ }
+ elseif (false || change_password_function ($_SESSION['username'], $_POST['_currentpass'], $_POST['_newpass']))
+ {
+ $IMAP->pass = $_POST['_newpass'];
+ $IMAP->reconnect ();
+ $_SESSION['password'] = encrypt_passwd($_POST['_newpass']);
+
+ show_message('successfullysaved', 'confirmation');
+ }
+ else
+ show_message('errorsaving', 'error');
+
+ // go to next step
+ $_action = 'password';
+
+ // overwrite action variable
+ $OUTPUT->add_script(sprintf("\n%s.set_env('action', '%s');", $JS_OBJECT_NAME, $_action));
+ }
+
+ $PAGE_TITLE = rcube_label('changepassword');
+
+
+function rcmail_change_pass_form($attrib)
+ {
+ global $IDENTITY_RECORD, $JS_OBJECT_NAME;
+
+ // add some labels to client
+ rcube_add_label('nocurrentpasswarning');
+ rcube_add_label('nonewpasswarning');
+ rcube_add_label('nomatchpasswarning');
+
+ list($form_start, $form_end) = get_form_tags($attrib, 'change-password');
+ unset($attrib['form']);
+
+
+ // return the complete edit form as table
+ $out = "$form_start<table>\n\n";
+
+ // show the current password field
+ $field_id = 'rcmfd_currentpass';
+ $input_currentpass = new passwordfield(array('name' => '_currentpass', 'id' => $field_id, 'size' => 20));
+
+ $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+ $field_id,
+ rep_specialchars_output(rcube_label('currentpass') ),
+ $input_currentpass->show());
+
+ // show the new password field
+ $field_id = 'rcmfd_newpass';
+ $input_newpass = new passwordfield(array('name' => '_newpass', 'id' => $field_id, 'size' => 20));
+
+ $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+ $field_id,
+ rep_specialchars_output(rcube_label('newpass')),
+ $input_newpass->show());
+
+ // show the confirm password field
+ $field_id = 'rcmfd_confirmpass';
+ $input_confirmpass = new passwordfield(array('name' => '_confirmpass', 'id' => $field_id, 'size' => 20));
+
+ $out .= sprintf("<tr><td class=\"title\"><label for=\"%s\">%s</label></td><td>%s</td></tr>\n",
+ $field_id,
+ rep_specialchars_output(rcube_label('confirmpass') ),
+ $input_confirmpass->show());
+
+ $out .= "\n</table>$form_end";
+
+ return $out;
+ }
+
+
+ parse_template('changepassword');
+?>
\ No newline at end of file
diff -ruN roundcubemail-0.1beta.orig/skins/default/includes/settingstabs.html roundcubemail-0.1beta/skins/default/includes/settingstabs.html
--- roundcubemail-0.1beta.orig/skins/default/includes/settingstabs.html 2005-09-25 16:18:58.000000000 +0200
+++ roundcubemail-0.1beta/skins/default/includes/settingstabs.html 2006-05-17 20:12:34.000000000 +0200
@@ -1,3 +1,4 @@
<div id="tabsbar">
<span id="settingstabdefault" class="tablink"><roundcube:button command="preferences" type="link" label="preferences" title="editpreferences" /></span><span id="settingstabfolders" class="tablink"><roundcube:button command="folders" type="link" label="folders" title="managefolders" class="tablink" /></span><span id="settingstabidentities" class="tablink"><roundcube:button command="identities" type="link" label="identities" title="manageidentities" class="tablink" /></span>
+<span id="settingstabpassword" class="tablink"><roundcube:button command="password" type="link" label="password" title="changepassword" class="tablink" /></span>
</div>
diff -ruN roundcubemail-0.1beta.orig/skins/default/templates/changepassword.html roundcubemail-0.1beta/skins/default/templates/changepassword.html
--- roundcubemail-0.1beta.orig/skins/default/templates/changepassword.html 1970-01-01 01:00:00.000000000 +0100
+++ roundcubemail-0.1beta/skins/default/templates/changepassword.html 2006-05-21 03:33:05.000000000 +0200
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtm...sitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title><roundcubebject name="pagetitle" /></title>
+<roundcube:include file="/includes/links.html" />
+<link rel="stylesheet" type="text/css" href="/settings.css" />
+</head>
+<body>
+
+<roundcube:include file="/includes/taskbar.html" />
+<roundcube:include file="/includes/header.html" />
+<roundcube:include file="/includes/settingstabs.html" />
+
+<div id="userprefs-box">
+<div id="userprefs-title"><roundcube:label name="changepassword" /></div>
+
+<div style="padding:15px">
+<roundcubebject name="changepassform">
+
+<p><br /><roundcube:button command="change-password" type="input" class="button" label="save" /></p>
+</div>
+</div>
+
+<roundcube:include file="/includes/settingscripts.html" />
+
+</body>
+</html>

what i have to do next??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 08-15-2006, 01:43 AM
ric ric is offline
Registered User
 
Join Date: Aug 2006
Posts: 6
Downloads: 0
Uploads: 0
Default Re: RoundCube Webmail 0.1-beta changepassword patch

Installed this patch with beta2, works well.

Quote:
123123,
what i have to do next??
123123, you can either using a patching program to apply the patch or edit the files by hand, what mailserver are you using?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 08-15-2006, 08:33 AM
Registered User
 
Join Date: Aug 2006
Posts: 13
Downloads: 0
Uploads: 0
Default Re: RoundCube Webmail 0.1-beta changepassword patch

i have no idea what program to use. i use cpanel. maybe someone have seperate files of this plugin and know what changes must be done in other files?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 08-16-2006, 06:00 PM
Registered User
 
Join Date: Aug 2006
Posts: 12
Downloads: 0
Uploads: 0
Default Re: Little change in change_password_function.inc to work with vpopmail (mysql)

Quote:
Originally Posted by Hunteru
I made a few changes in the original file to work with vpopmail (mysql).

Code:
<?php

/*
 +-----------------------------------------------------------------------+
 | program/steps/settings/change_password.inc              |
 |                                   |
 | This file is part of the RoundCube Webmail client          |
 | Copyright (C) 2005, RoundCube Dev. - Switzerland           |
 | Licensed under the GNU GPL                      |
 |                                   |
 | PURPOSE:                               |
 | Show edit form for a identity record or to add a new one      |
 |                                   |
 +-----------------------------------------------------------------------+
 | Author: Nicolas Van Eenaeme <nicolas@poison.be>           |
 +-----------------------------------------------------------------------+

 $Id: edit_identity.inc,v 1.1 2006/05/21 05:19:43 roundcube Exp $

*/

 // The host of the database
 define ('RCUBE_EXT_CHANGE_PASS_HOST', 'localhost');

 // The username to connect to the database
 define ('RCUBE_EXT_CHANGE_PASS_USER', 'user');

 // The password to connect to the database
 define ('RCUBE_EXT_CHANGE_PASS_PASS', 'password');

 // The name of the database
 define ('RCUBE_EXT_CHANGE_PASS_NAME', 'vpopmail');

 // The update query. You can use '%clear%' for the clear password,
 //               '%md5%'  for the md5 encrypted password,
 //               '%user%' for the username,
 //               '%old%'  for the old password and
 //               '%oldmd5%' for the old md5 encrypted password.
 define ('RCUBE_EXT_CHANGE_PASS_UPDATEQUERY', 'UPDATE vpopmail SET pw_clear_passwd = "%clear%", pw_passwd = "%md5%" WHERE pw_name = "%user%" AND pw_passwd = "%oldmd5%" AND pw_domain = "%domain%"');

 // The select query (needed to verify the md5.
 define ('RCUBE_EXT_CHANGE_PASS_SELECTQUERY', 'SELECT pw_passwd FROM vpopmail WHERE pw_name = "%user%" AND pw_domain = "%domain%"');

 function split_user ($user)
  {
   list($s_user, $s_domain) = split('[@]', $user);
   return array($s_user,$s_domain);
  }

 function change_password_function ($s_user, $currentpass, $newpass)
  {
	list ($user, $domain) = split_user ($s_user);

  $dbh =& mysql_connect (RCUBE_EXT_CHANGE_PASS_HOST, RCUBE_EXT_CHANGE_PASS_USER, RCUBE_EXT_CHANGE_PASS_PASS);
  if (!is_resource ($dbh))
   return FALSE;

  if (!mysql_select_db (RCUBE_EXT_CHANGE_PASS_NAME, $dbh))
   return FALSE;

  $q = str_replace (array ('%user%', '%domain%'), array ($user, $domain), RCUBE_EXT_CHANGE_PASS_SELECTQUERY);
 
 $dbr =& mysql_query ($q, $dbh);
  if (!is_resource ($dbr))
   return FALSE;

  $data = mysql_fetch_row ($dbr);
  mysql_free_result ($dbr);

  $newpassmd5 = crypt ($newpass, $data[0]);
  $currentpassmd5 = crypt ($currentpass, $data[0]);
  $q = str_replace (array ('%user%', '%domain%', '%clear%', '%md5%', '%old%', '%oldmd5%'), array ($user, $domain, $newpass, $newpassmd5, $currentpass, $currentpassmd5), RCUBE_EXT_CHANGE_PASS_UPDATEQUERY);

  $dbr =& mysql_query ($q, $dbh);
  if (!$dbr || mysql_affected_rows ($dbh) != 1)
    return FALSE;

  mysql_close ($dbh);
  return TRUE;
  }

?>
Thx for the original tool.
Thanks you so mush for your PATCH, that work fine for me with the beta2.
But just one problem found:
when i have applied the patch, i found one error in the result with the file program/include/main.inc.rej

Code:
***************
*** 1072,1078 ****
     'identityform' => 'rcube_identity_form',
     'foldersubscription' => 'rcube_subscription_form',
     'createfolder' => 'rcube_create_folder_form',
-     'composebody' => 'rcmail_compose_body'
    );


--- 1072,1079 ----
     'identityform' => 'rcube_identity_form',
     'foldersubscription' => 'rcube_subscription_form',
     'createfolder' => 'rcube_create_folder_form',
+     'composebody' => 'rcmail_compose_body',
+     'changepassform' => 'rcmail_change_pass_form'
    );
So, i have edited the main.inc and i have added
Code:
'changepassform' => 'rcmail_change_pass_form'
at the line 1236 (// USER SETTINGS) like this:
Code:
    // USER SETTINGS
    'userprefs' => 'rcmail_user_prefs_form',
    'itentitieslist' => 'rcmail_identities_list',
    'identityframe' => 'rcmail_identity_frame',
    'identityform' => 'rcube_identity_form',
    'foldersubscription' => 'rcube_subscription_form',
    'createfolder' => 'rcube_create_folder_form',
    'renamefolder' => 'rcube_rename_folder_form',
    'composebody' => 'rcmail_compose_body',
    'changepassform' => 'rcmail_change_pass_form'
And now, that work.

Thanks you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 08-16-2006, 06:04 PM
Registered User
 
Join Date: Aug 2006
Posts: 13
Downloads: 0
Uploads: 0
Default Re: RoundCube Webmail 0.1-beta changepassword patch

how to apply the patch? HELP please
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 07:45 PM.


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