Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Front End User Login Plugin (XML Or Database - ver: 3.0)
#1
User Login Plugin
Click Here To Download From Extend
View GitHub Repos.

Outline Of Plugin:
  • Users Can Register For An Account
  • Users Can Sign In And Logout
  • Pages Can Be Protected Via A Checkbox On Edit Page Screen
  • CSS For All Plugin Related Elements Can Be Edited Via Plugin Settings Page In Admin
  • Protected Page Message Can Be Edited Via WYSIWYG Editor In Plugins Settings Page - (The Protected Message is what shows up if the user is not logged in and is trying to view a protected page)
  • Features "Email All Users" form to easily send emails to all your site's users. The email form has fields for changing the "from address", "subject line", and ckeditor textarea to edit the message body. The message can contain html/css/js etc..
  • Expanded User Login Plugin Management via "Manage Users" page accessible through settings page. You can now add, edit, delete, and view all users.
  • An email is sent to the user upon them registering. It includes their username, password, and a link your website. The "From" Address can be edited from the plugins settings page (However, it can remain the default, noreply@yourdomain.com).

Instructions:

Step 1: Drag The contents of user-login.zip into the plugins folder

Step 2:Protect Desired Pages

Step 3: Include plugin functions in theme

Step 4: Go to the plugins settings page (User Management->Settings) and choose storage method if you plan on using a database


Below Are The Available Functions:
  • The Below Code Displays The Login Form
Code:
<?php echo show_login_box(); ?>
  • The Below Code Displays The Welcome Message & logout Link (Shown When User Is Logged In)
Code:
<?php echo welcome_message_login(); ?>
  • The Below Code Displays The Register Form
Code:
<?php user_login_register(); ?>


An Example Of Usage For The Innovation Theme:
In sidebar.php You will see I added the welcome message, login box, and register box (Looks Towards The Bottom of The Code).
Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
/****************************************************
*
* @File:             sidebar.php
* @Package:        GetSimple
* @Action:        Innovation theme for the GetSimple 3.0
*
*****************************************************/
?><aside id="sidebar">

    <div class="section" id="socialmedia" >
        <h2>Connect</h2>
        <div class="icons">
            
            <!-- Social Media URLs are set within this theme's settings plugin -->
            <?php if (defined('FACEBOOK')) { ?>
                <a href="<?php echo FACEBOOK; ?>"><img src="<?php get_theme_url(); ?>/assets/images/facebook.png" /></a>
            <?php } ?>
            <?php if (defined('TWITTER')) { ?>
                <a href="<?php echo TWITTER; ?>"><img src="<?php get_theme_url(); ?>/assets/images/twitter.png" /></a>
            <?php } ?>
            <?php if (defined('LINKEDIN')) { ?>
                <a href="<?php echo LINKEDIN; ?>"><img src="<?php get_theme_url(); ?>/assets/images/linkedin.png" /></a>
            <?php } ?>
            
            <img src="<?php get_theme_url(); ?>/assets/images/break.png" />
            
            <!-- addthis popup - you can add your username if you want analytics: http://www.addthis.com/help/customizing-addthis -->
            <div class="addthis_toolbox" style="display:inline;width:24px;" >
                <a href="http://www.addthis.com/bookmark.php?v=250" class="addthis_button_compact"><img src="<?php get_theme_url(); ?>/assets/images/share.png" /></a>
            </div>
            <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
        </div>
        <?php echo welcome_message_login(); echo show_login_box(); ?>
        <?php user_login_register(); ?>
    </div>
    
    
    <!-- wrap each sidebar section like this -->
    <div class="section">
        <?php get_component('sidebar');    ?>
    </div>

    
</aside>

I appreciate any & all input & Suggestions!

In version 3.0 the plugin has been completely re-coded to allow for the future addition of paypal integration and custom fields.

IF THE AUTO DATABASE/DATABASE TABLE CREATE FAILS::
You will have to create them yourself.
Below is the SQL coding to create the table (Change 'db_table_name_on_settings_form' to the table name you chose on settings form)
Code:
CREATE TABLE `db_table_name_on_settings_form` (
                    userID INT NOT NULL AUTO_INCREMENT,
                    PRIMARY KEY(userID),
                    `Username` text,
                    `Password` text,
                    `EmailAddress` text
                    )
Reply
#2
Hello Mikeh,

