Use form funcs in cpw plugin
[squirrelmail.git] / plugins / change_password / options.php
1 <?php
2
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
14 define('SM_PATH','../../');
15
16 require_once (SM_PATH . 'include/validate.php');
17 require_once (SM_PATH . 'functions/page_header.php');
18 require_once (SM_PATH . 'plugins/change_password/functions.php');
19 require_once (SM_PATH . 'plugins/change_password/config.php');
20 require_once (SM_PATH . 'functions/forms.php');
21
22 /* the form was submitted, go for it */
23 if(sqgetGlobalVar('cpw_go', $cpw_go, SQ_POST)) {
24
25 /* perform basic checks */
26 $Messages = cpw_check_input();
27
28 /* if no errors, go ahead with the actual change */
29 if(count($Messages) == 0) {
30 $Messages = cpw_do_change();
31 }
32 }
33
34 displayPageHeader($color, 'None');
35
36 do_hook('change_password_init');
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
45 if (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>
54 <?php echo addForm($_SERVER['PHP_SELF'], 'POST'); ?>
55 <table>
56 <tr>
57 <th align="right"><?php echo _("Current Password:")?></th>
58 <td><?php echo addPwField('cpw_curpass'); ?></td>
59 </tr>
60 <tr>
61 <th align="right"><?php echo _("New Password:")?></th>
62 <td><?php echo addPwField('cpw_newpass'); ?></td>
63 </tr>
64 <tr>
65 <th align=right><?php echo _("Verify New Password:")?></th>
66 <td><?php echo addPwField('cpw_verify'); ?></td>
67 </tr>
68 <tr>
69 <td align="center" colspan="2">
70 <?php echo addSubmit(_("Change Password"), 'cpw_go'); ?></td>
71 </tr>
72 </table>
73 </form>
74 </td></tr>
75 </tr></table>
76 </body></html>