phpDocumentor updates
[squirrelmail.git] / plugins / change_password / options.php
1 <?php
2
3 /**
4 * options.php - Change Password HTML page
5 *
6 * @copyright &copy; 2004-2005 The SquirrelMail Project Team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
8 * @version $Id$
9 * @package plugins
10 * @subpackage change_password
11 */
12
13 /** @ignore */
14 define('SM_PATH','../../');
15
16 include_once (SM_PATH . 'include/validate.php');
17 include_once (SM_PATH . 'plugins/change_password/functions.php');
18 include_once (SM_PATH . 'functions/forms.php');
19
20 /** load default config */
21 if (file_exists(SM_PATH . 'plugins/change_password/config_default.php')) {
22 include_once (SM_PATH . 'plugins/change_password/config_default.php');
23 } else {
24 // somebody decided to remove default config
25 $cpw_backend = 'template';
26 $cpw_pass_min_length = 4;
27 $cpw_pass_max_length = 25;
28 $cpw_require_ssl = FALSE;
29 }
30
31 /**
32 * prevent possible corruption of configuration overrides in
33 * register_globals=on and preloaded php scripts.
34 */
35 $cpw_ldap=array();
36 $cpw_merak=array();
37 $cpw_mysql=array();
38 $cpw_poppassd=array();
39 $cpw_vmailmgrd=array();
40
41 /** load site config */
42 if (file_exists(SM_PATH . 'config/change_password_config.php')) {
43 include_once (SM_PATH . 'config/change_password_config.php');
44 } elseif (file_exists(SM_PATH . 'plugins/change_password/config.php')) {
45 include_once (SM_PATH . 'plugins/change_password/config.php');
46 }
47
48 // must load backend libraries here in order to get working change_password_init hook.
49 if (file_exists(SM_PATH . 'plugins/change_password/backend/'.$cpw_backend.'.php')) {
50 include_once(SM_PATH . 'plugins/change_password/backend/'.$cpw_backend.'.php');
51 }
52
53 /* the form was submitted, go for it */
54 if(sqgetGlobalVar('cpw_go', $cpw_go, SQ_POST)) {
55
56 // SM14 code: use change_password gettext domain binding for 1.4.x
57 if (! check_sm_version(1,5,0)) {
58 bindtextdomain('change_password',SM_PATH . 'locale');
59 textdomain('change_password');
60 }
61
62 /* perform basic checks */
63 $Messages = cpw_check_input();
64
65 /* if no errors, go ahead with the actual change */
66 if(count($Messages) == 0) {
67 $Messages = cpw_do_change();
68 }
69
70 // SM14 code: use change_password gettext domain binding for 1.4.x
71 if (! check_sm_version(1,5,0)) {
72 bindtextdomain('squirrelmail',SM_PATH . 'locale');
73 textdomain('squirrelmail');
74 }
75 }
76
77 displayPageHeader($color, 'None');
78
79 // SM14 code: use change_password gettext domain binding for 1.4.x
80 if (! check_sm_version(1,5,0)) {
81 bindtextdomain('change_password',SM_PATH . 'locale');
82 textdomain('change_password');
83 }
84
85 do_hook('change_password_init');
86 ?>
87
88 <br />
89 <table align="center" cellpadding="2" cellspacing="2" border="0">
90 <tr><td bgcolor="<?php echo $color[0] ?>">
91 <center><b><?php echo _("Change Password") ?></b></center>
92 </td><?php
93
94 if (isset($Messages) && count($Messages) > 0) {
95 echo "<tr><td>\n";
96 foreach ($Messages as $line) {
97 echo htmlspecialchars($line) . "<br />\n";
98 }
99 echo "</td></tr>\n";
100 }
101
102 ?><tr><td>
103 <?php echo addForm($_SERVER['PHP_SELF'], 'post'); ?>
104 <table>
105 <tr>
106 <th align="right"><?php echo _("Current Password:")?></th>
107 <td><?php echo addPwField('cpw_curpass'); ?></td>
108 </tr>
109 <tr>
110 <th align="right"><?php echo _("New Password:")?></th>
111 <td><?php echo addPwField('cpw_newpass'); ?></td>
112 </tr>
113 <tr>
114 <th align=right><?php echo _("Verify New Password:")?></th>
115 <td><?php echo addPwField('cpw_verify'); ?></td>
116 </tr>
117 <tr>
118 <td align="center" colspan="2">
119 <?php echo addSubmit(_("Change Password"), 'cpw_go'); ?></td>
120 </tr>
121 </table>
122 </form>
123 </td></tr>
124 </tr></table>
125 </body></html>