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.

New frontend login box

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed by:Stefan Strasser
Changed:2008-06-07T09:38:49
Author:Stefan Strasser
Email:strada@stradax.net
Info 3:
Info 4:

New frontend login box

Extension Key: newloginbox

initially written by Kasper Skårhøj <kasperYYYY@typo3.com>maintained by Stefan Strasser <strada@stradax.net>

SPONSORED IN PART by Headline

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

New frontend login box 1

Why obsolete? 1

Introduction 1

What does it do? 1

Screenshots 1

Users manual 4

FAQ 8

Configuration 8

General 8

TypoScript Reference 8

CSS styling 12

Template and common markers 12

Markers 12

Wrap parts 12

Newloginbox Language Markers (see pi/locallang.php) 13

To-Do list 13

Changelog 13

Why obsolete?

This extension is deprecated since TYPO3 4.2 because it's login- functionality is now integrated into the core as sysext 'felogin'.

The new system-extension 'felogin' comes with long-awaited redirection-functionality and many configuration options, but runs well using only the default settings. When installed, the new extension will replace the old login content element.

The userlisting-plugin has been put into a separate extension 'feuserlisting', available from TER.

The old extension newloginbox is therefore not being maintained anymore with the exception of security-fixes and language- enhancements. That's the reason for marking newloginbox obsolete. See also http://typo3.org/development/articles/release-notes-42/page/3/

Introduction

What does it do?

This is an alternative to the good old login box. This version features a little more functionality, including success/error messages, cookie check, forgot password feature etc.

Actually there is two plugins in this extension so you also get a user listing plugin as well.

After installing the extension on your TYPO3 system you will find two plugins added in the content elements plugin list. Further a static template “newloginbox” will be added globally to your TypoScript templates.

Screenshots

This is the login screen of typo3.org:

img-1

In the backend it is extremely easy to enter custom messages for the plugin:

img-2

... and here the “forgot password” feature:

img-3

User listing

There is also a plugin for listing, browsing and searching the current users:

img-4

... and for each user you can click the username and get details:

img-5

Users manual

((generated))

A better login box

The default login box in TYPO3 is this dedicated content element called “Login”. You can still use that if you like. However it's pretty simply an really doesn't offer anything but a login and logout button.

img-6

Using this plugin enables you to insert a more user friendly login box on your pages. This is how you do:

Create a page where you want the login box to be and then add a new element:

img-7

In the element overview there is a plugin:

img-8

After this (an possibly selecting a position for the element) you'll get this form up:

img-9

The basic requirements are that the “Type:” field is set to “Insert plugin” and the “Plugin:” field is set to “Better login-box”. Then you'll see these fields.

There are five main sections and in each section a field for a header and a text.

Successful login: This is the message when a user has just entered a correct username and password and pressed “Login” button. Insert the string “###USER###” if you want to display the username.

Login-failure: Will appear when the username and password tried was not correct.

Welcome: The message that appears if a user comes to the login screen for the first time and is not logged in yet.

Status: The message that appears if a user is already logged in and comes to the login screen. In this case the plugin will display the current username and real name of that person so the user can see his status. Insert the string “###USER###” if you want to display the username.

Logout: This message appears as a goodbye-message when the user logs out from the site.

In all cases above there are default messages shown if the field is blank. It's suggested that you insert the plugin without modifying the fields first - then you can see the default messages and if needed you can override these by entering your own custom messages here.

The 6th item in the form is the “Show “Forgot password?” link:” checkbox. If you set this checkbox a link below the login form will appear and the user will be guided to a page where he can enter his email address and have the password sent to him right away:

img-10

img-11

A user list

Want to list all your users on the site? No problem. Just insert the user list plugin:

Create a page for the plugin and add a new item. This time you cannot use the wizard, sorry:

img-13

Then select the “insert plugin” content element type and the “User listing” plugin:

img-14

Finally you must tell the plugin where the users are found. Do that by setting the starting point relation:

img-15

Save that and now all fe_users found in the DB folder will be displayed by the plugin:

img-16

FAQ

The login form does not work! I know I have created a user and the password is right, but nothing happens!

The login form has to know where the users are located in the page tree. In the example with the user listing that relation is set directly in the plugin as the starting point. That is not the case with the login form. Here it is based on a new concept which is called a “Storage page”. The current storagepage of position in the page tree where this login form is found that is the location used by default to look up the users for login. So basically you have to first set the storage page of any previous page in the page tree:

img-17 Another way to define the storagepage for the login form is to set it in your template (useful if you use the loginbox on all pages):

plugin.tx_newloginbox_pi1.storagePid = 123
In the userlist I can see only Name, Username and Email address. How can I see all the information about a user?

That is simply a restriction based on whether you are logged in or not. Only name, username and email address (in the detailed view) is displayed if the website user is not logged in. But when you are logged in you'll see the full information:

img-18

Configuration

