Registered Users plugin ALPHA now available

Feed 36 posts, 11 voices

Avatar
257 posts

Hi everyone, at long last I have been able to spend some serious development time with this bad boy and am happy to get a ALPHA out of the door for now.

IMPORTANT
=====
This is known not to work with installations that don’t use PDO.
Please ensure that PDO is installed and enabled on your web server before using this plugin.

ABOUT
=

This plugin will allow you to add a registration process to your Frog (0.9.5+) site.

It adds the following tables to your frog database:

permission_page registered_users_settings registered_users_temp

The administration tab is only available to Site Administrators by design.

EXTRA NOTES:
========
To protect the admin area from exposure, edit yoursite.com/frog/app/main.php line 235 to read:

redirect(URL_PUBLIC.(USE_MOD_REWRITE ? ‘/’: ‘/?/’).‘login’)

INSTRUCTIONS:
=========

1. First upload and unzip the registered_users.zip file into /frog/plugins

2. Log in to the admin are of your site and click ‘Administration’

3. Find “Registered Users” in the list and click the checkbox to activate the plugin.

4. Refresh the page and click the new “Registered Users” tab in the navigation.

5. Follow the instructions on that page. You’ll need to create 5 new page on your site and insert the code provided in order to activate all the functionality of this plugin.

6. Customise the settings of your site using the settings button on the sidebar.

7. If you want to restrict access on your site to certain types of users, edit (or add) the page as you usually would. At the end of the page, be sure to select ‘Login Required’ from the drop down menu and then check the user types you’d like to give access to. Any groups not checked here will not be able to access the page.

Please jump over to the band-x site and sign up (for free) to download it.

Any bug reports, please send directly to me at andrew@band-x.org

Hope this comes in useful!

 
Avatar
4 posts

wow! thnx a lot for the plugin

 
Avatar
651 posts

To protect the admin area from exposure, edit yoursite.com/frog/app/main.php line 235 to read:

This should not be required with Frog 0.9.5. final. The first line in backend.php specifies that you can only access the admin area if you are either:

  • administrator
  • developer
  • editor

If you’re anything else or none of the above, you’ll get redirected to the front page.

Otherwise: nice going with the plugin. :-) Haven’t had time to look it over yet but sounds great!

 
Avatar
257 posts

Hey Martijn – it is needed because a failed login attempt redireced to /admin/login rather than a login page… I’ll fix that hopefully soon

 
Avatar
35 posts

Is this plugin going to be helpful in this scenario:

People can register, and get a place to create their own stories/articles. They cannot alter other people’s stories (or see them in the Pages section).

I would also want to have a way they can upload images for their own use, and own use only.

 
Avatar
257 posts

Hi Wiag,

It will certainly help but it doesn’t intend to fulfill every wish. What you are discussing can be sped up by using this plugin. What it will give you is a way for users to register on your site and allow you to assign permissions on each page for ‘groups’ of users.

You will have to write around the core of this plugin and there are some short snippets of text you can use to authenticate users. For example, you could pass the user id in the string and get the Authorised Users id number and match them up.

The plugin doesn’t currently support account profiles but maybe that will change in the future – although I’d suggest if you need this, then you write it yourself for now as it may be a while…

Hope this helps

Andy

 
Avatar
108 posts

I have followed these instructions which are clear thanks, however i want the login page to not default to the login that is used by the admin but a form on another page templated as the site.

Does this make sense? And can anyone direct me?

 
Avatar
257 posts

Hi Andytwo…

If you create a page in your site, using this plugin you set the page type to “Login Page” and insert the following code in the page body:

<?php ru_login_page(); ?>

That should be enough to fulfill your needs.

You may want to edit the file : frog/app/views/login/login.php and delete the whole page and add this instead:

<?php header(‘Location: ‘.URL_PUBLIC.‘login’) ?>

(obviously use the correct variation for your site :)

Hope this helps

 
Avatar
108 posts

Thanks for the update Andy.

I had the page set to hidden because i didnt want it in the menu. I wonder whether this causes problems with your script?

