Generate the form and data fields for logging in a user.
{{ login_form [template="<template_name>"] submit_button="<button_name>" [html_code="<html_code>"] [button_html_code="<html_code>"] }} <list_of_instructions> {{ /login_form }}
Cannot be used inside subscription and user forms. Cannot be used within itself (e.g. login in login).
A simple implementation of a login form for the public website of your publication:
{{ if ! $gimme->user->logged_in }} <p>Login</p> {{ if $gimme->login_action->is_error }} <p>There was an error logging in: {{ $gimme->login_action->error_message }}</p> {{ /if }} {{ login_form submit_button="Login" button_html_code="class=\"submitbutton\"" }} <p>User ID: {{ camp_edit object="login" attribute="uname" }}</p> <p>Password: {{camp_edit object="login" attribute="password" }}</p> {{ /login_form }} {{ else }} <p>Welcome {{ $gimme->user->name }}</p> <p><a href="?logout=true">Logout</a></p> {{ /if }}
The logout requires this code in the head of every page:
{{ if $gimme->url->get_parameter('logout') == 'true' }} <META HTTP-EQUIV="Set-Cookie" CONTENT="LoginUserId=; path=/"> <META HTTP-EQUIV="Set-Cookie" CONTENT="LoginUserKey=; path=/"> {{ $gimme->url->reset_parameter('logout') }} <META HTTP-EQUIV="Refresh" content="0;url={{ uri }}"> {{ /if }}
Generates a text input field for entering a subscriber's login user name or password. Use this to allow a subscriber to login to your site. These statements should be used inside the login form.
{{ camp_edit object="login" attribute="<attribute>" [html_code="<HTML_code>"] [size ="<field_length>"] }}
<attribute> being one of the following:
The login edit fields can only be used inside the login form.
Generates a check box; if checked the user session will be remembered for a period of two weeks so the user will not have to login again. This statement should be used inside the login form.
{{ camp_select object="login" attribute="rememberuser" [html_code="<HTML_code>"] }}
The select login field can only be used inside the login form.
There is no template keyword to logout a subscriber. Instead, just put these two lines in your logout.tpl file:
<META HTTP-EQUIV="Set-Cookie" CONTENT="LoginUserId=; path=/"> <META HTTP-EQUIV="Set-Cookie" CONTENT="LoginUserKey=; path=/">
Generate the form and data fields for adding a new user, or editing an existing user's data.
{{ user_form [template="<template_name>"] submit_button="<button_name>" [html_code="<html_code>"] [button_html_code="<html_code>"] }} <list_of_instructions> {{ /user_form }}
Cannot be used inside subscription and login forms. Cannot be used within itself (for example: user in user).
Generates a text input field for editing the selected user attribute. This statement should be used inside the user form.
{{ camp_edit object="search" attribute="<attribute>" [html_code="<HTML_code>"] [size ="<field_length>"] [columns="<max_columns>"] [rows="<max_rows>"] }}
<attribute> being one of the following:
The parameters (name, uname, email, city...) are fields describing the user's data; field1-field5, text1-text3 are extra fields for storing extra information of your choice.
Note: the columns and rows parameters were implemented starting with Newscoop version 3.2.2.
The user edit field can only be used inside the user form.
Generates a drop-down list or radio buttons for selecting values for the given fields. This statement should be used inside the user form.
{{ camp_select object="user" attribute="<attribute>" [html_code="<HTML_code>"] }}
<attribute> being one of the following:
The parameters (country, title, gender...) are fields describing the user information; pref1-pref4 are extra fields for storing extra information (the publication administrator sets their meaning).
The select user field can only be used inside the user form.
There has been error in communication with Booktype server. Not sure right now where is the problem.
You should refresh this page.