There are as usual a lot of options for configuring. These are listed below. This section could still need some work but since the extension has potential for further development, this is all you get now.

General

The plugin supports all system languages in TYPO3. Translation is done using the typo3.org tools.

If you want to use eg. danish language that will automatically be used if this option is set in your template:

config.language = dk

TypoScript Reference

There is a moderate number of TypoScript options for the two plugins. Here is a screendump from the Object Browser:

img-19

img-20

This is pretty straight forward and many of the above options may be self-explanatory or at least (in the case of ..._pi3 - the user listing) similar to other known plugins.

Tip / Side note

There is one interesting thing to comment in the above screendump and that is the setting of the value “._LOCAL_LANG.default.listFieldHeader_typo3experiences”. This value overrides the normal value found in the local_lang.php files. This opportunity is not specific for this plugin but applies generally to all modern extension made under the kickstarter. In other words you can overrule those hardcoded default labels through TypoScript! You just have to know the keys used in the local_lang files. That's all. In this case the details-display of a user will use the label “Experience with TYPO3:” instead of the default label which is just “Experience:”

img-21

The User list plugin
CMD

Property

CMD

Data type

Description

[Future option]

Default

pidList

Property

pidList

Data type

Description

[Future option]

Default

recursive

Property

recursive

Data type

Description

[Future option]

Default

tableParams_details

Property

tableParams_details

Data type

<TABLE>-params

Description

Setting the attributes of the table tag of the table displaying the user details (single display).

A class attribute is automatically appended to this string!

Default

border=0 cellpadding=1 cellspacing=2 width=90%

listView.results_at_a_time

Property

listView.results_at_a_time

Data type

int+

Description

The number of records to show at a time in the listing

Default

50

listView.maxPages

Property

listView.maxPages

Data type

int+

Description

The maximum number of “browser”-pages (<PREV, 1, 2, 3....) to show.

Default

20

listView.show.email

Property

listView.show.email

Data type

boolean

Description

Whether the email address is shown in the limited (no-login) listing of users

Default

1

listView.show.email_in_details

Property

listView.show.email_in_details

Data type

boolean

Description

Whether the email address is shown in details view (when a user is not logged in)

Default

1

listView.alwaysPrev

Property

listView.alwaysPrev

Data type

boolean

Description

Whether to always display the “<PREV” link in the browsebox.

Default

1

listView.customProcessing.[fieldname]

Property

listView.customProcessing.[fieldname]

Data type

cObject

Description

Here you can configure custom processing for field values shown in the list view.

The data array ist set to the current record!

So you can access the field values on stdWrap properties by .field = thefieldname. See examples below.

The following example shows how to make the username appear in bold:

plugin.tx_newloginbox_pi3.customProcessing {
        username = TEXT
        username.field = username
        username.wrap = <b>|</b>
}

By default, the following customProcessing is set:

plugin.tx_newloginbox_pi3.listView.customProcessing {
        image = IMAGE
        image.file {
                import = uploads/pics/
                import.field = image
                import.listNum = 0
                maxW = 200
                maxH = 300
        }
}

You can easily change all the values with the TypoScript Object Browser.

Default

singleView.customProcessing.[fieldname]

Property

singleView.customProcessing.[fieldname]

Data type

cObject

Description

Same as listView.customProcessing just for the singleView instead.

Default

_CSS_DEFAULT_STYLE

Property

_CSS_DEFAULT_STYLE

Data type

string

Description

Default CSS style. You should unset this value and copy the CSS selectors to a stylesheet.

Notice that the selectors will apply to all templates in the TYPO3 database by default!

Default

_LOCAL_LANG.[langkey].[labelkey]

Property

_LOCAL_LANG.[langkey].[labelkey]

Data type

string

Description

Overriding the labels from the local lang array.

Default

_DEFAULT_PI_VARS.[piVars_key]

Property

_DEFAULT_PI_VARS.[piVars_key]

Data type

string

Description

Setting the default value of a piVars value (those values used in the post/get requests within the plugin.)

Example:

_DEFAULT_PI_VARS.pointer = 2

This will set the pointer to “Page 3” in the browsebox by default.

Default

0

[tsref:plugin.tx_newloginbox_pi3]

The “Better login box” plugin
storagePid

Property

storagePid

Data type

int+

Description

The PID number of the page where the frontend-users are stored. If this is set, the “General Record Storage Page” setting is ignored.

Default

detailsPage

Property

detailsPage

Data type

int+

Description

The PID number of the page where the details of the users should be displayed. The username is linked to this page if this PID is given.

Default

showForgotPassword

Property

showForgotPassword

Data type

boolean

Description

Whether the show-forgot-password-link is shown in the login-form

Default

domains

Property

domains

Data type

string

Description

Comma separated list of domain names.

If the HTTP_REFERER URL of the user is in this list of domains, the user is redirectet to the refering URL after a successful login.

Default

email_from

Property

email_from

Data type

Description

The sender email address of the “forgot password” emails