You can see whats its doing here:
http://www.ash-eng.co.uk/

There is a link on the menu which looks ideal. But if you try and access (under downloads) software it will take you to another login page.

 
Avatar
257 posts

No it doesn’t make a difference whether it’s published or hidden…

Did changing the page type and adding the function to the page work for you?

 
Avatar
108 posts

Unfortunately not, i had this in there already. I ammended my post above your last also.

 
Avatar
257 posts

How are you restricting access to the pages?

Have you created a user group and then saved the downloads->software page to :

1. require login
2. set the appropriate group permission on the page

If you have can you check that you have set up a rejection page with the following code in it:

<?php ru_auth_required_page(); ?>

and registered this page in the backend in Registered Users -> Settings -> Setup -> Authorisation Required

 
Avatar
108 posts

Thanks for your prompt responses Andy.

Take user manuals for an example.

This is under downloads.
Page type: None
status: published
Login: required
Access: ticked boxes (including users of the admin and the customers group)

I have set the default user group to customers
allow front end login: yes
new registrations: no

and then i hvae set the appropriate pages.

http://www.ash-eng.co.uk/authorisation-needed.html

 
Avatar
257 posts

ok thanks for your patience andytwo

Could you try this:

edit file: frog/plugins/registered_users/observers/RUObservers.php

On line 42 should currently read:

header(‘Location: ‘.URL_PUBLIC.‘login’);

change to :

header(‘Location: ‘.URL_PUBLIC.‘login.html’);

This may be an oversight on my part as I don’t use .html on the end of my pages

 
Avatar
108 posts

It still redirects me to: http://www.ash-eng.co.uk/admin/login

 
Avatar
257 posts

OK, if we can establish this is not a SUFFIX issue. Change the frog/plugins/registered_users/observers/RUObservers.php back to the way it was.

Then can you try removing the suffix from the config file and try again and report back / let me take a try…

 
Avatar
108 posts

No sorry mate didnt make any difference.

 
Avatar
257 posts

OK just in case anyone was following this thread and facing the same issues, it turned out to be that the login page in the CMS was set to “Require Login” which caused an endless loop.

I’ll update the docs to make it clearer in the future :)

 
Avatar
31 posts

Hi Andy I have a similar issue. I added a login form to the Home Page wich has public access and I get this:

Not Found

The requested URL /frog_095/admin/login/login was not found on this server.

And I log in with a no admin user.

 
Avatar
257 posts

Hey Modernclics, when do you get that message? Is it when you submit the form?

 
Avatar
31 posts

Yes it happens when I submit it. I’ve been checking this whole thread, but nothing still the same, I don’t know if it has to do with my something else, I’m using wamp 2.0 @ localhost (my home computer)

 
Avatar
257 posts

OK, it sounds like it may be an environment issue.

are you using http://localhost/frog_095/ as your main site?

If so, you should have a file in /frog/app/views/login/login.php – can you check it’s there…

 
Avatar
31 posts

Yes, I replaced that with

<?php header('Location: '.URL_PUBLIC.'login') ?>

but stills the same. BTW: Now I’m just building the prototype of the site, soon I’ll move this to an external server, so if the issue is because I’m running it @ my home pc then don’t bother :).

 
Avatar
31 posts

Update: I have now my site @ webfaction.com and I was having the same issue.
Login takes me to BASE_URL/login/login

So I changed line 48 to

echo '<form action="'.URL_PUBLIC.'admin/?/login/login" method="post">'

And now works.

—-> Questions:

  • How can I add a “Logout” link?
  • If the user enters a wrong username or password it doesn’t give any message what should I change to show a message when that happens?
 
Avatar
257 posts

Hey modernclics.

I’ll be adding the error message for incorrect login soon – I don’t know how that slipped my radar, must be alpha excitement :)

Adding a logout is very simple, as you can use the internal logout() function inside the admin area. I add a page (called logout) and add this to it:

<?php ru_logout(); ?>

Hope that helps…