1. Add memberslogin() to template
Open template and add this <?php echo memberslogin(); ?> where the login form should be located.
2. Make a login error page
The script redirects you to a page called login error if username or password is not correct. so make a page with heading "login_error" and hide it with cmsimple hide
Code:
<H1>login error</H1>
#CMSimple hide#
You gave in wrong password or username, please try again!
Note : This is the default behaviour the page can be changed to something else please go to 11 bewlow to see how, but i might bee a good idea to make the basic things work first before changing anything!
3. Make a memberspage
Make a page and add #CMSimple $output.=memberspage("Member_Not_logged_in","1");# to the page between heading and actual text. In the example the script will redirect you to a page with heading "Member Not logged in" if you are not logged in or have a different access level than 1, in the case you have right accesslevel you will see "hello there"
Code:
<H1>memberspage</H1>
#CMSimple $output.=memberspage("Member_Not_logged_in","1");# hello there
4. Making the member not logged in page
You then just have to add the "Member_Not_logged_in" page and hide it as with the login error page.
Code:
<H1>Member Not logged in</H1>
#CMSimple hide#
You do not have access to this page!
5. Managing the memberpages plugin
The plugin can be managed by logging into cmsimple as admin, select the memberpages plugin from the avaliable plugins drop downbox. and you are off, the users are managed in the config settings, the stylesheet and language also use the corresponding buttons.
The default setup gives you 3 users called user1, user2 and user3.
After successfull login you will see thelogin for change to something likeuser1 has password=pass1 and accesslevel=1
user2 has password=pass2 and accesslevel=2
user3 has password=pass3 and accesslevel=3
6. Loading users from csv fileThe plugin can load users and passwords from a different location, this is done by setting the value $plugin_cf['memberpages']['csvfile'] default it is not set but setting the valu will load users from a file placed somewhere on your server. The syntax of the file must be like this user, password, accesslevel, the fields can be seperated by either ;:/.-
7. Remember meBy default a remember me function is avaliable, the plugin saves a cookie on the users computer then the user dosen't have to login everytime the pages are visited. To disable the "rememberme" function set the variable $plugin_cf['memberpages']['rememberme'] to false in the advanced settings menu
8. LogfileBy default logging of user actions are logged in the file "logfile.txt" placed in the memberpages plugin folder, to disable the logging set the variable $plugin_cf['memberpages']['logfile'] to false in the advanced settings menu
9. login_pageIn case of OK user/password: "logged in" page is loaded. This page can be specified in the plugin-config. If the setting is null (default), the redirection is to the active page itself, the from where you where reloads
10. logout_pageWhen the user clicks the logout-button, he is redirected to the "logged out" page. This page can be specified in the plugin-config. If the setting is null (default), the redirection is to the active page itself.
11. error_pageIn case of wrong user/password: "login error" page. This page can be specified to another location in the plugin config (use underscores to replace spaces)
12. hide_pagesThe plugin-config allows you to set "Hide pages" to true or false.When 'false', the memberpages are always visible to toc(), search() and sitemap().When 'true', they are only visible for their corresponding accesslevel-users. This is only supported from cmsimple version 2.7 and up..