4 * options.php - Change Password HTML page
6 * @copyright 2004-2015 The SquirrelMail Project Team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 * @subpackage change_password
14 * Include the SquirrelMail initialization file.
16 require('../../include/init.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
)) {
58 sqgetGlobalVar('smtoken', $submitted_token, SQ_POST
, '');
59 sm_validate_security_token($submitted_token, -1, TRUE);
61 /* perform basic checks */
62 $Messages = cpw_check_input();
64 /* if no errors, go ahead with the actual change */
65 if(count($Messages) == 0) {
66 $Messages = cpw_do_change();
70 displayPageHeader($color);
72 do_hook('change_password_init', $null);
76 <table align
="center" cellpadding
="2" cellspacing
="2" border
="0">
77 <tr
><td bgcolor
="<?php echo $color[0] ?>">
78 <div style
="text-align: center;"><b
><?php
echo _("Change Password") ?
></b
></div
>
81 if (isset($Messages) && count($Messages) > 0) {
83 foreach ($Messages as $line) {
84 echo sm_encode_html_special_chars($line) . "<br />\n";
90 <?php
echo addForm($_SERVER['PHP_SELF'], 'post'); ?
>
91 <input type
="hidden" name
="smtoken" value
="<?php echo sm_generate_security_token() ?>" />
94 <th align
="right"><?php
echo _("Current Password:")?
></th
>
95 <td
><?php
echo addPwField('cpw_curpass'); ?
></td
>
98 <th align
="right"><?php
echo _("New Password:")?
></th
>
99 <td
><?php
echo addPwField('cpw_newpass'); ?
></td
>
102 <th align
=right
><?php
echo _("Verify New Password:")?
></th
>
103 <td
><?php
echo addPwField('cpw_verify'); ?
></td
>
106 <td align
="center" colspan
="2">
107 <?php
echo addSubmit(_("Change Password"), 'cpw_go'); ?
></td
>