PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 5th, 2000, 02:46 AM
Wyvernikus Wyvernikus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Kouvola, Finland
Posts: 11 Wyvernikus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Wyvernikus
Hi! anybody got a sample PHP-script of user autherization, the login script or could help me with it?

I really preciate your help! thanks already.




------------------
-Aarno Villa

Reply With Quote
  #2  
Old January 5th, 2000, 11:33 AM
falcon falcon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: UK
Posts: 50 falcon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 21 m 33 sec
Reputation Power: 14
Its a bit of a mess but I hope it helps. It authenticates against a database I think, its been a while since I looked at authorisation stuff. You may need to change a few bits and pieces.

if(!isset($PHP_AUTH_USER)) {
Header("WWW-authenticate: basic realm="$SID"");
Header("HTTP/1.0 401 Unauthorized");
$title="Login Instructions";
echo "<blockquote> n".
"You are not authorised to enter the siten".
"</blockquote> n";
exit;
} else {
if ( $SID != "" )
$SID="@".ereg_replace("@","",$SID);
if (!($conn=ora_logon("$PHP_AUTH_USER$SID",$PHP_AUTH_PW))) {
//if (!($conn=ora_logon("$PHP_AUTH_USER",$PHP_AUTH_PW))) {
Header("WWW-authenticate: basic realm="$SID"");
Header("HTTP/1.0 401 Unauthorized");
$title="Login Instructions";
echo "<blockquote> n".
"You are not authorised to enter the siten".
"</blockquote> n";
exit;
}
}


Falcon

Reply With Quote
  #3  
Old January 10th, 2000, 01:22 AM
Wyvernikus Wyvernikus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Kouvola, Finland
Posts: 11 Wyvernikus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Wyvernikus
Thanks Man! that helped much

I got another problem too, I have a filemanager made with PHP3 and it just doesn´t work right, maybe you could check it and try to fix (or someone else, maybe) it,
I would appreciate that because I need it for my project, If you or someone else is interested of fixing it, I can mail it.
let me know then

Thanks already!

Reply With Quote
  #4  
Old January 10th, 2000, 06:18 AM
Wyvernikus Wyvernikus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Kouvola, Finland
Posts: 11 Wyvernikus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Wyvernikus
it would be fine if the script verifies the password against some password-file, because i can´t use databses such as Mysql

any solutions?



Reply With Quote
  #5  
Old January 10th, 2000, 02:13 PM
kvack kvack is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Posts: 15 kvack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hehe I have a filemanager too ..
but it's missing some copy and move funktions
I don't know a way to get the directory
structure(on the fly) of my site =)
so now its hidden deep in the basement

Reply With Quote
  #6  
Old January 13th, 2000, 12:29 AM
Wyvernikus Wyvernikus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Kouvola, Finland
Posts: 11 Wyvernikus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Wyvernikus
this is from ClipScripts, made by lacey pevey, and it just doesn´t work, file functions like Edit, Move and others,hopely somebody fixes it. I need that for one of my projects.


Reply With Quote
  #7  
Old January 14th, 2000, 12:55 PM
kvack kvack is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Posts: 15 kvack User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I fixed mine .. by using find.
If you are on a unix-box that
does not run php in safe_mode
it will work .. almost http://firewall.n3.net/download/efman099.zip

Reply With Quote
  #8  
Old January 17th, 2000, 04:29 AM
Wyvernikus Wyvernikus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Kouvola, Finland
Posts: 11 Wyvernikus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Wyvernikus
oki, but that download doesn´t work maybe somebody delete that efman.zip before I downloaded it, damn. btw, how can I do a redirection after the user authetication, Header ("location: $url" ); doesn´t work, because it says that header is already set.
any other ways to redirect it?

Reply With Quote
  #9  
Old January 17th, 2000, 04:50 AM
falcon falcon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: UK
Posts: 50 falcon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 21 m 33 sec
Reputation Power: 14
Code:
<?PHP
Authorisation Header
?>

<html>
<head>
<title></title>

<?PHP
if ($something) {
echo "<meta http-equiv=refresh content=0; url=url_1.htm>";
} else {
echo "<meta http-equiv=refresh content=0; url=url_2.htm>";
?>

</head>
<body>
</body>
</html>

I think this is right, I hope it helps.

Falcon

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Problem: User authorization with PHP

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap