Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

OnlyOneLogin

Summary: Only allow 1 login at the same time for a username
Version: 1.4
Prerequisites: AuthUser, PHP5 or PMWCompat if you use and older version of PHP
Status: working
Maintainer: GNUZoo & Sven
Categories: Security
Discussion: OnlyOneLogin-Talk?

Questions answered by this recipe

How come I can logon in FireFox and Internet Explorer at the same time with the same login name?

Can I prevent two people logging in at the same time using the same login name?

Description

When using AuthUser a person can login as many times as they want from different computers and browsers. This recipe will change this so that when someone logs in anyone else with the same user name will be logged out. This gives users incentive to not share their login data with others.

Installation

If you are not using PHP version 5 or newer you will need to install recipe PMWCompat.

There are 3 steps to installing OnlyOneLogin.

Step 1

Create a directory named "userlock" on the same level as you wiki.d directory.

Step2

Create a page named "Site.LoginSuperseded".

Step 3

Copy OnlyOneLogin.phpΔ to your cookbook directory.
Place this AFTER inclusion of AuthUser !
Inclusion in your config.php:
require("cookbook/OnlyOneLogin.php");
or in your farmconfig.php enter:
require("$FarmD/cookbook/OnlyOneLogin.php");

Notes

Use "require" and not "include" - this will deny any access if the security check fails due to server problems. Do not user "require_once" because someone might capture it's Redirect() and make it void. Better check once too often than once too less.

Release Notes

This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation http://www.fsf.org either version 2 of the License, or (at your option) any later version.

Copyright 2007 by GNUZoo email: guru [snail] gnuzoo [period] org

Please donate to the author at url: http://gnuzoo.org/GNUZooPayPal

  • Version 1.4 - Changed page name from YourSessionHasBeenSuperseded to LoginSuperseded
  • Version 1.3 - added "if (!defined('PmWiki')) exit();"
  • Version 1.2: Initial Release

See Also

Contributors

GNUZoo created and maintains recipe

Sven created initial code

Comments

See Discussion at OnlyOneLogin-Talk?

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on November 01, 2013, at 07:00 PM