.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ============== 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: Previous Login ============== Extension Key: **ce\_previouslogin** Copyright 2000-2009, Christian Ehret, 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: Table of Contents ----------------- **Previous Login 1** **Introduction 1** **Configuration 1** Installation 1 **Usage 2** **Changelog 2** .. _Introduction: 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: Configuration ------------- .. _Installation: 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: **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: 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 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. :border: 0 .. :height: 238 .. :id: graphics1 .. :name: graphics1 .. :width: 547 .. |img-2| image:: img-2.png .. :align: left .. :border: 0 .. :height: 207 .. :id: graphics2 .. :name: graphics2 .. :width: 552 .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 32 .. :id: Graphic1 .. :name: Graphic1 .. :width: 102