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.

looks great, just a quick question

from the same login-page:
-client A logs in and is redirected straight to page A
-client B logs in and is redirected straight to page B

is that possible?

Hello, you can make this organisation :

http://www.mywebsite.com/secure/index.php http://www.mywebsite.com/secure/SimpleAuth.php http://www.mywebsite.com/secure/client1/index.php http://www.mywebsite.com/secure/client2/index.php

You make authentification of All user on index.php page and you forward to a dedicated space :

<?php $simpleAuth = ${(require_once(‘SimpleAuth.php’))} -> protectme(); $client = $simpleAuth -> getLogin(); header(‘Location: ’.$client); ?>

After, you can allow only 1 user for each page. Put this script on each secure/clientXXX/index.php :

<?php $login = array_pop(explode(DIRECTORY_SEPARATOR, dirname( FILE ))); ${(require_once(’../SimpleAuth.php’))} -> protectme(array( ‘allowedUsers’ => array($login) )); ?>

The user with the login client1 is allow on the folder client1 If you would allow an additionnal user for each folder like administrator, you can use an array :

<?php $login = array_pop(explode(DIRECTORY_SEPARATOR, dirname( FILE ))); ${(require_once(’../SimpleAuth.php’))} -> protectme(array( ‘allowedUsers’ => array($login, ‘administrator’) )); ?>

I can send you an exemple. Please contact me to mail.

Thanks

hi arnolem,

Thats really good work. My advice to user who think to buy this work, I used and really simple, atractive script for experienced or on-experienced user. thanks again.

I want to learn, can we set the time for session, because sometimes, if the user refresh and refresh the protected page one more times, script show the login page. can we fix this problem ?

thanks for your helps.

Hello,

This is not directly related to the script but the configuration of your server.
You can change this if you have sufficient rights with the following command in your php page :

ini_set ('session.gc_maxlifetime', 2400) / / second
If you’re running Apache, you can also place a. Htaccess file with :
php_value session.gc_maxlifetime 2400

To make this work, you must have the rights on your server

I love the upgrades, great job!

Thanks for your comment :)

Hi, is it possible to give users or groups access to parts of PHP pages? Something like

if( $user == ‘admin’ ) { echo ‘Oui!’; } else { echo ‘Non.’; }

Thanks!

Yes : Look this example :
<?php if($simpleAuthInstance?>isAuth()) :?>

   <div>Login : <?php echo $simpleAuthInstance?>getLogin(); ?></div>

   <?php if(in_array($simpleAuthInstance?>getLogin(), array('zidane', 'ronaldo')) : ?>
      <div>Like you Football ?</div>
   <??>

<?php endif; ?>

Warning, there are a little bug in the codecanyon editor. Please replace $simpleAuthInstance?> with $simpleAuthInstance->

Greetings. Wonderful script.

I cannot figure this out for the life of me. I am trying to integrate your script into a lightbox login screen via iframe (couldn’t figure out any other way to do it), but i cant figure out how the redirect works so after login the user breaks out of the iframe and lightbox and into the parent page?

Hello,

Can you send me a link to your site so I understand the problem ?
From what you said to me, I do not think you used the right way.

thank you

Hi, I am a very unexperienced website builder. I have just purchased the panel and have no idea how to add it into my HTML Widget on iWeb. There doesn’t seem to be any instructions on the download. Please can you advise me. Thanks Lynda

IWeb creates HTML pages. Simpleauth needs to operate in PHP pages only.
  • To install SimpleAuth, you must rename your pages with the extension ”.php”
  • Open SimpleAuth.php and change the login and password in the users section
  • Copy the installation line in each file to secure
  • And that’s all

Hi,

Great script.

I need to place hundreds of html pages online. I can use a simple phppassword method. But, I found your script and it looks very promising.

Can I set up a simple html site with a search script to find meta tags, etc. So I say type in your office number, and it finds the page. Then, the page is protected by your script.

How does the group thing work? I will have hundreds of people in an office using my freebie stuff. I can make them a group, or various subgroups I guess.

Regards,

J

Hello,
Simpleauth is more secure and easier to install than Simple Phppassword

  1. To install SimpleAuth, you must rename your pages with the extension ”.php”
  2. Create users and groups (if needed)
  3. Copy the installation line in each file to secure
  4. And that’s all :)
For group management:
  1. Create your groups
  2. Create your users
  3. Link users to one or more groups
  4. For each page, select the groups who can access

that is great, thank you verry much. I’ll buy this script

Thanks ;)

Can I use this to secure the admin area for joomla? For example To login into joomla backend you must use www.domainname.com/administrator an that brings you to joomla login. I’d like to block anyone from coming to /administrator area to be able to login into joomla. Something like a double login system if you understand what I’m saying

Hello,
Yes, you can use simpleauth to make a double login system with joomla or wordpress.
With Joomla, add simpleAuth on the top of /admin/index.php file.

You can see it in action : http://passionsansfrontiere.com/admin/
first login : arnaud
first password : password

I’d like to specify that Arnaud responds quick to every question sent to him. I’d buy another code from him in a heartbeat.

Thanks Chuck :)

