Файл: EasyHost v2.0/system/pureftpd.pl
Строк: 49
<?php
#!/usr/bin/perl
############################################
# Change this to the full path to easyhost.conf
my $path = "/path/to/cgi-bin/easyhost.conf";
############################################
open(CONFIG,$path);
while (<CONFIG>)
{
chop if (/n/);
my @line = split(/=/,$_,2);
$config{$line[0]} = $line[1];
}
close(CONFIG);
&bad if ($config{'setup'} || !$ENV{AUTHD_ACCOUNT});
push (@INC,$config{'system_dir'}.'lib');
require $config{'system_dir'}.'go.pl';
use CGI qw/:cgi/;
my $cgi = new CGI;
my $system = EasyHost::System->new($cgi,%config);
my $user = $system->service->user($ENV{'AUTHD_ACCOUNT'}) || &bad;
if ($ENV{'AUTHD_PASSWORD'} ne $user->password || $user->status != 1 || $user->config('ftp') != 1)
{
print "auth_ok:-1n";
print "endn";
}
else
{
print "auth_ok:1n";
print 'uid:'.$user->directory->stat('uid')."n";
print 'gid:'.$user->directory->stat('gid')."n";
print 'dir:'.$user->directory->real->path."./n";
print 'user_quota_size:'.$user->config('space_quota')."n" if ($user->config('space_quota') > 0);
print 'user_quota_files:'.$user->config('space_files')."n" if ($user->config('space_files') > 0);
print "endn";
}
sub bad
{
print "auth_ok:0n";
print "endn";
exit();
}
?>