diff -urN -x germany32 -x '*.rej' -x '*.orig' /scrloc/lipp/geo/geograph_web.7d/local/libs/geograph/user.class.php /scrloc/lipp/geo/geograph_web.7d.new/local/libs/geograph/user.class.php --- /scrloc/lipp/geo/geograph_web.7d/local/libs/geograph/user.class.php 2008-10-15 13:08:46.000000000 +0200 +++ /scrloc/lipp/geo/geograph_web.7d.new/local/libs/geograph/user.class.php 2008-10-15 13:08:47.000000000 +0200 @@ -692,6 +692,10 @@ $profile['nickname']=stripslashes($profile['nickname']); $profile['website']=stripslashes($profile['website']); + $profile['oldpassword']=stripslashes($profile['oldpassword']); + $profile['password1']=stripslashes($profile['password1']); + $profile['password2']=stripslashes($profile['password2']); + // valid homesquare? $profile['grid_reference']=stripslashes($profile['grid_reference']); $gridreference=''; @@ -759,6 +763,20 @@ $errors['nickname']='Please enter a nickname for use on the forums'; } + if (strlen($profile['password1'])) { + if (md5($profile['oldpassword']) != $this->password) { + $ok=false; + $errors['oldpassword']='Please enter your current password for changing it'; + } elseif ($profile['password1'] != $profile['password2']) { + $ok=false; + $errors['password2']='Passwords didn\'t match, please try again'; + } else { + $password = md5($profile['password1']); + } + } else { + $password = $this->password; + } + //attempting to change email address? if ($profile['email']!=$this->email) { @@ -832,7 +850,8 @@ home_gridsquare=%s, ticket_public=%s, ticket_option=%s, - message_sig=%s + message_sig=%s, + password=%s where user_id=%d", $db->Quote($profile['realname']), $db->Quote($profile['nickname']), @@ -848,6 +867,7 @@ $db->Quote($profile['ticket_public']), $db->Quote($profile['ticket_option']), $db->Quote(stripslashes($profile['message_sig'])), + $db->Quote($password), $this->user_id ); @@ -870,6 +890,7 @@ $this->realname=$profile['realname']; $this->nickname=$profile['nickname']; + $this->password=$password; $this->website=$profile['website']; $this->public_email=isset($profile['public_email'])?1:0; if (isset($profile['sortBy'])) @@ -885,6 +906,7 @@ $this->ticket_option=stripslashes($profile['ticket_option']); $this->message_sig=stripslashes($profile['message_sig']); $this->_forumUpdateProfile(); + $this->_forumLogin(); if (!empty($profile['ticket_public_change'])) { diff -urN -x germany32 -x '*.rej' -x '*.orig' /scrloc/lipp/geo/geograph_web.7d/local/public_html/profile.php /scrloc/lipp/geo/geograph_web.7d.new/local/public_html/profile.php --- /scrloc/lipp/geo/geograph_web.7d/local/public_html/profile.php 2008-09-01 19:15:38.000000000 +0200 +++ /scrloc/lipp/geo/geograph_web.7d.new/local/public_html/profile.php 2008-10-15 13:08:47.000000000 +0200 @@ -74,6 +74,9 @@ else { $profile=new GeographUser($USER->user_id); + $profile->oldpassword=''; + $profile->password1=''; + $profile->password2=''; } $smarty->assign('pagesizes', array(5,10,15,20,30,50)); $smarty->assign('delays', array(2,3,4,5,6,10,12)); diff -urN -x germany32 -x '*.rej' -x '*.orig' /scrloc/lipp/geo/geograph_web.7d/local/public_html/templates/basic/profile_edit.tpl /scrloc/lipp/geo/geograph_web.7d.new/local/public_html/templates/basic/profile_edit.tpl --- /scrloc/lipp/geo/geograph_web.7d/local/public_html/templates/basic/profile_edit.tpl 2008-08-15 11:10:48.000000000 +0200 +++ /scrloc/lipp/geo/geograph_web.7d.new/local/public_html/templates/basic/profile_edit.tpl 2008-10-15 13:08:47.000000000 +0200 @@ -92,6 +92,32 @@
+Password +
+ {if $errors.oldpassword}

{$errors.oldpassword}

{/if} + + +
Your old password is needed for changing your password.
+ {if $errors.oldpassword}
{/if} +
+
+ {if $errors.password1}

{$errors.password1}

{/if} + + +
Enter your new password here. Leave empty if you want to keep your old password.
+ {if $errors.password1}
{/if} +
+
+ {if $errors.password2}

{$errors.password2}

{/if} + + +
Enter your new password here in order to avoid spelling errors.
+ {if $errors.password2}
{/if} +
+ +
+ +
More about you