rejetto forum

Change the user password

Gio · 12 · 4926

0 Members and 1 Guest are viewing this topic.

Offline Gio

  • Occasional poster
  • *
    • Posts: 24
    • View Profile
Hello, I'm looking for a ready made template (better if based on RAWR-template) with the possibility to change the user password. I don't need admin panel, but just the possibility for the users to setup the passwords on their own.
It need also to give the possibility to delete the files uploaded. I'm actually doing some test using the latest beta 2.3 build 253 with IE on a intranet
Any suggestion?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13310
    • View Profile
you can start from this example to get something decent.

this is the form to be placed on the page
Code: [Select]
<form method=post action="/~selfpasschange>
{.!New Password.} <input type="password" name="newpass"> <input type=submit value="{.!Change.}">
</form>
this is a section to append to the template
Code: [Select]
[selfpasschange]
{.if|%user%|
  {:{.set account|%user%|password={.postvar|newpass.}.}:}
/if.}


Offline Gio

  • Occasional poster
  • *
    • Posts: 24
    • View Profile
Hi,
sorry, but I don't know exactly how to proceed. I'm using the RAWR-template 0.1.2. I suppose that I've to add this code at the end of the template:
 
Code:
[selfpasschange]
{.if|%user%|
  {:{.set account|%user%|password={.postvar|newpass.}.}:}
/if.}

Where I've to place the following code?

Code:
<form method=post action="/~selfpasschange>
{.!New Password.} <input type="password" name="newpass"> <input type=submit value="{.!Change.}">
</form>

Thank you for the support.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13310
    • View Profile
you are right.
i'll be more detailed
put this at the end of the template

Code: [Select]
[selfpasschange]
{.if|%user%|
  {:{.set account|%user%|password={.postvar|newpass.}.} Ok!:}
/if.}

you see, i added an "Ok!"

and put this
Code: [Select]
{.if|%user%|
<div class="module">
<div class="modHeading">
{.!New Password.}
</div>
<div class="modContent">
<form method=post action="/~selfpasschange">
<input type="password" name="newpass"> <input type=submit value="{.!Change.}">
</form>
</div>
</div>
.}

exactly before this line:
{.if|{.{.!mod_folder_tasks.}=on.}|


Offline Gio

  • Occasional poster
  • *
    • Posts: 24
    • View Profile
It works fine; I post the template with the changes.
Thank you very much for the support.


Offline Gio

  • Occasional poster
  • *
    • Posts: 24
    • View Profile
Hi rejetto,
today I cannot change my password; I don't know why....
After the login, I've enter a new password, the new windows doesn't say "OK" and the password is not changed. During friday, I've not changed the template, but I've just added folders and user rights.
Do you have any suggestion?
Thank you in advance for your reply.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13310
    • View Profile
1. the old password is still working?
2. did you try from other computers?
3. did you try to restore the working template you posted on the forum?

otherwise
- menu > debug > enable macros.log
- try to change the password
- post your macros.log file here


Offline Gio

  • Occasional poster
  • *
    • Posts: 24
    • View Profile
1. Yes, the old password is working. The account is without password
2. Yes, but the result is the same. The problem was detected by one user.
3. Yes, Ive compared the 2 templates and seems to be identical.

It's very strange, because before posting the template, the password change was working properly; I've tested successfully more several times.
I don't know if could help: I'm running more than one instance of HFS with different SW version. But also, switching off the other instances, the problem is present.
I send you the macro.log.
Thank you for the support.
« Last Edit: February 16, 2010, 04:45:53 PM by rejetto »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13310
    • View Profile
i downloaded your log, and removed it from the forum because of possible information leaking, i didn't think of.
next time we should remember to do it via email. ;)

anyway, it was useful, because i saw this
Quote
   > %user%
   <

   > if||
  {:{.set account||password={.postvar|newpass.}.} Ok!:}
/if
   <

it means the request is made without specifying the user. But it's the browser that should specify it.
so, it's like you are not logged in, at least for that request.


Offline Gio

  • Occasional poster
  • *
    • Posts: 24
    • View Profile
It's possible to change the password only after the login... I mean that the windows "New password" is shown only after the login (and I see it). I attach some snapshots for a better understanding.
I agree that is something related to the web browser: do you have some suggestions?
Thank you.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13310
    • View Profile
ok, i think i got the problem.
replace this:
/~selfpasschange

with this:
?mode=section&id=selfpasschange


reason:
they are the same for HFS, but not for the browser, because it considers the address to be referring to the home/root (because of the initial slash) where you were not logged in. So, it decides it's not necessary to send the password.


Offline Gio

  • Occasional poster
  • *
    • Posts: 24
    • View Profile
Ok, it works. I attach the template.
Thank you.