DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Previous Login

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2009-03-30T16:47:30
Author:Christian Ehret
Email:ce@toco3.com
Info 3:
Info 4:

Previous Login

Extension Key: ce_previouslogin

Copyright 2000-2009, Christian Ehret, <ce@toco3.com>

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

Previous Login 1

Introduction 1

Configuration 1

Installation 1

Usage 2

Changelog 2

Introduction

TYPO3 stores the last login in the field “lastlogin” in the table “fe_users” by default. This field is updated at login time which means if a user is logged in that field contains the timestamp of the beginning of the actual login. This is interesting for administrators but in many cases you want to show the user information depending of if it is new since her last login or you want to show the date of the last login.

Another function with I implemented in a second step (that's why the extension key is ce_previouslogin ;-)) is the possibility to lock a user account after a certain amount of failed logins. A mail to an administrator could be sent if necessary.

This extension extends the “fe_users” table with three additional fields, one is only a “cache” field for the previous login, one contains the “real” previous login and the last one counts the number of failed logins.

Configuration

Installation

You have to install this extension with the Extension Manager.

If you wish to use the user locking you need to fill out at least the “Number of failed logins” field in the extension manager. If you want to be informed by mail, specify an “Admin Email Address”, too.

img-1

Usage

You have to options to get the previous login date. One possibility is to use typoscript if you want to display the date/time:

10 = TEXT
     10.data = TSFE:fe_user|user|tx_cepreviouslogin_previous
     10.strftime = %b-%d-%Y, %H:%M

This example formats the previous login like:

Jan-26-2009, 19:47

If you want to use previous login in you extension you can access it like this:

$GLOBALS["TSFE"]->fe_user-user["tx_cepreviouslogin_previous"]

This returns the previous login as timestamp.

If you look at a fe_user record in the backend you'll discover two new fields:

img-2

If you use the automatic locking feature, the fe_user record is disabled. To re-enable it, you have to clear the disabled flag on the general tab. As the failed login counter is reset the next time the user logins in (with his right credentials) it is not necessary to reset the counter – nevertheless if the user reenters wrong credentials the account will be locked immediately because of course the count is reached – so perhaps it's not a too bad idea to also reset the counter ;-)

Changelog

0.0.1 Initial upload

0.0.2 Documentation added

0.0.3 Locking feature added, display of fields in backend

img-3 Previous Login - 3