I've got this plug-in running and would like to add a few points / questions:
  • It might be useful to add to your description something along the lines of this plug-in being functionally seperate to your other 'Multi-User' plug-in, which is for the back-end (Yes, I took a while to work this out ... did a complete reinstall on the way ....)
  • Is there a way or is there going to be a way to see / administer who has logged on? (Add & delete users, send out an e-mail, etc.)
  • When I'm asked to give an e-mail address when I'm registering at a site, then I automatically think that I'm about to recieve a registration mail. Whilst I can add a text to the registration box to state that this isn't the case here, I wonder if you're planning this as an option for later?
  • Passwords in the login field are legible. Will you be changing this?
  • Are you planning to link up this plug-in with the 'Multi-User' plug-in (common data folder or similar)?
I find this approach with a semi-secure login interesting and will be keeping an eye on it for the future.

I was hoping that it would have been possible for me to use this plug-in to restrict pages to individual users (eg a download page only for user x and a gallery only for user y) but this doesn't appear to be possible at the moment.

Keep up the good work,

Alan
Web Developer and Translator (German > English)
Reply
#3
Alan-A Wrote:Hello Mikeh,

I've got this plug-in running and would like to add a few points / questions:
  • It might be useful to add to your description something along the lines of this plug-in being functionally seperate to your other 'Multi-User' plug-in, which is for the back-end (Yes, I took a while to work this out ... did a complete reinstall on the way ....)
  • Is there a way or is there going to be a way to see / administer who has logged on? (Add & delete users, send out an e-mail, etc.)
  • When I'm asked to give an e-mail address when I'm registering at a site, then I automatically think that I'm about to recieve a registration mail. Whilst I can add a text to the registration box to state that this isn't the case here, I wonder if you're planning this as an option for later?
  • Passwords in the login field are legible. Will you be changing this?
  • Are you planning to link up this plug-in with the 'Multi-User' plug-in (common data folder or similar)?
I find this approach with a semi-secure login interesting and will be keeping an eye on it for the future.

I was hoping that it would have been possible for me to use this plug-in to restrict pages to individual users (eg a download page only for user x and a gallery only for user y) but this doesn't appear to be possible at the moment.

Keep up the good work,

Alan

Thank You for your input.
The plugin is at a basic State of Functionality now, so I am trying to get feature suggestions. Your list helps alot. I can assure you I will do everything on your list except integration into my multi-user plugin (I am not sure on a practical and easy way to do that at this point).
Reply
#4
Awesome work, Mikeh. Things are working pretty darned well, and this is a great way to allow for Members-Only content on the site, which I've thought to be very desirable.

Taking on Alan-A's comments will definitely make this more safe to use, so prioritise yourself with his suggestions. I have some of my own if you either have the time or also think of them as relevant:
  • Allow for either the CSS (of the login box) to be editable or just have the basic CSS as an example file for people to integrate to their own layouts. This just makes things easier to stylise from a newbie's standpoint.
  • Allow for components to also be protected, so certain widgets in a sidebar only show once the user is logged in?
  • (Not important at all) Include a 'members.css' file that enables certain elements of the layout itself to be different for when logged in (eg the background can be different, or the banner image changes if the banner image is the background for a css element)
  • A 'forgot password' section where members can either reset their password or send a message to the admin about their login?
  • Or an easier alternative may be a Secret Question/Answer field on registering in the event of forgetting the password.
  • (Probably difficult) Password strength indicator as they register? Or better still, a CAPTCHA system to prevent bots registering?
  • Perhaps consider an optional integration with other social network logins, such as Facebook and GooglePlus?

Good luck with this plugin's progress. This is one I'm really looking forward to the growth of. Smile
Reply
#5
Angryboy Wrote:Allow for components to also be protected, so certain widgets in a sidebar only show once the user is logged in?
That sounds like a cool idea!
Reply
#6
Angryboy Wrote:Awesome work, Mikeh. Things are working pretty darned well, and this is a great way to allow for Members-Only content on the site, which I've thought to be very desirable.

