NAVIGATION
This shows you the differences between two versions of the page.
|
english:phpwcms-system:article:contentparts:frontend-login [2011/12/19 11:31] Knut Heermann (flip-flop) |
english:phpwcms-system:article:contentparts:frontend-login [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ====== Frontend login ====== | ====== Frontend login ====== | ||
| - | FIXME translate / engl. images (Knut) | ||
| The included front-end Login Content Part is a simple solution to enable potential FE-users to access protected page ranges. \\ | The included front-end Login Content Part is a simple solution to enable potential FE-users to access protected page ranges. \\ | ||
| Line 75: | Line 74: | ||
| <file> | <file> | ||
| $phpwcms['SESSION_FEinit'] = 1; // set 1 to enable sessions in frontend, 0 to disable sessions in frontend | $phpwcms['SESSION_FEinit'] = 1; // set 1 to enable sessions in frontend, 0 to disable sessions in frontend | ||
| + | $phpwcms['allow_cntPHP_rt'] = 1; //allow PHP replacement tags and includes in content parts | ||
| </file> | </file> | ||
| \\ | \\ | ||
| + | |||
| ===== Creating FE-Users: ===== | ===== Creating FE-Users: ===== | ||
| Line 134: | Line 135: | ||
| <note important> | <note important> | ||
| - | Please place the CP frontend login into a **non hidden** area, oder holen Sie diesen CP mit TAG %%{SHOW_CONTENT:...}%% oder einem "Contetpart Alias" aus dem versteckten Bereich. \\ | + | Please place the CP frontend login into a **non hidden** area, or you can get this CP with the TAG %%{SHOW_CONTENT:...}%% or "Contetpart Alias" from the hidden area. \\ |
| - | (Zweite Methode hier angewendet). | + | (Second method used here //%%{SHOW_CONTENT:...}%%//). |
| </note> | </note> | ||
| In the picture **Site structure** You also see a hidden area %%"--- hidden"%%, which does not appear in the FE in the navigation. //(Please distinguish between protection and access to "hide in the NAVI")//. | In the picture **Site structure** You also see a hidden area %%"--- hidden"%%, which does not appear in the FE in the navigation. //(Please distinguish between protection and access to "hide in the NAVI")//. | ||
| - | In this section articles and CPs are stored, which system internally or by example by a tag like wie %%{SHOW_CONTENT:...}%% be used. | + | In this section articles and CPs are stored, which be used system internally or by example be used selectively by a TAG like %%{SHOW_CONTENT:...}%% . |
| * Please create a hidden area //(The name must not be %%"--- hidden"%%)//. | * Please create a hidden area //(The name must not be %%"--- hidden"%%)//. | ||
| Line 148: | Line 149: | ||
| - | * Please create beneath %%"--- hidden"%% the following category tree:\\ %%-- FE-Login/Logout%% \\ %%---- FE-Login%% \\ %%---- FE-Logout%% \\ | + | * Please create beneath %%"--- hidden"%% the following category tree: |
| + | * %%--- hidden%% | ||
| + | * %%FE-Login/Logout%% | ||
| + | * %%FE-Login%% | ||
| + | * %%FE-Logout%% | ||
| + | \\ | ||
| **ADMIN -> Site structure** (Category in hidden area)\\ | **ADMIN -> Site structure** (Category in hidden area)\\ | ||
| + | * %%--- hidden%% | ||
| + | * **%%FE-Login/Logout%%** //(alias can be chosen freely)// \\ | ||
| + | {{:deutsch:phpwcms-system:artikel:contentparts:fe_login_loginlogout01_1.gif|}} | ||
| + | |||
| + | * %%--- hidden%% | ||
| + | * %%FE-Login/Logout%% | ||
| + | * **%%FE-Login%%** //(as in the image below with the alias "fe-login")// | ||
| + | * **%%FE-Logout%%** //(without a picture: Please also create with the alias "fe-logout")// | ||
| {{:english:phpwcms-system:article:contentparts:fe_login_fe-login_be01_en_1.gif|}} | {{:english:phpwcms-system:article:contentparts:fe_login_fe-login_be01_en_1.gif|}} | ||
| + | |||
| These categories are simply designed to keep a better overview and to decouple the "frontend login" CPs from the general content display. | These categories are simply designed to keep a better overview and to decouple the "frontend login" CPs from the general content display. | ||
| Line 169: | Line 183: | ||
| **ARTICLE** \\ | **ARTICLE** \\ | ||
| + | |||
| + | Now we create the article. Once in the category of FE-login and once in the category of FE-Logout for a later insert of the two CPs. \\ | ||
| + | Name and alias of the article can be freely chosen. | ||
| + | |||
| {{:english:phpwcms-system:article:contentparts:fe_login_article_site_structure_be01_en_1.gif|}} | {{:english:phpwcms-system:article:contentparts:fe_login_article_site_structure_be01_en_1.gif|}} | ||
| Line 175: | Line 193: | ||
| ==== CP Frontent Login ==== | ==== CP Frontent Login ==== | ||
| - | Es werden zwei CPs "Frontent Login" angelegt, ein CP für das Login und ein CP für das Logout. \\ | + | We create two CPs of type "Frontend Login" to: |
| - | We create two CPs "frontend login", one for the login and one for the logout. | + | |
| + | * one for the **login** within the **category of "FE-login"** in the **article "LogIn for Frontend-User"** \\ with the **template "fe_login_en.tmpl"** //(pictured here)//. | ||
| + | * one for the **logout** within the **category of "FE-logout"** in the **article "LogOut for Frontend-User"** \\ with the **template "fe_logout_en.tmpl"** //(not pictured here)//. | ||
| + | |||
| + | |||
| + | These two CPs differ only by the used template and be placed in different categories -> articles. \\ | ||
| **ARTICLE -> frontend login CP (ContentPart)** - With templates in /template/inc_cntpart/felogin/ \\ | **ARTICLE -> frontend login CP (ContentPart)** - With templates in /template/inc_cntpart/felogin/ \\ | ||
| {{:english:phpwcms-system:article:contentparts:fe_login_cp_fe_login_be0_1en_1.gif|}} | {{:english:phpwcms-system:article:contentparts:fe_login_cp_fe_login_be0_1en_1.gif|}} | ||
| - | These two CPs differ only by the used template. | + | |
| It is only checked against the user database, **not** to the user profile database. | It is only checked against the user database, **not** to the user profile database. | ||
| Line 190: | Line 214: | ||
| ==== Template FE-LOGIN ==== | ==== Template FE-LOGIN ==== | ||
| - | File: fe_login_de.tmpl \\ | + | File: fe_login_en.tmpl \\ |
| Folder: template/inc_cntpart/felogin/* | Folder: template/inc_cntpart/felogin/* | ||
| Line 200: | Line 224: | ||
| - | <code html |h fe_login_de.tmpl |h> | + | <code html |h fe_login_en.tmpl |h> |
| <!-- NOTICE: Convert file to charset of site --> | <!-- NOTICE: Convert file to charset of site --> | ||
| Line 207: | Line 231: | ||
| ; please: do not use comments for value lines | ; please: do not use comments for value lines | ||
| ; Cookie expire set to 90 days | ; Cookie expire set to 90 days | ||
| - | date_format = "%d/%m/%y" | + | date_format = "%m/%d/%y" |
| - | set_locale = "de_DE" | + | set_locale = "en" |
| cookie_expire = 7776000 | cookie_expire = 7776000 | ||
| <!--LOGIN_SETTINGS_END//--> | <!--LOGIN_SETTINGS_END//--> | ||
| Line 218: | Line 242: | ||
| [ERROR] | [ERROR] | ||
| <br /> | <br /> | ||
| - | <h3 style="color:red">Anmeldefehler:</style></h3> | + | <h3 style="color:red">Login error:</style></h3> |
| <br /> | <br /> | ||
| <p class="error"> | <p class="error"> | ||
| - | Anmeldename und/oder Passwort ist/sind nicht richtig. <br /> | + | Login and/or password not valid. <br /> |
| - | Sollten Sie Ihren Anmeldenamen und/oder Passwort vergessen haben, <br /> | + | In case you have forgotten your user name or password, <br /> |
| - | senden Sie uns bitte eine [MAIL info@example.com]E-Mail[/MAIL]. | + | please send an email to [MAIL info@example.com]E-Mail[/MAIL]. |
| </p> | </p> | ||
| [/ERROR][ERROR_ELSE] | [/ERROR][ERROR_ELSE] | ||
| <br /> | <br /> | ||
| - | <h2>Bitte melden Sie sich an:</h2> | + | <h2>Please login:</h2> |
| <br /> | <br /> | ||
| <p> | <p> | ||
| - | Einige Bereiche unserer Seite sind nur für angemeldete Benutzer zugänglich. <br /> | + | Some contents on our page are only availabe for logged in users. <br /> |
| - | Bitte geben Sie ihre Anmeldedaten ein! | + | Fill in your acount data, please! |
| </p> | </p> | ||
| [/ERROR_ELSE] | [/ERROR_ELSE] | ||
| Line 237: | Line 261: | ||
| <form action="{FORM_TARGET}" method="post" name="feLoginForm" id="feLoginForm"> | <form action="{FORM_TARGET}" method="post" name="feLoginForm" id="feLoginForm"> | ||
| - | <label for="feLogin">Benutzername:</label> | + | <label for="feLogin">User name:</label> |
| <input type="text" name="feLogin" id="feLogin" value="{LOGIN}" /> | <input type="text" name="feLogin" id="feLogin" value="{LOGIN}" /> | ||
| - | <label for="fePassword">Passwort:</label> | + | <label for="fePassword">Password:</label> |
| <input type="password" name="fePassword" id="fePassword" value="{PASSWORD}" /> | <input type="password" name="fePassword" id="fePassword" value="{PASSWORD}" /> | ||
| <div class="ku_login"> | <div class="ku_login"> | ||
| - | <input class= "logInButton" type="submit" value="Anmelden" name="feSubmit" id="feSubmit" /> | + | <input class= "logInButton" type="submit" value="Login" name="feSubmit" id="feSubmit" /> |
| </div> | </div> | ||
| Line 251: | Line 275: | ||
| <div class="link-unten"> | <div class="link-unten"> | ||
| <p> | <p> | ||
| - | Benutzername/Passwort vergessen?<br /> | + | Forgotten your user name or password?<br /> |
| - | Bitte senden sie uns eine [MAIL info@example.com]E-Mail[/MAIL]. | + | Please send an email to [MAIL info@example.com]E-Mail[/MAIL]. |
| </p> | </p> | ||
| </div> | </div> | ||
| Line 263: | Line 287: | ||
| [PHP] | [PHP] | ||
| - | // === weiterleiten per redirect nach Category 06 | + | // === forwarded by redirect to Category 06 |
| - | if ( _getFeUserLoginStatus()) { // === ist der User eingeloggt, dann weiter | + | if ( _getFeUserLoginStatus()) { // === the user is logged in, then |
| // headerRedirect('category05.phtml', 301); | // headerRedirect('category05.phtml', 301); | ||
| headerRedirect('index.php?category05', 301); | headerRedirect('index.php?category05', 301); | ||
| Line 282: | Line 306: | ||
| <!--LOGIN_IS_END//--> | <!--LOGIN_IS_END//--> | ||
| </code> | </code> | ||
| + | |||
| + | \\ | ||
| + | If an automatic transmission is not desired, a link can be used. If so, please replace the entire part **%%[PHP] ..... [/PHP]%%** with: | ||
| + | <file> | ||
| + | [PHP] | ||
| + | // === forwarded by link | ||
| + | if ( _getFeUserLoginStatus()) { // === the user is logged in, then continue. | ||
| + | echo '<br />Please follow the link: <a href="index.php?MyLandingPagesAlias">My link text</a>'.LF; | ||
| + | } | ||
| + | [/PHP] | ||
| + | </file> | ||
| + | |||
| \\ | \\ | ||
| Line 288: | Line 324: | ||
| ==== Template FE-LOGOUT ==== | ==== Template FE-LOGOUT ==== | ||
| - | File: fe_logout_de.tmpl \\ | + | File: fe_logout_en.tmpl \\ |
| Folder: template/inc_cntpart/felogin/* | Folder: template/inc_cntpart/felogin/* | ||
| \\ | \\ | ||
| One entries must be adjusted, | One entries must be adjusted, | ||
| - | * The jump destination for the automatic Forwarded to the registration form on line 9: \\ <file><form action="index.php?fe-login" method="post" name="feLogoutForm" id="feLogoutForm"></file> | + | * The jump destination //(alias here "fe-login")// for the automatic Forwarded to the registration form on line 9: \\ //(If you proceed exactly according to this description, eliminates this adjustment, see category-alias FE-login)// \\ <file><form action="index.php?fe-login" method="post" name="feLogoutForm" id="feLogoutForm"></file> |
| - | <code html |h fe_logout_de.tmpl |h> | + | <code html |h fe_logout_en.tmpl |h> |
| <!-- NOTICE: Convert file to charset of site --> | <!-- NOTICE: Convert file to charset of site --> | ||
| Line 302: | Line 338: | ||
| <div class="feLogOut"> | <div class="feLogOut"> | ||
| - | <div>Sie sind angemeldet als: <span style="color: #666; font-weight: bold;">{LOGIN}</span></div> | + | <div>You are logged in as: <span style="color: #666; font-weight: bold;">{LOGIN}</span></div> |
| <!-- {FORM_TARGET} //--> | <!-- {FORM_TARGET} //--> | ||
| <div > | <div > | ||
| <form action="index.php?fe-login" method="post" name="feLogoutForm" id="feLogoutForm"> | <form action="index.php?fe-login" method="post" name="feLogoutForm" id="feLogoutForm"> | ||
| - | <input class= "logOutButton" type="submit" value="[ Abmelden ]" name="feLogout" id="feLogout" /> | + | <input class= "logOutButton" type="submit" value="[ Logout ]" name="feLogout" id="feLogout" /> |
| </form> | </form> | ||
| </div> | </div> | ||
| Line 517: | Line 553: | ||
| </code> | </code> | ||
| - | The CP ID n ##{SHOW_CONTENT:CP,24}## needs to be paired with the ID of the CP in which the template fe_logout_de.tmpl is used. | + | The CP ID in ##{SHOW_CONTENT:CP,24}## needs to be paired with the ID of the CP in which the template fe_logout_en.tmpl is used. |
| ~~UP~~ | ~~UP~~ | ||
| Line 527: | Line 563: | ||
| - | ===== Two tags available for hiding content: ===== | + | ===== Little helpers ===== |
| + | |||
| + | |||
| + | ==== Two tags available for hiding content: ==== | ||
| == <!--LOGGED_IN_START//--> heyhey <!--LOGGED_IN_END//--> == | == <!--LOGGED_IN_START//--> heyhey <!--LOGGED_IN_END//--> == | ||
| Line 535: | Line 574: | ||
| \\ | \\ | ||
| + | == Example for a template == | ||
| - | === The user is logged in? === | + | <code html> |
| + | <!--LOGGED_OUT_START//--> | ||
| + | <a href="index.php?customer-information">Customer Information</a> | ||
| + | <!--LOGGED_OUT_END//--> | ||
| + | <!--LOGGED_IN_START//--> | ||
| + | <a href="{URL}"{URL_TARGET}>[URL_TEXT]{URL_TEXT}[/URL_TEXT][URL_TEXT_ELSE]more...[/URL_TEXT_ELSE]</a> | ||
| + | <!--LOGGED_IN_END//--> | ||
| + | </code> | ||
| + | |||
| + | ==== The user is logged in? ==== | ||
| ##%%_getFeUserLoginStatus()%%## [not available vorhanden | 1] | ##%%_getFeUserLoginStatus()%%## [not available vorhanden | 1] | ||
| - | **Forwarding example:** | + | === Forwarding example: === |
| + | |||
| <code php> | <code php> | ||
| [PHP] | [PHP] | ||
| - | // === forwarded by redirect to Branche | + | // === forwarded by redirect to a category |
| if ( _getFeUserLoginStatus() ) { // === if the user is logged in, then goto ... | if ( _getFeUserLoginStatus() ) { // === if the user is logged in, then goto ... | ||
| - | Header( "HTTP/1.1 301 Moved Permanently" ); | + | // headerRedirect('category_alias.phtml', 301); |
| - | Header( "Location: branchen.phtml" ); | + | headerRedirect('index.php?category_alias', 301); |
| - | // Header( "Location: index.php?branchen" ); | + | |
| exit; | exit; | ||
| } | } | ||
| [/PHP] | [/PHP] | ||
| - | |||
| </code> | </code> | ||