承接 lekoala/silverstripe-multi-devices-remember-me 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lekoala/silverstripe-multi-devices-remember-me

Composer 安装命令:

composer require lekoala/silverstripe-multi-devices-remember-me

包简介

Backports RememberLoginHash from SS4 to SS3 to allow multi devices remember me token

README 文档

README

Backports RememberLoginHash from SS4 to SS3 to allow multi devices remember me token

Code changes

You need to manually edit the following lines in Member.php

Comment the part that sets alc_enc cookies in the logIn function, it will be set by RememberMeExtension::setDeviceCookie

public function logIn($remember = false) {
		...

		// Only set the cookie if autologin is enabled
        RememberMeExtension::setDeviceCookie($this, $remember);
		// if($remember && Security::config()->autologin_enabled) {
		// 	// Store the hash and give the client the cookie with the token.
		// 	$generator = new RandomGenerator();
		// 	$token = $generator->randomToken('sha1');
		// 	$hash = $this->encryptWithUserSettings($token);
		// 	$this->RememberLoginToken = $hash;
		// 	Cookie::set('alc_enc', $this->ID . ':' . $token, 90, null, null, null, true);
		// } else {
		// 	$this->RememberLoginToken = null;
		// 	Cookie::force_expiry('alc_enc');
		// }

        ...

Edit the currentUserID function like this

public static function currentUserID() {
    $id = Session::get("loggedInAs");
    if(!$id && !self::$_already_tried_to_auto_log_in) {
        RememberMeExtension::autoLoginFromDevice();
        $id = Session::get("loggedInAs");
    }

    return is_numeric($id) ? (int) $id : 0;
}

Compatibility

Tested with 3.7+

Maintainer

LeKoala - thomas@lekoala.be

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-02-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固