I played a little bit with the admin panel and I found useful for the users to have the possibility to change the password by themselves.
This is my code:
[changepass]
{.if | %user% |
<html>
<head>
<title>Pass Changer</title>
</head>
<body>
<b><font size="4"> Welcome %user% ! </b>
<p>
<br><font size="4"> Then type the new password and click on Change. Leave it blanck to remove the password.
<p>
<form method=post action="/~userpasschange">
<table>
<tr><td align=left><b><font size="4"><font size="4">New Password</font></b></font></b><td><b><font size="4">: </font></b><span style="background-color: #000000"><input name=pass type=password style="font-size:10pt; font-weight:bold; border:1px solid #88f" size="20" ></span>
<tr><td align=left><font size="4">Click <a href="/">here</a> to return to HOME.</font><td align=center><input type=submit value="Change">
</tr></table>
</form>
</body>
</html>
|{.section|usererror.}.}
[userpasschange]
{.if | %user% |
<html>
<head>
<title>Pass Changer</title>
</head>
<body>
{.set account|%user%|password={.postvar|pass.}.}
<p><font size="4">Password changed!</font></p>
<p>Click <a href="/">here</a> to return to HOME.</p>
</body>
</html>
|{.section|usererror.}.}
[usererror]
<html>
<head>
<title>Error</title>
</head>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><font size="6"><b>You must login before chaning the password.</b></font></p>
<p align="center"> </p>
<p align="center"> </p>
<p>Click <a href="/">here</a> to return to HOME.</p>
</body>
</html>
To have the menu entry, you have to modify the current template and add the second line in the following peace of code:
{.if not| %user% | <li><a href="~login"><img src="/~img27"> Login</a></li> .}
{.if | %user% | <li><a href="/~changepass"> Change password</a></li> .}
{.if| {.get|can upload.} | <li><a href="~upload"><img src="/~img32"> Upload</a></li> .}
{.if| {.and | {.get|can archive.} | {.not|{.?search.}.} .}
Open: I think it is a good idea to ask the user twice for the new password and check if the two entry match; if not the user shall be prompt for the new password again.
« Last Edit: January 27, 2009, 05:17:20 PM by luca69 »
Life is what happens to you while you are busy making other plans