扩展:LoginNotify

This page is a translated version of the page Extension:LoginNotify and the translation is 50% complete.
Other languages:
English • ‎русский • ‎中文 • ‎日本語 • ‎한국어
MediaWiki扩展手册
OOjs UI icon advanced.svg
LoginNotify
发布状态: 稳定版
LoginNotify screenshot for meta documentation.png
实现 用戶活動
描述 通知用户有可疑登录
作者 Brian Wolff
最新版本 0.1
许可协议 MIT授權條款
下载
  • $wgLoginNotifyExpiryNewIP
  • $wgLoginNotifyExpiryKnownIP
  • $wgLoginNotifyEnableOnSuccess
  • $wgLoginNotifyAttemptsKnownIP
  • $wgLoginNotifyCacheLoginIPExpiry
  • $wgLoginNotifyCookieExpire
  • $wgLoginNotifyCookieDomain
  • $wgLoginNotifyMaxCookieRecords
  • $wgLoginNotifyAttemptsNewIP
  • $wgLoginNotifyCheckKnownIPs
  • $wgLoginNotifySecretKey
翻译LoginNotify扩展如果在translatewiki.net可用
检查使用和版本矩阵。
问题 开放的工作 · 报告错误

The LoginNotify extension notifies you when someone logs into your account. It can be configured to give warnings after a certain number of failed login attempts (The number is configurable, and can be different between unknown IPs/devices and known IPs/devices). It can also give Echo notices (which can also be emailed) for successful logins from IPs you don't normally use. It can optionally integrate into the CheckUser extension in order to determine if the login is from an IP address you don't normally use. It can also set a cookie to try and determine if the login is from a device you normally use.

安装

此扩展需要安装Echo扩展。 This extension can optionally integrate with the CheckUser extension if it is installed, but does not require it.


  • 下载文件,并将其放置在您extensions/文件夹中的LoginNotify目录内。

致使用MediaWiki 1.24或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.24和更早版本)中安装此扩展,而不是wfLoadExtension( 'LoginNotify' );,您需要使用:

require_once "$IP/extensions/LoginNotify/LoginNotify.php";

用法

Once LoginNotify is installed, whenever a user logs into the wiki, their IP subnet is cached on the server and a cookie named loginnotify_prevlogins is stored in their browser. These tokens, optionally along with CheckUser tables, are used to see if subsequent logins are coming from a known IP/device.

If CentralAuth and CheckUser are installed, it will check the IP not only for the current wiki, but also the ten wikis where the user is most active.

配置

可以设置的参数(在“LocalSettings.php”中):

名称 描述 默认
$wgLoginNotifyAttemptsKnownIP 在触发通知之前,从已知IP允许的失败登录尝试次数。 10
$wgLoginNotifyAttemptsNewIP 触发通知之前,允许新IP的失败登录尝试次数。 3
$wgLoginNotifyExpiryKnownIP The time-to-live of the count of failed login attempts from a known IP (from the time of the first failed attempt). 604800 (7天)
$wgLoginNotifyExpiryNewIP The time-to-live of the count of failed login attempts from a new IP (from the time of the first failed attempt). 1209600 (14天)
$wgLoginNotifyCheckKnownIPs 是否在已知IP成功失败后触发通知。 true
$wgLoginNotifyEnableOnSuccess 是否在未知IP成功登录后触发通知。 true
$wgLoginNotifyEnableForPriv 为不同的用户组设置不同的默认通知首选项。 For user groups that have any of the user rights listed in this array, the preferences specified in Hooks:getOverridenOptions() are on by default. ("Failed login attempts" web notifications and "Login from new computer" web notifications.) [ "editinterface", "userrights" ]
$wgLoginNotifySecretKey Use this key instead of $wgSecretKey to generate the HMACs for the cookie. null
$wgLoginNotifyCookieExpire Cookie到期。 15552000 (180天)
$wgLoginNotifyCookieDomain To allow sharing login cookies between sites on different subdomains, set this to the parent domain name. null
$wgLoginNotifyMaxCookieRecords Maximum number of users (records) to track as having successfully logged in on a particular device. 6
$wgLoginNotifyCacheLoginIPExpiry How long to cache IPs in memcache. Set to false to disable; set to 0 to cache forever. 5184000 (60天)