Stinger2015 Posted May 21, 2018 Share Posted May 21, 2018 (edited) И так проблема следующая, после перехода с 4.2.8 , на 4.3.2, моя функция умерла и авторизация не проходит! require_once './forum/init.php'; \IPS\Dispatcher\Build::i(); $lang = \IPS\Lang::load( \IPS\Lang::defaultLanguage() ); $member = \IPS\Member::loggedIn(); $member_id = $member->member_id; $csrfKey = \IPS\Session::i()->csrfKey; function doLogin( $username, $password, $rememberMe=true, $anonymous=false ) { $login = new \IPS\Login( \IPS\Http\Url::internal('') ); $login->forms(); try{ $member = $login->authenticateStandard(array( 'auth' => $username, 'password' => $password, )); } catch( \IPS\Login\Exception $e ) { return false; } if ( $anonymous and !\IPS\Settings::i()->disable_anonymous ) { \IPS\Session::i()->setAnon(); \IPS\Request::i()->setCookie( 'anon_login', 1 ); } \IPS\Session::i()->setMember( $member ); if ( $rememberMe ) { $expire = new \IPS\DateTime; $expire->add( new \DateInterval( 'P7D' ) ); \IPS\Request::i()->setCookie( 'member_id', $member->member_id, $expire ); \IPS\Request::i()->setCookie( 'login_key', $member->member_login_key, $expire ); if ( $anonymous and !\IPS\Settings::i()->disable_anonymous ) { \IPS\Request::i()->setCookie( 'anon_login', 1, $expire ); } } $member->memberSync( 'onLogin', array( \IPS\Login::getDestination() ) ); return $member; } Буду очень благодарен за помощь в решении проблемы. Edited May 21, 2018 by Stinger2015 Link to comment Share on other sites More sharing options...
newbie Posted May 22, 2018 Share Posted May 22, 2018 $login->forms();Метода forms() больше нет. Равно как и authenticateStandard() ($login->authenticateStandard) Вот здесь есть вариант https://invisioncommunity.com/forums/topic/445586-external-login-issue-with-43/?do=findComment&comment=2742731 Link to comment Share on other sites More sharing options...
Stinger2015 Posted May 22, 2018 Author Share Posted May 22, 2018 Спасибо, попробую. Link to comment Share on other sites More sharing options...
Stinger2015 Posted May 22, 2018 Author Share Posted May 22, 2018 (edited) По вашему совету всё получилось, спасибо от души newbie! Edited May 22, 2018 by Stinger2015 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now