%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 18.223.203.175 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/components/bitrix/main.auth.changepasswd/ |
Upload File : |
<?php if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) { die(); } use \Bitrix\Main\Localization\Loc; Loc::loadMessages(__FILE__); \CBitrixComponent::includeComponentClass('bitrix:main.auth.forgotpasswd'); class MainChangePasswdComponent extends MainForgotPasswdComponent { /** * Gets group policy of current user. * @return array */ protected function getGroupPolicy() { $userId = 0; if ($this->arResult['LAST_LOGIN'] <> '') { $res = \CUser::GetByLogin($this->arResult['LAST_LOGIN']); if ($profile = $res->Fetch()) { $userId = $profile['ID']; } } return \CUser::GetGroupPolicy($userId); } /** * Replace some params from GET. * @return void */ protected function requestForTpl() { $requestParams = array( 'checkword', 'password', 'confirm_password', ); foreach ($requestParams as $param) { $code = $this->formFields[$param]; if ($this->request($code)) { $this->arResult[$code] = $this->request($code); } } } /** * Processing request set new pass. * @return void */ protected function actionRequest() { $password = $password2 = null; // check encrypt if ($this->getOption('use_encrypted_auth', 'N') == 'Y') { $sec = new \CRsaSecurity(); if (($keys = $sec->LoadKeys())) { $sec->SetKeys($keys); $errno = $sec->AcceptFromForm([ $this->formFields['password'], $this->formFields['confirm_password'] ]); if ($errno == CRsaSecurity::ERROR_SESS_CHECK) { $this->addError( 'ERROR_SESSION', Loc::getMessage('MAIN_AUTH_CHD_SESS_EXPIRED') ); } elseif ($errno < 0) { $this->addError( 'ERROR_DECODE', Loc::getMessage('MAIN_AUTH_CHD_ERR_DECODE', [ '#ERRCODE#' => $errno ]) ); } } // replace password from global var if (isset($_REQUEST[$this->formFields['password']])) { $password = $_REQUEST[$this->formFields['password']]; } if (isset($_REQUEST[$this->formFields['confirm_password']])) { $password2 = $_REQUEST[$this->formFields['confirm_password']]; } } else { $password = $this->requestField('password'); $password2 = $this->requestField('confirm_password'); } if (!defined('ADMIN_SECTION') || ADMIN_SECTION !== true) { $lid = LANG; } else { $lid = false; } // change pass $res = $this->getUser()->ChangePassword( $this->requestField('login'), $this->requestField('checkword'), $password, $password2, $lid, $this->request('captcha_word'), $this->request('captcha_sid') ); if ( !$this->processingErrors($res) && isset($res['MESSAGE']) ) { $this->arResult['SUCCESS'] = $res['MESSAGE']; } } /** * Base executable method. * @param boolean $applyTemplate Apply template or not. * @return void */ public function executeComponent($applyTemplate = true) { parent::executeComponent(false); // replace last_login with request data $request = \Bitrix\Main\Application::getInstance()->getContext()->getRequest(); if ( !$request->isPost() && $request->get('USER_LOGIN') ) { $this->arResult['LAST_LOGIN'] = \CUtil::ConvertToLangCharset( $request->get('USER_LOGIN') ); } else if ($request->getPost('USER_LOGIN')) { $this->arResult['LAST_LOGIN'] = $request->getPost('USER_LOGIN'); } // tpl vars $this->arResult['GROUP_POLICY'] = $this->getGroupPolicy(); $this->arResult['SECURE_AUTH'] = $this->isSecureAuth(); $this->requestForTpl(); $this->IncludeComponentTemplate(); } }