authentication
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > authentication




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    authentication  
Super Slueth


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-07 12:25 AM

hello

Im running the latest version of apache on a linux Fedora7 PC

I  have several subdirectories of the main webpage.

I want users as the get onto the homepage to have to login in.

depending on th login name used i want them to be redirected to a
sub directory with the same name as the login name automatically.

Any ideas on how to achieeve this

I have mysql and php loaded

Many thanks





[ Post a follow-up to this message ]



    Re: authentication  
shimmyshack


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-27-07 06:22 AM

On Jun 27, 1:01 am, Super Slueth <n...@hotmail.com> wrote:
> hello
>
> Im running the latest version of apache on a linux Fedora7 PC
>
> I  have several subdirectories of the main webpage.
>
> I want users as the get onto the homepage to have to login in.
>
> depending on th login name used i want them to be redirected to a
> sub directory with the same name as the login name automatically.
>
> Any ideas on how to achieeve this
>
> I have mysql and php loaded
>
> Many thanks

either use htaccess to control the folders, which will protect whole
folders full of files, and stop people just typing in the urls, so you
could have a form on the homepage with a user field, and each
protected folder has its own htaccess with basic auth for each user,
the value for the username sets the forms action to the right folder
for that user using javascript, the user will be prompted with a user/
pass box, but once they have typed it in, usually the user is remember
between sessions, it will be clumsy but then once the user has logged
on the folder is open, and they will not need to log in again if they
have set the remember me box, which will mean they will need to
bookmark their own folders anyway - and wont need "redirecting".
OR
implement some kind of php login system, google has loads of ready to
run login scripts, some better than others, but for what you want, you
need to create a table in mysql with the users ane their hashed
passwords. The login form on the homepage takes the username and a
password. Then when these are posted, the script checks the table to
see if the $_POST{'user'] and md5($_POST['password']) ireturns exac
tly
one row in the mysql table. If it does then take the value of the
username, and do something like

if( $numRows == 1 )
$arrayUserToFolderMapping = array(
'bob'=>'bobbys_folder',
'mike'=>'michaels_folder',
'jon'=>'jonnys_folder',
'admin'=>'my_folder'
);
header('http://server.com/'.
$arrayUserToFolderMapping[$_POST['user'].'/');
exit;
}

however then just controls the redirection, now each and every file
that is owned by the user must be password protected, so when the user
is successful at login on, you must regenerate the session, and send a
cookie so that the browser "has  permission" to access the files in
the folder, each file then checks for the appropriate cookie

so the above script would be modified to include some session stuff.

session_start();
//get posted data, check it against mysql
if( $numRows == 1 )
$arrayUserToFolderMapping = array(
'bob'=>'bobbys_folder',
'mike'=>'michaels_folder',
'jon'=>'jonnys_folder',
'admin'=>'my_folder'
);
session_regenerate();
header('http://server.com/'.
$arrayUserToFolderMapping[$_POST['user'].'/');
exit;

this is only VERY simple, you are encouraged to use google to find a
fully featured ready to run MODERN login system with good reports, it
isnt something you can get right yourself without experience, unless
it really doesnt matter about security.
}






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:07 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register