Default

email_fromName

Property

email_fromName

Data type

Description

The sender NAME of the “forgot password” emails

Default

tableParams_details

Property

tableParams_details

Data type

<TABLE>-params

Description

Setting the attributes of the table tag of the table displaying the user details (single display).

A class attribute is automatically appended to this string!

Default

border=0

templateFile

Property

templateFile

Data type

string

Description

This is the default template file used to render forms,

Default

EXT:newloginbox/res/newloginbox_00.html

replyTo

Property

replyTo

Data type

Description

The reply-to email address of the “forgot password” emails

Default

_CSS_DEFAULT_STYLE

Property

_CSS_DEFAULT_STYLE

Data type

string

Description

Default CSS style. You should unset this value and copy the CSS selectors to a stylesheet.

Notice that the selectors will apply to all templates in the TYPO3 database by default!

Default

_LOCAL_LANG.[langkey].[labelkey]

Property

_LOCAL_LANG.[langkey].[labelkey]

Data type

string

Description

Overriding the labels from the local lang array.

Default

_DEFAULT_PI_VARS.[piVars_key]

Property

_DEFAULT_PI_VARS.[piVars_key]

Data type

string

Description

Setting the default value of a piVars value (those values used in the post/get requests within the plugin.)

Default

0

[tsref:plugin.tx_newloginbox_pi1]

CSS styling

As with all modern plugins they are styled with CSS selectors. These are the selectors you can use. You'll (for now) have to guess/experiment which of them does what. Here is the default style assigned to the template.

Login form

.tx-newloginbox-pi1 table { border:2px solid #ccc; width:100%; }

.tx-newloginbox-pi1 th { background:#ccc; padding:4px; text- align:right; white-space:nowrap; width:25%; }

.tx-newloginbox-pi1 td { background:#eee; padding:4px; }

User list

.tx-newloginbox-pi3 table { border:2px solid #ccc; width:100%; }

.tx-newloginbox-pi3 th { background:#ccc; padding:4px; white- space:nowrap; text-align:right; }

.tx-newloginbox-pi3 td { background:#eee; padding:4px; }

.tx-newloginbox-pi3-listrow th { text-align:center; }

.tx-newloginbox-pi3-singleView th { width:25%; }

Template and common markers

Since release 2.3.0, it is possible to use template file to render the new login box. The template is set with typoscript and the default one is EXT:newloginbox/res/newloginbox_00.html

These are substituted in all newloginbox item displaying templates.

Markers

  • ###ACTION_URI### - URI of the request for the login/logout form
  • ###EXTRA_HIDDEN### - Hook required (additionnal hidden field used by kb_md5fepw extension by Kraft Bernhard)
  • ###ON_SUBMIT### - Hook required (used by kb_md5fepw extension by Kraft Bernhard)
  • ###PREFIXID### - Same as class name ('tx_newloginbox_pi1') usefull to get a unique classname prefix
  • ###REDIRECT_URL### - URL of redirection upon login
  • ###STORAGE_PID### - explicit enough I guess (if not : id of the page where user are stored)
  • ###STATUS_HEADER### - depends of the template
  • ###STATUS_MESSAGE### - depends of the template

Wrap parts

  • ###HEADER_VALID### - usefull to define what to show/hide
  • ###MESSAGE_VALID### - usefull to define what to show/hide
  • ###FORGOTP_VALID### - usefull to define what to show/hide

Newloginbox Language Markers (see pi/locallang.php)

  • ###EMAIL_LABEL### - corresponding to 'your_email'
  • ###FORGOT_PASSWORD### - corresponding to 'forgot_password'
  • ###FORGOT_PASSWORD_BACKTOLOGIN### - corresponding to 'forgot_password_backToLogin'
  • ###FORGOT_PASSWORD_ENTEREMAIL### - corresponding to 'forgot_password_enterEmail'
  • ###LOGIN_LABEL### - corresponding to 'login'
  • ###PASSWORD_LABEL### - corresponding to 'password'
  • ###SEND_PASSWORD### - corresponding to 'send_password'
  • ###USERNAME_LABEL### - corresponding to 'username'

To-Do list

See “doc/TODO.txt” inside the extension. You can also browse the wiki page here : http://wiki.typo3.org/index.php/Newloginbox

Changelog

In more recent versions, compatible with TYPO3 3.6.0 the fields created in tt_content has been REMOVED and substituted by content stored in a the “pi_flexform” field through a flexform configured by “flexform_ds.xml”.

In order to upgrade properly make sure to go to the “UPDATE!” module for the extension which is available in the function menu of the details view for the extension in the Extension Manager. This module will read all OLD values from the obsolete database fields and move it into XML in the flexform! Thus you can upgrade shoothly with no data loss!

img-22

Since newloginbox Version 3.0.1 two additional TypoScript options exist for the better login box: storagePid and showForgotPassword (see above).

img-23 New frontend login box - 13