Hmmm…I’m not sure I explained what I need. I don’t THINK WP can do what I need, unless something new has changed.

I need a client portal where a person signs in to the website and is directed to their own portal or page or gallery etc. This would be a private page that only that member would be able to see. If someone typed in that URL they would be directed to login.

Thanks, Christina

Hello Christina,

SimpleAuth haven’t a specific Wordpress plugin but you can use it with all PHP applications.

You can secure an entire WordPress website by adding a single line of code to the “index.php” file in Wordpress :

<?php ${(require_once('SimpleAuth.php'))} ?> protectme(); ?>

Using SimpleAuth with Wordpress has some limitations. For example, you can not secure a page and not another. But, this is possible with a native feature of wordpress (See Visibility option when you publish a new page for add a password).

If you need help with installation, please contact me. I would be happy to help you.

Hello. I am about to purchase this however, I want to make sure I can do with it what I need.

I have a Wordpress website and I want to create client pages that are private only to the specific client that is logged in.

Will this plugin allow me that feature?

Thanks in advance, Christina

Hello, You can allow a user to see a wordpress page in the page options. You do not need a plugin for this.

Hi Arnolem,

Thanks so much for responding so quickly last time.

I need the secure login to come up once per visitor session. In other words, the the secure login comes up when the visitor first accesses the secure pages, then if the visitor goes to another accessible page and comes back to a secure page, it doesn’t play again.(It does this already!) However, if the visitor closes his browser, then opens his browser again and I’d like him to have to login again.

How would I set this up on the SimpleAuth.php page?

Many thanks in advance

emma margaret

Hello, The session ends if the user closes the browser. If he returns to the secure page, he sees the login page SimpleAuth What is the problem ?

Hi arnolem,

I purchased and use your script to protect an admin area. Installed in a sec, great job.

But I’m facing a refeshing problem.

When I submit a form in my admin (target _blank), i use a javascript function that closes this new tab ans who reloads the opener tab (to refresh data displaying). Classical stuff.
[My actions done]
<body onload="window.opener.location.reload(true); window.close();">
</body>

And everytime it does, I have now this annoying message from Firefox “Are you sure you want to submit again…”. If I comment your code

 //${(require_once('scripts/SimpleAuth.php'))}->protectme();
it works like a charm.

What are you suggesting me ?

You can create a new page for login only : Ex :
<?php $simpleAuth = ${(require_once('SimpleAuth.php'))} ?> protectme();
header("Location: /admin");
?>
This page will handle authentication and redirect to the admin page on success.

Hi Arnolem, Thank you for this it works and I managed to install it with ease!

Just a few questions

1. How do I replace the grey button with an image of my own which says login on it (although it could be a blank shape to write the text on)? What would I have to do to this bit of code?

2. How do I remove the images of a person’s head and the keys in the form fields?

Many thanks for this it was so great to install something and for it to work first time.

All the best,

emma margaret

Hello,
You can remove the images in the form fields replacing :
.login{
    padding:3px 3px 3px 20px;
    background:#fff url(data:image/png;base64,${'img_login'}) 3px 3px no-repeat;
}
.password{
    padding:3px 3px 3px 20px;
    background:#fff url(data:image/png;base64,${'img_password'}) 3px 3px no-repeat;
}
By this code :
.login{
    padding:3px 3px 3px 20px;
    background:#fff;
}
.password{
    padding:3px 3px 3px 20px;
    background:#fff;
}
For replace the button by an image. You can replace this code :
<input value="${'text_sign_in'}" type="submit" />
by this code :
<input src="image.png" type="image" />

Hey, wanted to let you know that I had this completely integrated in about 30 minutes. Great stuff, thanks a lot!

Thanks Minttechnology ! You can rate this script if you like

You answered

“Yes , you can change all image. the html code is in the simpleauth file. you can make a link on your image or encode this to base64.”

Please, can you give me a example how to do this? I’m not sure which line to edit in the file.

Thanks in advance!

//Memic

Hello,
The HTML code start at the line 518 with :

// Set HTML page
$html = <<<EOFHTML

At the line 57, you can see all image encode in base64. You can change this big string with another image. To encode your image to base64 string, you can use this website : http://www.motobit.com/util/base64-decoder-encoder.asp

Is it possible to set an area of text on the page that only specified users can see?

Yes, you can check the login of the connected user like :

<?php if(in_array($simpleAuthInstance?>getLogin(), array( ‘user1’, ‘user2’, ‘admin’ )): ?> Area of text <?php endif;?>

How can i make it so when u press logout instead of taking them to the login page take em to the home page?

Hello Renny, it’s not possible but you can submit this feature to the http://simpleauth.idea.informer.com/
I think that is a good idea.
Thanks

Hello,

Your request has been developed. You can download the latest version of simpleAuth to use this feature.

Thanks Renny

i dont know if u understood my question..m trying to REMOVE the list at the bottom of the login screen…says “demo accounts” have a look: http://gzpwebdesign.com/Instruct-JDoe.php

Ok, you have not the good file. You should use the SimpleAuth.php file who is at the root of folder. You have taken the bad file. You have used /Sample/SimpleAuth.php in place of /SimpleAuth.php

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