Martin,

I am really grateful for this.

To summarise (making sure I understand this)

With encrypted passwords we need two files:

config/config.php and pages/action.password

config.php is:
<?php if (!defined('BOLTWIRE')) exit();

function BOLTXencrypt($value, $field) {
global $cryptkey;
return crypt($value, $cryptkey);
}

if ($pageLink == 'action=password') {
function BOLTXencrypt($value, $field) {
global $cryptkey;
return crypt($value, $cryptkey);
}
}

action.password is:

!Change Password

[form]
[t]
[r][c top]Current Password [c][password passnow]
[r][c]New Password [c][password password]
[r][c]Again [c][password password2]
[t]
[submit]
[command encrypt_1 {=passnow}]
[command if_1 "! equal {~password} {=encrypt_1} ? warn='Current password 
{~password}={=encrypt_1} is not correct. Try again!'"]

[command if_2 "! equal {=password} {=password2} ? warn='New passwords do 
not match. Try again!'"]
[command warn]
[command encrypt_2 {=password}]

[command reset password={=encrypt_2}]

[command savedata password page=member.{id}]
[form]

And that's it.  To call it add, for instance,

[[{p}&action=password|change password]]

to the {actions} in code.settings. 

For Unencrypted passwords, there is no need for the config.php file, and 
the action.password file should read:

!Change Password


[form]
[t]
[r][c top]Current Password [c][password passnow]
[r][c]New Password [c][password password]
[r][c]Again [c][password password2]
[t]
[submit]
[command if_1 "! equal {~password} {=passnow} ? warn='Current password 
{~password}={=passnow} is not correct. Try again!'"]
[command if_2 "! equal {=password} {=password2} ? warn='New passwords do 
not match. Try again!'"]
[command warn]
[command reset password={=password}]
[command savedata password page=member.{id}]
[form]

But I'm sure it's possible to write a function that handles both cases.

TOF.


On Thursday, 26 June 2014 16:57:06 UTC+1, mz wrote:
>
> ha, missed one "crypt"  ...
>  
>
>> !Change Password
>>
>>
>> [form]
>> [t]
>> [r][c top]Current Password [c][password passnow]
>> [r][c]New Password [c][password password]
>> [r][c]Again [c][password password2]
>> [t]
>> [submit]
>> [command encrypt_1 {=passnow}]
>> [command if_1 "! equal {~password} {=encrypt_1} ? warn='Current password 
>> {~password}={=encrypt_1} is not correct. Try again!'"]
>>
>> [command if_2 "! equal {=password} {=password2} ? warn='New passwords do 
>> not match. Try again!'"]
>> [command warn]
>> [command encrypt_2 {=password}]
>> [command reset password={=encrypt_2}]
>>
>> [command savedata password page=member.{id}]
>> [form]
>>
>>
>>> Greetings, Martin
>>>
>>>
>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/d/optout.

Reply via email to