Update of /cvsroot/easymod/easymod2/mods/easymod/includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7470/mods/easymod/includes
Modified Files:
admin_easymod.php.txt mod_settings.tpl
Log Message:
Fixed issues updating the EM/FTP passwords.
Index: admin_easymod.php.txt
===================================================================
RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/admin_easymod.php.txt,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** admin_easymod.php.txt 4 Nov 2005 21:59:42 -0000 1.35
--- admin_easymod.php.txt 5 Nov 2005 00:30:52 -0000 1.36
***************
*** 659,666 ****
$password = ( !empty($HTTP_POST_VARS['password']) ) ? stripslashes($HTTP_POST_VARS['password']) : '';
- if( isset($HTTP_POST_VARS['login']) )
- {
- $password = md5($password);
- }
$install_file = ( !empty($HTTP_POST_VARS['install_file']) ) ? stripslashes(trim($HTTP_POST_VARS['install_file'])) : '';
$install_path = ( !empty($HTTP_POST_VARS['install_path']) ) ? stripslashes(trim($HTTP_POST_VARS['install_path'])) : '';
--- 659,662 ----
***************
*** 693,697 ****
{
// compare passwords and send them back to the password screen if they fail
! if ($password !== get_em_pw())
{
$get_password = true;
--- 689,693 ----
{
// compare passwords and send them back to the password screen if they fail
! if (md5($password) !== get_em_pw())
{
$get_password = true;
***************
*** 970,978 ****
// update the password; starting with 0.0.11 store as MD5 hash
em_db_update('EM_password', md5($em_pass));
! $pass_msg = ($em_pass == '') ? $lang['EM_pass_disabled'] : $lang['EM_pass_updated'];
$force_ftp_pass = true;
}
// the confirm is empty so they are not trying to update the pw, so don't
! else if ($em_pass_confirm == '')
{
$pass_msg = $lang['EM_pass_not_updated'];
--- 966,974 ----
// update the password; starting with 0.0.11 store as MD5 hash
em_db_update('EM_password', md5($em_pass));
! $pass_msg = (empty($em_pass)) ? $lang['EM_pass_disabled'] : $lang['EM_pass_updated'];
$force_ftp_pass = true;
}
// the confirm is empty so they are not trying to update the pw, so don't
! else if (empty($em_pass_confirm))
{
$pass_msg = $lang['EM_pass_not_updated'];
***************
*** 991,1000 ****
em_db_update('EM_ftp_dir', str_replace("'", "''", $ftp_dir));
em_db_update('EM_ftp_user', str_replace("'", "''", $ftp_user));
!
if ( $force_ftp_pass || !empty($ftp_pass) )
{
em_db_update('EM_ftp_pass', str_replace("'", "''", crypt_ftp_pass(EM_ENCRYPT, $ftp_pass, $em_pass)));
}
!
em_db_update('EM_ftp_host', str_replace("'", "''", $ftp_host));
em_db_update('EM_ftp_port', $ftp_port);
--- 987,1002 ----
em_db_update('EM_ftp_dir', str_replace("'", "''", $ftp_dir));
em_db_update('EM_ftp_user', str_replace("'", "''", $ftp_user));
!
if ( $force_ftp_pass || !empty($ftp_pass) )
{
+ // If they are updating the EM password, but they haven't supplied the FTP password, then
+ // we need the old EM password to decrypt the FTP password so it can be encrypted again
+ if( empty($ftp_pass) )
+ {
+ $ftp_pass = crypt_ftp_pass(EM_DECRYPT, $board_config['EM_ftp_pass'], $password);
+ }
em_db_update('EM_ftp_pass', str_replace("'", "''", crypt_ftp_pass(EM_ENCRYPT, $ftp_pass, $em_pass)));
}
!
em_db_update('EM_ftp_host', str_replace("'", "''", $ftp_host));
em_db_update('EM_ftp_port', $ftp_port);
Index: mod_settings.tpl
===================================================================
RCS file: /cvsroot/easymod/easymod2/mods/easymod/includes/mod_settings.tpl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** mod_settings.tpl 3 Jun 2005 22:59:12 -0000 1.4
--- mod_settings.tpl 5 Nov 2005 00:30:52 -0000 1.5
***************
*** 92,95 ****
--- 92,96 ----
<td class="catbottom" align="center" colspan="2">
<input type="hidden" name="mode" value="{MODE}" />
+ <input type="hidden" name="password" value="{EM_PASS}" />
<input class="mainoption" type="submit" value="{L_SUBMIT}" />
</td>
|