Taking on Alan-A's comments will definitely make this more safe to use, so prioritise yourself with his suggestions. I have some of my own if you either have the time or also think of them as relevant:
  • Allow for either the CSS (of the login box) to be editable or just have the basic CSS as an example file for people to integrate to their own layouts. This just makes things easier to stylise from a newbie's standpoint.
  • Allow for components to also be protected, so certain widgets in a sidebar only show once the user is logged in?
  • (Not important at all) Include a 'members.css' file that enables certain elements of the layout itself to be different for when logged in (eg the background can be different, or the banner image changes if the banner image is the background for a css element)
  • A 'forgot password' section where members can either reset their password or send a message to the admin about their login?
  • Or an easier alternative may be a Secret Question/Answer field on registering in the event of forgetting the password.
  • (Probably difficult) Password strength indicator as they register? Or better still, a CAPTCHA system to prevent bots registering?
  • Perhaps consider an optional integration with other social network logins, such as Facebook and GooglePlus?

Good luck with this plugin's progress. This is one I'm really looking forward to the growth of. Smile

Great Suggestions (As were your suggestions for the multi-user plugin)!

One of the suggestions is already completed. There is a page to edit the css for login box, welcome box, and register box.

Below is a screenshot
[Image: admin-login.PNG]


Note: There is also a wysiwyg editor to edit the "Protected Message"
Reply
#7
Fast work, man! Smile Really looking forward to the next update. Big Grin
Reply
#8
Version 2.0 Has Been Updated To Extend

Changes:

- Expanded User Login Plugin Management via "Manage Users" page accessible through settings page. You can now add, edit, delete, and view all users.

- An email is now sent to the user upon them registering. It includes their username, password, and a link your website. The "From" Address can be edited from the plugins settings page (However, it can remain the default, noreply@yourdomain.com).


Screenshots:

Manage Users:
[Image: manage-users.png]


Add User:
[Image: manage-users-2.png]


Edit CSS, Protected Message, And "From Email":
[Image: plugin-settings.png]
Reply
#9
Mikeh the plugin is great but this XML version is not working for me. In admin settings page i click on the add users button and it doesn't show me anything. Also when i try to register or login from the front end i just get a page doesn't exist from my hosting provider. I am using several plugins mostly I18N and a few others. The previous version which used the mysql database was working fine before I installed this.
Reply
#10
usmandgreat Wrote:Mikeh the plugin is great but this XML version is not working for me. In admin settings page i click on the add users button and it doesn't show me anything. Also when i try to register or login from the front end i just get a page doesn't exist from my hosting provider. I am using several plugins mostly I18N and a few others. The previous version which used the mysql database was working fine before I installed this.

Hello usmandgreat,

Sorry you are experiencing issues.

Can you please provide some more details about these issues such as debug errors and browser?
Reply
#11
usmandgreat Wrote:Mikeh the plugin is great but this XML version is not working for me. In admin settings page i click on the add users button and it doesn't show me anything. Also when i try to register or login from the front end i just get a page doesn't exist from my hosting provider. I am using several plugins mostly I18N and a few others. The previous version which used the mysql database was working fine before I installed this.

Are you assuming accounts created while using the MySQL version will work with xml version? There is no conversion included so accounts in your database will not work with the xml version.

If that is the case and you have numerous users already in your database, I will be more then happy to write you a script to convert the database to xml files.

Edit: I will create the script for free so let me know if you would like me too
Reply
#12
Version 2.5 Uploaded To Extend

Changes:
  • Added "Email All Users" form to easily send emails to all your site's users. The email form has fields for changing the "from address", "subject line", and ckeditor textarea to edit the message body. The message can contain html/css/js etc..

Screenshot:
[Image: email-users.png]
Reply
#13
1. Can we have user profiles and profile pictures?
2. Can we restrict user access in the admin area to certain pages and photo galleries and to only be able to edit /delete his own news manager posts?
Reply
#14
Hello Mikeh

I managed to solve the problem by changing your code a little. The problem is here

Code:
<form method="post" action="'.$site_url.'/'.$the_page_slug.'" name="loginform" id="loginform">

When the submit button is clicked it posts the data to SLUG i.e www.yoursite.com/index
where index is the slug of the actual page index.php. When i was testing it locally on my computer it was working fine but when I uploaded it and tried to login it showed me 404 page doesnt exist because the url above is incomplete. So I changed that code to this

Code:
<form method="post" action="index.php?id='.$the_page_slug.'" name="loginform" id="loginform">

Now it works perfectly, when you submit it it goes to the actual page i.e www.yoursite.com/index.php?id=index

This url works both locally and on my hosting server.

I aslo changed the same code for register button and logout button.
Reply
#15
usmandgreat Wrote:Hello Mikeh

I managed to solve the problem by changing your code a little. The problem is here

Code:
<form method="post" action="'.$site_url.'/'.$the_page_slug.'" name="loginform" id="loginform">

When the submit button is clicked it posts the data to SLUG i.e www.yoursite.com/index
where index is the slug of the actual page index.php. When i was testing it locally on my computer it was working fine but when I uploaded it and tried to login it showed me 404 page doesnt exist because the url above is incomplete. So I changed that code to this

Code:
<form method="post" action="index.php?id='.$the_page_slug.'" name="loginform" id="loginform">

Now it works perfectly, when you submit it it goes to the actual page i.e www.yoursite.com/index.php?id=index

This url works both locally and on my hosting server.

I aslo changed the same code for register button and logout button.

Great, I'll make those change and upload to extend.
Any other features you think would be useful?
Reply
#16
Code:
Notice: Undefined index: id in /home/u099886477/public_html/plugins/user_login.php on line 568

Warning: file_get_contents(/home/u099886477/public_html/data/pages/.xml) [function.file-get-contents]: failed to open stream: No such file or directory in /home/u099886477/public_html/admin/inc/basic.php on line 218

Notice: Trying to get property of non-object in /home/u099886477/public_html/plugins/user_login.php on line 573
This is the error that appears when I create pages (when you open the 'Page Properties' screen). I can still create pages no problem afterwards, and the error disappears when I edit them, but I just wonder what causes it.

Only other problem I see is that as I made edits to the CSS of the Login Container box, it seemed to push the information out of the below text-fields. The way I see it, you don't really need to have the CSS editable from within the settings: just provide a basic framework to work from in the root folder of the plugin. This means that users who want to style it up simply copy-paste the framework into their templates and have everything under control from within there.

Otherwise, everything else is working very nicely, and the progress is rapid so keep this up Mikeh Smile Haven't been excited about a plugin's development in a while, so this is great to see Big Grin
Reply
#17
Angryboy Wrote:
Code:
Notice: Undefined index: id in /home/u099886477/public_html/plugins/user_login.php on line 568

Warning: file_get_contents(/home/u099886477/public_html/data/pages/.xml) [function.file-get-contents]: failed to open stream: No such file or directory in /home/u099886477/public_html/admin/inc/basic.php on line 218

Notice: Trying to get property of non-object in /home/u099886477/public_html/plugins/user_login.php on line 573
This is the error that appears when I create pages (when you open the 'Page Properties' screen). I can still create pages no problem afterwards, and the error disappears when I edit them, but I just wonder what causes it.

Only other problem I see is that as I made edits to the CSS of the Login Container box, it seemed to push the information out of the below text-fields. The way I see it, you don't really need to have the CSS editable from within the settings: just provide a basic framework to work from in the root folder of the plugin. This means that users who want to style it up simply copy-paste the framework into their templates and have everything under control from within there.

Otherwise, everything else is working very nicely, and the progress is rapid so keep this up Mikeh Smile Haven't been excited about a plugin's development in a while, so this is great to see Big Grin

Those errors would not cause any problems. I just forgot to put a if(isset()) when defining a couple variables. The next version will fix the errors.

I will look into the CSS of the login box, I could not replicate it so far.

I did take into consideration your suggestion about the css not needing to be update-able through the backend. You are probably right, so until I implement something, I changed the "Edit CSS & Protected Message" tab to "Advanced Options".

I need some opinions on the below feature.

User Login Specific Content
I am creating a way to add login specific content to your template files easily. By login specific I mean, content that is only shown to the user when there logged in and content that is only shown to them when they are not logged in. This can be especially useful if you are loading advertisements in your template and do not want those ads to show for logged in users (It would have many many other uses as well).

The next version will include this feature and I am debating about the best way to implement it.
Right now I am going towards a "Component" like approach. Meaning on the "User Login" admin page, there is a tab called "User Content". From there it lists all the User Login Specific Content and allows you to add new content. Then that content would be included in your template using a simple function with the component name.

ex:
Code:
<?php GetLoginComponent('user-ads'); ?>

Can anyone think of a better way to implement this, or have any suggestions/comments?
Reply
#18
That's good to hear then Smile

