{{indexmenu_n>200}}
====== 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 [[:english:other-enhancements:felogin|{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** \\
{{:deutsch:phpwcms-system:artikel:contentparts:frontendlogin04hp5.gif|}}
----
\\
**1. Site structure login site** \\
**2. Site structure for registered user** \\
{{:deutsch:phpwcms-system:artikel:contentparts:frontendlogin01iw9.gif|}}
----
\\
**ARTICLE -> Frontend-Login CP (ContentPart) - Using template at /template/inc_cntpart/felogin/** \\
{{:deutsch:phpwcms-system:artikel:contentparts:frontendlogin02wg5.gif|}}
----
\\
**Login and Logout:** \\
{{:deutsch:phpwcms-system:artikel:contentparts:frontendlogin03ba0.gif|}}
==== Two tags available for hiding content: ====
== heyhey ==
and\\
== oh-oh! ==
\\
=== 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()%%##
\\