Code

Discussion on SimpleAuth : Very Simple Secure Login System

Discussion on SimpleAuth : Very Simple Secure Login System

By
Cart 1,042 sales

arnolem supports this item

Supported

173 comments found.

Great code and support :)

Thanks Xowi :)

blah. false alarm. still cant get the variables to post

<form method=”post” action=”/pages/testpage.php” > <input type=”text” name=”simple_auth_login” /> <input type=”text” name=”simple_auth_password” /> <input type=”submit” value=”LOGIN” /> </form>

You have omit the simple_auth_action.

This snippet work :
<form action="private.php" method="post">
<input type="hidden" name="simple_auth_action" value="login"/>
<input type="text" name="simple_auth_login" value=""/>
<br />
<input type="password" name="simple_auth_password" value=""/>
<br />
<input type="submit" value="Login"/>
</form>

Regarding the using a separate login form to post / login…

i know you already commented on it, but does your script already have a function / sniffer that if we send post user / password to the script / page it will work. or we will need to not only make the form, but also add a function within the SimpleAuth file to receive those post variables and execute the login?

could you explain a little further? are you saying just have the form post to the protected page and your script will pick that up? what are the variables im posting too?

ah figured it out. thanks!

Try this :

<form action="private.php" method="post">
<input type="hidden" name="simple_auth_action" value="login"/>
<input type="text" name="simple_auth_login" value=""/>
<br />
<input type="password" name="simple_auth_password" value=""/>
<br />
<input type="submit" value="Login"/>
</form>

Server ran on the wrong php version, problem solved. Thanks a lot Arnaud!

Thanks Bodohmen, feel free to rate SimpleAuth ^^

Hello, I have some problems with sessions, the problem is the script remove session variables that I have instanced, is there any way that script can live with other sessions? something that I should take care?

Hello, SimpleAuth use a namespace for isolate his session variable. The default namespace is $_SESSION[‘simple_auth’]. You can change this value, edit the ‘session_namespace’ value on $config

By cons, If you call the logout() function, you delete all sessions variables : SimpleAuth variables and your variables.

But, there are an other possible conflict. SimpleAuth use a session cookie named SIMPLEAUTH _SSID. If you manualy start a session in other page with the default cookie session name of PHP , you can loose your datas. You can change the SimpleAuth Cookie name, edit the ‘session_id’ value on $config. The PHP default value is PHPSESSID .

If you have a problem, please contact me with the contact form.

Thanks

Hello! Somehow I have problems with the system and get the following errors:

Warning: Wrong parameter count for headers_sent() in /mnt/webf/d2/26/5820426/htdocs/pixelrausch/1rem/Sample/SimpleAuth.php on line 217

Warning: Cannot send session cookie – headers already sent by (output started at /mnt/webf/d2/26/5820426/htdocs/pixelrausch/1rem/Sample/SimpleAuth.php:217) in /mnt/webf/d2/26/5820426/htdocs/pixelrausch/1rem/Sample/SimpleAuth.php on line 402

Warning: Cannot send session cache limiter – headers already sent (output started at /mnt/webf/d2/26/5820426/htdocs/pixelrausch/1rem/Sample/SimpleAuth.php:217) in /mnt/webf/d2/26/5820426/htdocs/pixelrausch/1rem/Sample/SimpleAuth.php on line 402

Fatal error: Call to undefined function: session_regenerate_id() in /mnt/webf/d2/26/5820426/htdocs/pixelrausch/1rem/Sample/SimpleAuth.php on line 406

The link is as follows: http://www.pixelrausch.com/1rem/Sample/admin.php

As I tried to implement the code in the wanted page it didn´t work so I uploaded the whole “Sample” folder to see if this works but I got the same errors.

Any idea what I´m doing wrong?

Thanks in advance

Hello,

SimpleAuth Work with all version of PHP5 and the last version of PHP4 . Please upgrade your server

Thanks

hello, is there any way to use this script in adobe muse? apologies if the question is duplicative.

thanks!

Hello, Yes, you can use SimpleAuth with Adobe Muse.

You must export your Adobe Muse Website to HTML and rename the page to secure in xxx.php

Brilliant little script 5 stars :)