I suppose it would be a self-tooting of the horn to support the feature Tongue Your method seems the most easily workable at the moment, and it does the job just fine. Other methods you can think of (if they are achievable) are:

- Tickboxes for normal components that make them public/members only when output
- Your own [membersonly] [/membersonly] tags or something with a similar feature to this to put around the desired content
- A css class in the body tag called .loggedin or .member that is echoed once logged in so individual (and mass) html elements can be displayed as 'auto' or 'none' with css (in fact, this could be the quickest way for you to put the feature in: people just ensure that when their elements are within the 'logged in' class that the display setting is different). Downside: it is merely cosmetic, so the content will still be in the source code for people to see.
Reply
#19
@mikeh

thanks again for your wundeful extension.

i followed your instructions, but one thing won't work:
- i want to add manually users to the webseite
--> settings -> manage users -> add new user

nothing happens.
only the url changes from
Code:
/admin/load.php?id=user_login&manage=yes
to
Code:
/admin/load.php?id=user_login&manage=yes#

the html says:
Code:
<a id="add-user" href="#">Add New User</a>

do you have any ideas? something missing? javascript etc?

thanks and keep up your great coding!
chainsaw81
Reply
#20
another (small) issue ...

CSS for the check-box "member only" effects some floating-bug (see picture)
Code:
<div style="width: 95px; margin-bottom: 20px; float: left;">
    <label for="post-template">Members Only:</label>
    <input type="checkbox" checked="" style="float: left; padding-top: 5px;" name="member-only" value="yes">
    </div>

after delete float: left everything looks fine?!

Thanks and best regards,
chainsaw81
Reply
#21
chainsaw81 Wrote:@mikeh

thanks again for your wundeful extension.

i followed your instructions, but one thing won't work:
- i want to add manually users to the webseite
--> settings -> manage users -> add new user

nothing happens.
only the url changes from
Code:
/admin/load.php?id=user_login&manage=yes
to
Code:
/admin/load.php?id=user_login&manage=yes#

the html says:
Code:
<a id="add-user" href="#">Add New User</a>

do you have any ideas? something missing? javascript etc?

thanks and keep up your great coding!
chainsaw81

What browser were you using? For some reason IE hates the js i wrote for this plugin and the multi-user plugin (still trying to figure it out).

I tried to replicate this with firefox, chrome, and IE 9 and could not.
Reply
#22
i tested with
# Firefox 3.6
# Chromium 12.0
on Ubuntu 10.04

i also use (and love) your multi-user extension, this works fine for me!

usmandgreat also wrote:
Quote:In admin settings page i click on the add users button and it doesn't show me anything.

any ideas? thanks a lot!
Reply
#23
mikeh Wrote:What browser were you using? For some reason IE hates the js i wrote for this plugin and the multi-user plugin (still trying to figure it out).

I've hit similar problems in the past which turned out to be IE hating a trailing comma on the end of a parameter array every time. Basically...
Code:
{
    parameter1: 'value',
    parameter2: 99
}
...will work, and...
Code:
{
    parameter1: 'value',
    parameter2: 99,
}
...will fail under IE but gets accepted by Firefox, Chrome and Safari.
Reply
#24
Vulch Wrote:
mikeh Wrote:What browser were you using? For some reason IE hates the js i wrote for this plugin and the multi-user plugin (still trying to figure it out).

I've hit similar problems in the past which turned out to be IE hating a trailing comma on the end of a parameter array every time. Basically...
Code:
{
    parameter1: 'value',
    parameter2: 99
}
...will work, and...
Code:
{
    parameter1: 'value',
    parameter2: 99,
}
...will fail under IE but gets accepted by Firefox, Chrome and Safari.

Hmm, thanks for the info, I will check it out.

I have had a little trouble figuring the issue out because clicking the "Edit" button actually freezes IE. So I cannot diagnose exactly what is happening since it stops responding immediately.
Reply
#25
me again ...

1. hmm, i found no solution at the moment.
i tried on 2 computers. fresh install, only your fe-login plugin -> but everytime the same problem, nothing happens.

i looked into the html code and found after the member </table> one empty <script> tag:
Code:
<script type='text/javascript'></script>

probably something missing? were is your js stored?

2. another question, is there any way to redirect after user-login?

thanks for your help!
Reply




Users browsing this thread: 2 Guest(s)
Free HDTV Channels Residential Solar Panels