Source for file functions.php
Documentation is available at functions.php
* functions.php - Change Password plugin
* @copyright 2003-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: functions.php 14845 2020-01-07 08:09:34Z pdontthink $
* @subpackage change_password
* Will verify the input against a set of criteria:
* is every field supplied, does verify password match,
* does current password validate, ..
* These criteria are (for now) backend-independent.
* @return array Array with zero or more error messages.
global $cpw_pass_min_length, $cpw_pass_max_length;
// for decrypting current password
$msg[] =
_("You must type in a new password.");
$msg[] =
_("You must also type in your new password in the verify box.");
} elseif ($verifypw !=
$newpw) {
$msg[] =
_("Your new password does not match the verify password.");
$msg[] =
_("You must type in your current password.");
} elseif ($currentpw !=
$orig_pw) {
$msg[] =
_("Your current password is not correct.");
if($newpw &&
(strlen($newpw) <
$cpw_pass_min_length ||
strlen($newpw) >
$cpw_pass_max_length ) ) {
$msg[] =
sprintf(_("Your new password should be %s to %s characters long."),
$cpw_pass_min_length, $cpw_pass_max_length);
// do we need to do checks that are backend-specific and should
// be handled by a hook? I know of none now, bnd those checks can
// also be done in the backend dochange() function. If there turns
// out to be a need for it we can add a hook for that here.
define('CPW_CURRENT_NOMATCH', _("Your current password is not correct."));
define('CPW_INVALID_PW', _("Your new password contains invalid characters."));
* Does the actual password changing (meaning it calls the hook function
* from the backend that does this. If something goes wrong, return error
* message(s). If everything ok, change the password in the session so the
* user doesn't have to log out, and redirect back to the options screen.
require_once(SM_PATH .
'plugins/change_password/backend/'.
$cpw_backend.
'.php');
$msgs =
do_hook('change_password_dochange',
'username' =>
&$username,
/* something bad happened, return */
/* update our password stored in the session */
/* make sure we write the session data before we redirect */
Documentation generated on Mon, 13 Jan 2020 04:22:34 +0100 by phpDocumentor 1.4.3