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