Use form funcs in cpw plugin
[squirrelmail.git] / plugins / change_password / options.php
CommitLineData
27663afe 1<?php
2
087508d9 3/**
4 * options.php - Change Password HTML page
5 *
6 * Copyright (c) 2004 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * $Id$
10 * @package plugins
11 * @subpackage change_password
12 */
13
27663afe 14define('SM_PATH','../../');
15
b11b4108 16require_once (SM_PATH . 'include/validate.php');
17require_once (SM_PATH . 'functions/page_header.php');
18require_once (SM_PATH . 'plugins/change_password/functions.php');
19require_once (SM_PATH . 'plugins/change_password/config.php');
20require_once (SM_PATH . 'functions/forms.php');
27663afe 21
22/* the form was submitted, go for it */
23if(sqgetGlobalVar('cpw_go', $cpw_go, SQ_POST)) {
087508d9 24
27663afe 25 /* perform basic checks */
26 $Messages = cpw_check_input();
087508d9 27
27663afe 28 /* if no errors, go ahead with the actual change */
29 if(count($Messages) == 0) {
30 $Messages = cpw_do_change();
31 }
32}
33
34displayPageHeader($color, 'None');
35
5c34b0bb 36do_hook('change_password_init');
27663afe 37?>
38
39<br />
40<table align="center" cellpadding="2" cellspacing="2" border="0">
41<tr><td bgcolor="<?php echo $color[0] ?>">
42 <center><b><?php echo _("Change Password") ?></b></center>
43</td><?php
44
45if (isset($Messages) && count($Messages) > 0) {
46 echo "<tr><td>\n";
47 foreach ($Messages as $line) {
48 echo htmlspecialchars($line) . "<br />\n";
49 }
50 echo "</td></tr>\n";
51}
52
53?><tr><td>
b11b4108 54 <?php echo addForm($_SERVER['PHP_SELF'], 'POST'); ?>
27663afe 55 <table>
56 <tr>
57 <th align="right"><?php echo _("Current Password:")?></th>
b11b4108 58 <td><?php echo addPwField('cpw_curpass'); ?></td>
27663afe 59 </tr>
60 <tr>
61 <th align="right"><?php echo _("New Password:")?></th>
b11b4108 62 <td><?php echo addPwField('cpw_newpass'); ?></td>
27663afe 63 </tr>
64 <tr>
65 <th align=right><?php echo _("Verify New Password:")?></th>
b11b4108 66 <td><?php echo addPwField('cpw_verify'); ?></td>
27663afe 67 </tr>
68 <tr>
69 <td align="center" colspan="2">
b11b4108 70 <?php echo addSubmit(_("Change Password"), 'cpw_go'); ?></td>
27663afe 71 </tr>
72 </table>
73 </form>
74</td></tr>
75</tr></table>
76</body></html>