Login once by different users to...

User 38401 Photo


Senior Advisor
10,951 posts

Nice Eric, that looks like exactly what he is looking for if I read that all correctly. Nice example!
User 450757 Photo


Registered User
43 posts

Thanks Eric.

Yes, this is what I was looking for and this is what I was trying to avoid (so many sub folders) and this is what I asked in my second post above about....

I guess the first sentence I stopped with just confirmed that you have to have at least another sub folder to secure... only then, you may have more than one user connecting using the same entry link on the home page.

Thanks again for validating the taking the time to demonstrate. I can live with this.
Developing Robotic Surgery ORs and EMR Solutions.

http://www.RSES.com - fully designed with CoffeeCup's VSD
http://www.DevekMaga.com - Where the images are....
User 187934 Photo


Senior Advisor
20,190 posts

I didn't try it without sub folders because I wouldn't want to do it that way. It's easier to setup and maintain who has access to what by using sub folders and this would be the way I would have done it if I was going to use it besides for demonstration.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 187934 Photo


Senior Advisor
20,190 posts

Ok to do a proof of concept I created a new directory and everything is in this one directory.
Login
Same users and passwords.;)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 450757 Photo


Registered User
43 posts

Thank you very much, again, for taking the time...

I will use the last concept.

Developing Robotic Surgery ORs and EMR Solutions.

http://www.RSES.com - fully designed with CoffeeCup's VSD
http://www.DevekMaga.com - Where the images are....
User 187934 Photo


Senior Advisor
20,190 posts

For anybody looking to do the same Here's a quick break down.
This goes into the head of the page you want the login on.

<SCRIPT LANGUAGE="JavaScript">
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && password && server) {
var htsite = "http://" + username + ":" + password + "@" + server;
window.location = htsite;
}
else {
alert("Please enter your username and password.");
}
}
</script>

This goes into the body of the login page. Adjust the mydomain.com/redirect.shtml to your needs.

<div id="login">Please Login<form name=login>
<br>
<input type="hidden" name="server" value="mydomain.com/redirect.shtml">
Username:
<input type=text name=username size=20>
<br><br>
Password:
<input type=password name=password size=20>
<br>
<input type=button value="Login!" onClick="Login(this.form)" name="button">
</form></div>

This goes into the head of the redirect.shtml. Adjust user's to your actual user names and the user#.shtml to your actual page names. (This is the only thing on the redirect page). All pages besides the login should be .shtml extension.

<!--#if expr="$REMOTE_USER = 'user1'" -->
<META HTTP-EQUIV="Refresh" CONTENT="1; URL=user1.shtml">
<!--#elif expr="$REMOTE_USER = 'user2'" -->
<META HTTP-EQUIV="Refresh" CONTENT="1; URL=user2.shtml">
<!--#elif expr="$REMOTE_USER = 'user3'" -->
<META HTTP-EQUIV="Refresh" CONTENT="1; URL=user3.shtml">
<!--#else -->
<META HTTP-EQUIV="Refresh" CONTENT="1; URL=denied.shtml">
<!--#endif -->

Now upload these pages and the pages you want to protect that your forwarding to. Next go to Web Access Manager and give access to the appropriate pages for your users and upload the htaccess. You don't need to protect the redirect.shtml.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 450757 Photo


Registered User
43 posts

Eric,

Are the above scripts instead of WAC? I was under the impression that WAC takes care of protecting the folder and its content, or files....

By the way I use only one sub-folder down from the root. Then, a sub-folder for each user....

Developing Robotic Surgery ORs and EMR Solutions.

http://www.RSES.com - fully designed with CoffeeCup's VSD
http://www.DevekMaga.com - Where the images are....
User 187934 Photo


Senior Advisor
20,190 posts

The scripts above go into pages. It's your decision on whether you use a sub-folder or not.
The first and second script go on the page that you would like a login box on. It can be any page. The third block of code goes to the head of a page that I called redirect.shtml. This is the only thing on this page as the users will never see it. The code will redirect the user when they login to the appropriate page that they are allowed to view. If you use sub-folders the code in the redirect.shtml will reflect that. I did examples both ways as you seemed bummed that I was using sub-folders so I setup another example where everything is in the same directory. It could be the Root of your site.:) You upload all your pages and files that you want to protect first before you use WAM because it needs them there so you can select them to protect them.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 271042 Photo


Ambassador
85 posts

Nice one Eric!

Yes, even though there might be an extra click required after entering username and password, the user is immediately taken to his/her own welcome page after username/password entry.

I like it,

Phil
http://www.gr8-knots.com

Nostalgia isn't what it used to be.
User 187934 Photo


Senior Advisor
20,190 posts

Thanks Phil.
I think it's better to have the user use a login on a page in your site because otherwise if you click a link and get the login users might like their being hacked.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.