Frontend login

FIXME translate / engl. images (Knut)

The inserted front-end Login is a simple solution to be made possible FE-users the entrance to protected page ranges.
For the moment all registered fe-users can see approved sides!! There is no possibility to differentiate still here.

Forum: http://forum.phpwcms.org/viewtopic.php?p=94549#p94549
Forum: http://forum.phpwcms.org/viewtopic.php?p=92271#92271

Please do not confound with the external rt {FELOGIN}.

Requirements:

1. conf.inc.php:

$phpwcms['SESSION_FEinit']    = 1; // set 1 to enable sessions in frontend, 0 to disable sessions in frontend

2. user administration:

  login section: [x] frontend   [ ] backend   [ ] frontend and backend
set user active: [x] if set the user can login
  user is admin: [ ] if set the user gets admin rights !!!
   verification: [/] send an email to new user with the account information

3. site structure (child of):

frontend menu status:
[ ] hide   [ ] visible when active   [x] visible for users logged on only

status:
[x] visible   [x] public   [ ] SSL   [/] sitemap

Please place the CP frontend login into a non hidden area.

Switch on

ADMIN → site structure → [x] visible for users logged on only

For the moment all registered users can see this side. There is no possibility to differentiate still here.

User open: ADMIN → user administration



1. Site structure login site
2. Site structure for registered user



ARTICLE → Frontend-Login CP (ContentPart) - Using template at /template/inc_cntpart/felogin/



Login and Logout:

Two tags available for hiding content:

<!--LOGGED_IN_START//--> heyhey <!--LOGGED_IN_END//-->

and

<!--LOGGED_OUT_START//--> oh-oh! <!--LOGGED_OUT_END//-->


The user is logged in?

_getFeUserLoginStatus() [not available vorhanden | 1]

Forwarding example:

[PHP]
// === forwarded by redirect to Branche
if ( _getFeUserLoginStatus() ) { // === if the user is logged in, then goto ...
   Header( "HTTP/1.1 301 Moved Permanently" );
   Header( "Location: branchen.phtml" );
   // Header( "Location: index.php?branchen" );
   exit;
}
[/PHP]


Read username from session variable

Forum: http://forum.phpwcms.org/viewtopic.php?p=119716[DE]

File: template/inc_Script/frontend_render/fe_username.php

$content['all'] = str_replace(
          '{FE-URSERNAME}',
          empty($_SESSION[ session_id().'_userdata']) ? 'nicht angemeldet' : html_specialchars($_SESSION[ session_id().'_userdata']['name']),
          $content['all']
    );


Session hash: session_id()


english/phpwcms-system/article/contentparts/frontend-login/archive/frontend-login-1.txt · Last modified: 2011/12/19 01:04 by Knut Heermann (flip-flop)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0