跳至内容
  • 登录
  • 注册
WordPress.org

China 简体中文

  • 主题
  • 插件
  • 消息
  • 支持
    • 文档
    • 论坛
  • 关于
  • 获取 WordPress
获取 WordPress

插件

  • 我的收藏
  • Beta测试
  • 开发者

该插件尚未通过WordPress的最新3个主要版本进行测试。 当与较新版本的WordPress一起使用时,可能不再受到维护或支持,并且可能会存在兼容性问题。

下载

Prevent Concurrent Logins

作者Frankie Jarrett
  • 详情
  • 评价
  • 开发进展
支持

描述

Did you find this plugin helpful? Please consider leaving a 5-star review.

  • Deters members/subscribers from sharing their accounts with others
  • Hardens security by destoying old sessions automatically
  • Prompts old sessions to login again if they want to continue
  • Ideal for membership sites and web applications

Important: If you plan to network-activate this plugin on a multisite network, please install the Proper Network Activation plugin beforehand.

Development of this plugin is done on GitHub. Pull requests welcome. Please see issues reported there before going to the plugin forum.

常见问题

Where are the options for this plugin?

This plugin does not have a settings page. Simply put, I don’t like bloating my plugins with a bunch of options.

Instead, I try to develop functionality using the 80/20 principle so that for 80% of use cases you all you need to do is activate the plugin and it “just works”.

For the other 20% of you who want things to behave differently there are hooks available in the plugin so you can customize default behaviors.

Can I still allow concurrent logins for certain users?

Yes, simply add this code to your theme’s functions.php file or as an MU plugin:

function my_pcl_whitelist_user_ids( $prevent, $user_id ) {

    $whitelist = array( 1, 2, 3 ); // Provide an array of whitelisted user IDs

    return in_array( $user_id, $whitelist ) ? false : $prevent;

}
add_filter( 'pcl_prevent_concurrent_logins', 'my_pcl_whitelist_user_ids', 10, 2 );

Or this code to bypass users with certain roles:

function my_pcl_whitelist_roles( $prevent, $user_id ) {

    $whitelist = array( 'administrator', 'editor' ); // Provide an array of whitelisted user roles

    $user = get_user_by( 'id', absint( $user_id ) );

    $roles = ! empty( $user->roles ) ? $user->roles : array();

    return array_intersect( $roles, $whitelist ) ? false : $prevent;

}
add_filter( 'pcl_prevent_concurrent_logins', 'my_pcl_whitelist_roles', 10, 2 );

评价

Awesome!!

mcostam1985 2021年2月2日
Your awesome man! This plugin with your functions.php code works perfectly. Thank you so much for the time spent working on it.

This plugin is great and has not required any update for 4 years

nddao 2020年8月13日
THIS PLUGIN IS SIMPLE AND PERFECT THAT THE AUTHOR HAS NOT NEED TO UPDATE ANYTHING SINCE LAST 4 YEARS. I had to create an account just to give this plugin a 5-star rating and let people know that it works perfectly. I was looking for something to prevent users from concurently login and found this plugin. However, the age of this plugin and the number of active installation (1000+ at this time) made me skip it. The information that this plugin was updated 4 years ago further drove me away. I decided to install another plugin, which made me crazy because it kept log me out every couple minutes. Then I removed the mentioned plugin and gave this plugin a try, and it works as much as I expect.

GREAT!

César 2019年12月12日
I tried it on my easytomake online course site, and used 3 browsers. Disconnect the others! Thank you CÉSAR

Great!

Eder Tuffic 2018年11月12日
It was exactly what I needed for my course. Thank you!

Muito bom

uilianv 2017年4月5日 1 回复
Faz o que promete, resolve o problema, sem nenhum requinte desnecessário

Super!

Vasily 2017年3月18日
Love the functionality. Exactly what i need now. Thank you very much!
阅读所有17条评价

贡献者及开发者

“Prevent Concurrent Logins” 是开源软件。 以下人员对此插件做出了贡献。

贡献者
  • Frankie Jarrett

将“Prevent Concurrent Logins”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志。

更新日志

0.4.0 – October 16, 2015

  • Official support for WordPress 4.3

Props fjarrett

0.3.0 – May 4, 2015

  • Action hooks now available after sessions are destroyed for logging purposes (#4)

Props fjarrett

0.2.0 – January 28, 2015

  • Destroy old sessions for all users upon activation

Props fjarrett, chuckreynolds

0.1.1 – January 2, 2015

  • Added filter to allow certain users to have concurrent sessions when necessary

Props fjarrett, nutsandbolts

0.1.0 – December 31, 2014

  • Initial release

Props fjarrett

额外信息

  • 版本:0.4.0
  • 最后更新:7年前
  • 有效安装数量:1,000+
  • WordPress版本: 4.1 或更高版本
  • 最高兼容版本:4.6.25
  • 语言:
    English (US)
  • 标签:
    loginmembershipsecuritysenseiusers
  • 高级视图

评级

查看所有评价
  • 5星 17
  • 4星 0
  • 3星 0
  • 2星 0
  • 1星 0
登录以提交评价。

贡献者

  • Frankie Jarrett

支持

最近两个月解决的问题:

总计 1,已解决 0

查看支持论坛

  • 关于
  • 消息
  • 主机
  • 捐助
  • Swag
  • 文档
  • 开发者
  • 参与
  • 学习
  • 展示站点
  • 插件
  • 主题
  • 区块样板
  • WordCamp
  • WordPress.TV
  • BuddyPress
  • bbPress
  • WordPress.com
  • Matt
  • 隐私
  • Public Code
WordPress.org
WordPress.org

China 简体中文

  • 访问我们的 Facebook 公共主页
  • 关注我们的 Twitter 账号
  • 关注我们的 Instagram 账号
  • 关注我们的 LinkedIn 主页
代码如诗