Hello, could I use this within the Lightbox Evolution as a pop up window? Thanks

Yes, you can create a small html form in a pop-up, who POST login and password to your secure page.

Hi! Can I use your script as a login form module on top of public pages? When login users would leave the public area and enter the “pro” area. In other words, I don’t want to have a specific login page, I want the form to be integrated in my pages with other content (something similar to the Joomla login module, if you’re familiar with Joomla)

If it’s possible, how can I achieve that?

Thanks!!! :)

Yes, you can create a small html form in a pop-up, who POST login and password to your secure page. Obviously, you must develop yourself the form on top of your website by helping you with the SimpleAuth form

Greetings. How can I get the var $users array to be populated from a mysql table instead of “hand coding”?

Thanks!

Hello, you can modify the protectme() method to call a personal method myRetrieveUsersMysqlFnc();

And this new method could set $this->users property

Hi. This script works great and very well documented. However, I cannot get it to work with another script I purchased here too. I had an AJAX content editor, with login system for editing purposes. Since viewing the page was not protected by login (only editing), I decided to purchase your script. However, when I login with your script, I can view just fine. Then, the problem comes when I want to login to the other page (which was protected with SimpleAuth), I can login but cannot log out or edit anything. I found out that removing the SimpleAuth call from the index.php file I wanted to protect, the page works just fine.

There is a conflict with both scripts, and I would like to ask if you have any clue as to what should I correct or change.

Thanks a lot! :)

Hello,

Could you give us a link has to understand the problem.

thank you

Amazing looking script. Looks like this is just what I need.

Quick question…forgive me if you have already answered this:

Can you protect a directory of php files, or just single php pages individually?

Meaning, I want a user to login to ex. “example.com/login” Then, click a link on this page to go to “example.com/login/form”

Will the form page be protected without the user having to login again? or would you be able to just visit “example.com/login/form” and bypass the secure login protection?

I hope this makes sense.

Thanks!

Hello,

You must configure each of the pages you want to protect by adding the single line of code Simpleauth.

If you protect multiple pages, the user must connect only once on all pages. Unless you decide that a page needs to have more rights.

Is there any way in being able to create an account creation facility? How hard is this to do?

I <3 SimpleAuth! 30 Min to setup and change the Loginform :)

Thank you very much ;)

Very good work, installed in no time, everything OK.

Just one problem, I would like to discuss:

I added some text in german, using special characters like ÄÖÜ. After uploading to the server, these characters where shown as ????.

Can you help to resolve that issue ?

Thanks in advance.

Peter

Hello,

If you edit the file simpleauth.php, you must keep a UTF -8 to avoid problems with accented characters. You must also use an FTP client in binary mode (not ASCII )

If you have problems, make sure your files use UTF -8 and the HTTP headers or meta tags of your site are properly configured.

Send us your link for more information

rated 5 stars! :-)

Please let me know when you receive the private message I just sent you, I’d appreciate any of your help or advice greatly.

thanks again

stef

Thank you Stefhone,

I responded to your mail.

Thank you for the rating (5 stars)

Works a treat, thank you, high-five! :)

Thanks ;)
Feel free to rate this script !

Hi, This looks excellent but is it possible to use this to protect 2 separate pages for 2 different users?

I have page A for user A and page b for user B, and what I want is for user A when logged in to page A to be unable to access page B and vice versa, they should be challenged when they click the link for the other protected page.

Hope this makes sense :)

Many thanks

Yes, it’s possible.
You must create two user accounts, then you configure the pages like this :
Page A :
<?php ${(require_once(‘SimpleAuth.php’))}->protectme(array( ‘allowedUsers’ => array(‘client@companyA.com‘) )); ?>
Page B :
<?php ${(require_once(‘SimpleAuth.php’))}->protectme(array( ‘allowedUsers’ => array(‘client@companyB.com‘) )); ?>

Can I make arrays of users to put into groups?

Aka

array(‘These’, ‘15’, ‘users’) => ‘staff’, array(‘These’, ‘10’, ‘users’) => ‘students’

Rather than the other way around?

Hello, you must use this syntax:

    var $groups = array(
        'loginA' => 'staff',
        'loginB' => array('staff', 'students'),
        'loginC' => 'students'
    );
by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey