retrieve($_POST['record']); if(!$focus->change_password($_POST['old_password'], $_POST['new_password'])) SugarApplication::redirect("index.php?action=ChangePassword&module=Users&record=".$_POST['record']."&error_password=".urlencode($focus->error_string)); // Send to new user wizard if it hasn't been run $ut = $GLOBALS['current_user']->getPreference('ut'); if(empty($ut)) SugarApplication::redirect('index.php?module=Users&action=Wizard'); // Otherwise, send to home page SugarApplication::redirect('index.php?module=Home&action=index'); } require_once('modules/Administration/Forms.php'); require_once('modules/Configurator/Configurator.php'); $configurator = new Configurator(); $sugarConfig = SugarConfig::getInstance(); require_once('include/SugarLogger/SugarLogger.php'); $sugar_smarty = new Sugar_Smarty(); $sugar_smarty->assign('MOD', $mod_strings); $sugar_smarty->assign('APP', $app_strings); $sugar_smarty->assign('MODULE', 'Users'); $sugar_smarty->assign('ACTION', 'ChangePassword'); $sugar_smarty->assign('return_action', 'index'); $sugar_smarty->assign('APP_LIST', $app_list_strings); $sugar_smarty->assign('config', $configurator->config); $sugar_smarty->assign('error', $configurator->errors); $sugar_smarty->assign('LANGUAGES', get_languages()); $sugar_smarty->assign('PWDSETTINGS', $GLOBALS['sugar_config']['passwordsetting']); $sugar_smarty->assign('ID', $current_user->id); $sugar_smarty->assign('IS_ADMIN', $current_user->is_admin); $sugar_smarty->assign('USER_NAME', $current_user->user_name); $sugar_smarty->assign("INSTRUCTION", $mod_strings['LBL_CHANGE_SYSTEM_PASSWORD']); $sugar_smarty->assign('sugar_md',getWebPath('include/images/sugar_md_open.png')); if (!$current_user->is_admin) $sugar_smarty->assign('OLD_PASSWORD_FIELD',''.$mod_strings['LBL_OLD_PASSWORD'].':'); $pwd_settings=$GLOBALS['sugar_config']['passwordsetting']; $rules = "'','',''"; $sugar_smarty->assign('SUBMIT_BUTTON', ''); if (isset($_SESSION['expiration_type']) && $_SESSION['expiration_type'] != '') $sugar_smarty->assign('EXPIRATION_TYPE', $_SESSION['expiration_type']);/* if ($current_user->system_generated_password == '1') $sugar_smarty->assign('EXPIRATION_TYPE', $mod_strings['LBL_PASSWORD_EXPIRATION_GENERATED']);*/ if(isset($_REQUEST['error_password'])) $sugar_smarty->assign('EXPIRATION_TYPE', $_REQUEST['error_password']); $sugar_smarty->display('modules/Users/Changenewpassword.tpl'); ?>