4 * options.php - Change Password HTML page
6 * @copyright © 2004-2006 The SquirrelMail Project Team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @subpackage change_password
14 define('SM_PATH','../../');
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');
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');
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;
32 * prevent possible corruption of configuration overrides in
33 * register_globals=on and preloaded php scripts.
38 $cpw_poppassd=array();
39 $cpw_vmailmgrd=array();
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');
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');
53 /* the form was submitted, go for it */
54 if(sqgetGlobalVar('cpw_go', $cpw_go, SQ_POST
)) {
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');
62 /* perform basic checks */
63 $Messages = cpw_check_input();
65 /* if no errors, go ahead with the actual change */
66 if(count($Messages) == 0) {
67 $Messages = cpw_do_change();
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');
77 displayPageHeader($color, 'None');
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');
85 do_hook('change_password_init');
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
>
94 if (isset($Messages) && count($Messages) > 0) {
96 foreach ($Messages as $line) {
97 echo htmlspecialchars($line) . "<br />\n";
103 <?php
echo addForm($_SERVER['PHP_SELF'], 'post'); ?
>
106 <th align
="right"><?php
echo _("Current Password:")?
></th
>
107 <td
><?php
echo addPwField('cpw_curpass'); ?
></td
>
110 <th align
="right"><?php
echo _("New Password:")?
></th
>
111 <td
><?php
echo addPwField('cpw_newpass'); ?
></td
>
114 <th align
=right
><?php
echo _("Verify New Password:")?
></th
>
115 <td
><?php
echo addPwField('cpw_verify'); ?
></td
>
118 <td align
="center" colspan
="2">
119 <?php
echo addSubmit(_("Change Password"), 'cpw_go'); ?
></td
>