4 * options.php - Change Password HTML page
6 * Copyright (c) 2004-2005 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
11 * @subpackage change_password
15 define('SM_PATH','../../');
17 include_once (SM_PATH
. 'include/validate.php');
18 include_once (SM_PATH
. 'plugins/change_password/functions.php');
19 include_once (SM_PATH
. 'functions/forms.php');
21 /** load default config */
22 if (file_exists(SM_PATH
. 'plugins/change_password/config_default.php')) {
23 include_once (SM_PATH
. 'plugins/change_password/config_default.php');
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;
33 * prevent possible corruption of configuration overrides in
34 * register_globals=on and preloaded php scripts.
39 $cpw_poppassd=array();
40 $cpw_vmailmgrd=array();
42 /** load site config */
43 if (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');
49 // must load backend libraries here in order to get working change_password_init hook.
50 if (file_exists(SM_PATH
. 'plugins/change_password/backend/'.$cpw_backend.'.php')) {
51 include_once(SM_PATH
. 'plugins/change_password/backend/'.$cpw_backend.'.php');
54 /* the form was submitted, go for it */
55 if(sqgetGlobalVar('cpw_go', $cpw_go, SQ_POST
)) {
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');
63 /* perform basic checks */
64 $Messages = cpw_check_input();
66 /* if no errors, go ahead with the actual change */
67 if(count($Messages) == 0) {
68 $Messages = cpw_do_change();
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');
78 displayPageHeader($color, 'None');
80 // SM14 code: use change_password gettext domain binding for 1.4.x
81 if (! check_sm_version(1,5,0)) {
82 bindtextdomain('change_password',SM_PATH
. 'locale');
83 textdomain('change_password');
86 do_hook('change_password_init');
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
>
95 if (isset($Messages) && count($Messages) > 0) {
97 foreach ($Messages as $line) {
98 echo htmlspecialchars($line) . "<br />\n";
104 <?php
echo addForm($_SERVER['PHP_SELF'], 'post'); ?
>
107 <th align
="right"><?php
echo _("Current Password:")?
></th
>
108 <td
><?php
echo addPwField('cpw_curpass'); ?
></td
>
111 <th align
="right"><?php
echo _("New Password:")?
></th
>
112 <td
><?php
echo addPwField('cpw_newpass'); ?
></td
>
115 <th align
=right
><?php
echo _("Verify New Password:")?
></th
>
116 <td
><?php
echo addPwField('cpw_verify'); ?
></td
>
119 <td align
="center" colspan
="2">
120 <?php
echo addSubmit(_("Change Password"), 'cpw_go'); ?
></td
>