LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-11-2003, 09:54 AM   #1
dutch357
LQ Newbie
 
Registered: Apr 2003
Posts: 1

Rep: Reputation: 0
Angry Need Help With My Perl/cgi Authentication Script


I'm a newbie @ Perl

I want this script to use the username and reference it to a textfile which gives a user access to upload files to a directory. The webpage is password protected and the user is authenticated by apache. Currently the script is denying ALL users.

Can someone Pls help??


========START HERE============================
#!/usr/local/bin/perl -w

use CGI qw(:standard);

$savedir = "/path/to/dir";
$username = "$ENV{'REMOTE_USER'}/";
$query = new CGI;
$authfile = "/path/to/authfile";
open (A,$authfile) or die "failed to open\n";

$perm=0;
while(<A>){
if (/^$username/i){
$perm=1;
last;
}
}

close(A);

if(!$perm){
no_perm();


=====THIS IS JUST A PORTION OF THE SCRIPT=============

Question History
Comment from PC_
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl cgi Script can`t make file.Why? ZairSadiqov Linux - Software 1 11-22-2006 07:22 AM
CMS Perl/CGI/PHP script ANU Programming 2 10-25-2006 10:11 AM
CGI/Perl script problems. Randvegeta Linux - Software 8 12-30-2004 12:24 AM
cgi-bin error regarding perl script hamish Linux - Software 11 12-09-2004 10:16 AM
How to Call a C program from Perl CGI Script anoop_cn Programming 1 05-11-2004 04:37 PM


All times are GMT -5. The time now is 12:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration