4 * options.php - Change Password HTML page
6 * @copyright © 2004-2007 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
)) {
56 /* perform basic checks */
57 $Messages = cpw_check_input();
59 /* if no errors, go ahead with the actual change */
60 if(count($Messages) == 0) {
61 $Messages = cpw_do_change();
65 displayPageHeader($color, 'None');
67 do_hook('change_password_init', $null);
71 <table align
="center" cellpadding
="2" cellspacing
="2" border
="0">
72 <tr
><td bgcolor
="<?php echo $color[0] ?>">
73 <div style
="text-align: center;"><b
><?php
echo _("Change Password") ?
></b
></div
>
76 if (isset($Messages) && count($Messages) > 0) {
78 foreach ($Messages as $line) {
79 echo htmlspecialchars($line) . "<br />\n";
85 <?php
echo addForm($_SERVER['PHP_SELF'], 'post'); ?
>
88 <th align
="right"><?php
echo _("Current Password:")?
></th
>
89 <td
><?php
echo addPwField('cpw_curpass'); ?
></td
>
92 <th align
="right"><?php
echo _("New Password:")?
></th
>
93 <td
><?php
echo addPwField('cpw_newpass'); ?
></td
>
96 <th align
=right
><?php
echo _("Verify New Password:")?
></th
>
97 <td
><?php
echo addPwField('cpw_verify'); ?
></td
>
100 <td align
="center" colspan
="2">
101 <?php
echo addSubmit(_("Change Password"), 'cpw_go'); ?
></td
>