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