version 1.178.2.14, 2004/04/07 09:39:18
|
version 1.178.2.17, 2004/04/19 11:28:18
|
Line 796 sub ChangePasswordHandler {
|
Line 796 sub ChangePasswordHandler {
|
# First require that the user can be authenticated with their |
# First require that the user can be authenticated with their |
# old password: |
# old password: |
|
|
my $validated = ValidUser($udom, $uname, $upass); |
my $validated = ValidateUser($udom, $uname, $upass); |
if($validated) { |
if($validated) { |
my $realpasswd = GetAuthType($udom, $uname); # Defined since authd. |
my $realpasswd = GetAuthType($udom, $uname); # Defined since authd. |
|
|
Line 1138 sub FetchUserFileHandler {
|
Line 1138 sub FetchUserFileHandler {
|
} |
} |
RegisterHandler("fetchuserfile", \&FetchUserFileHandler, 0, 1, 0); |
RegisterHandler("fetchuserfile", \&FetchUserFileHandler, 0, 1, 0); |
# |
# |
# Authenticate access to a user file. Question? The token for athentication |
# Authenticate access to a user file. |
# is allowed to be sent as cleartext is this really what we want? This token |
|
# represents the user's session id. Once it is forged does this allow too much |
|
# access?? |
|
# |
# |
# Parameters: |
# Parameters: |
# $cmd - The command that got us here. |
# $cmd - The command that got us here. |
Line 1617 sub GetProfileEntryEncrypted {
|
Line 1614 sub GetProfileEntryEncrypted {
|
|
|
return 1; |
return 1; |
} |
} |
RegisterHandler("eget", \&GetProfileEncrypted, 0, 1, 0); |
RegisterHandler("eget", \&GetProfileEntryEncrypted, 0, 1, 0); |
|
|
# |
# |
# Deletes a key in a user profile database. |
# Deletes a key in a user profile database. |
Line 1848 sub DumpWithRegexp {
|
Line 1845 sub DumpWithRegexp {
|
} |
} |
RegisterHandler("dump", \&DumpWithRegexp, 0, 1, 0); |
RegisterHandler("dump", \&DumpWithRegexp, 0, 1, 0); |
|
|
# Store an aitem in any database but the roles database. |
# Store an aitem in any resource meta data(?) or database with |
|
# versioning? |
# |
# |
# Parameters: |
# Parameters: |
# $cmd - Request command keyword. |
# $cmd - Request command keyword. |
Line 2223 sub DumpCourseIdHandler {
|
Line 2221 sub DumpCourseIdHandler {
|
} |
} |
unless (defined($since)) { $since=0; } |
unless (defined($since)) { $since=0; } |
my $qresult=''; |
my $qresult=''; |
|
logthis(" Looking for $description since $since"); |
my $hashref = TieDomainHash($udom, "nohist_courseids", &GDBM_WRCREAT()); |
my $hashref = TieDomainHash($udom, "nohist_courseids", &GDBM_WRCREAT()); |
if ($hashref) { |
if ($hashref) { |
while (my ($key,$value) = each(%$hashref)) { |
while (my ($key,$value) = each(%$hashref)) { |
my ($descr,$lasttime)=split(/\:/,$value); |
my ($descr,$lasttime)=split(/\:/,$value); |
|
logthis("Got: key = $key descr = $descr time: $lasttime"); |
if ($lasttime<$since) { |
if ($lasttime<$since) { |
|
logthis("Skipping .. too early"); |
next; |
next; |
} |
} |
if ($description eq '.') { |
if ($description eq '.') { |
|
logthis("Adding wildcard match"); |
$qresult.=$key.'='.$descr.'&'; |
$qresult.=$key.'='.$descr.'&'; |
} else { |
} else { |
my $unescapeVal = &unescape($descr); |
my $unescapeVal = &unescape($descr); |
|
logthis("Matching with $unescapeVal"); |
if (eval('$unescapeVal=~/$description/i')) { |
if (eval('$unescapeVal=~/$description/i')) { |
|
logthis("Adding on match"); |
$qresult.="$key=$descr&"; |
$qresult.="$key=$descr&"; |
} |
} |
} |
} |
Line 2382 sub TmpPutHandler {
|
Line 2385 sub TmpPutHandler {
|
|
|
my $store; |
my $store; |
$tmpsnum++; |
$tmpsnum++; |
my $id=$$.'_'.$clientip.'_'.$tmpsnum; |
my $pid = $$; |
|
my $id=$$.'_'.$clientip.'_'.$tmpsnum.'_'.$pid; |
$id=~s/\W/\_/g; |
$id=~s/\W/\_/g; |
$what=~s/\n//g; |
$what=~s/\n//g; |
my $execdir=$perlvar{'lonDaemons'}; |
my $execdir=$perlvar{'lonDaemons'}; |
Line 4494 sub make_passwd_file {
|
Line 4498 sub make_passwd_file {
|
# |
# |
my $uid = getpwnam($uname); |
my $uid = getpwnam($uname); |
if((defined $uid) && ($uid == 0)) { |
if((defined $uid) && ($uid == 0)) { |
|
&logthis(">>>Attempted add of privileged account blocked<<<"); |
return "no_priv_account_error\n"; |
return "no_priv_account_error\n"; |
} |
} |
|
|
Line 4509 sub make_passwd_file {
|
Line 4514 sub make_passwd_file {
|
|
|
my $useraddok = $?; |
my $useraddok = $?; |
if($useraddok > 0) { |
if($useraddok > 0) { |
&logthis("Failed lcuseradd: ".&lcuseraddstrerror($useraddok)); |
my $lcstring = lcuseraddstrerror($useraddok); |
|
&logthis("Failed lcuseradd: $lcstring"); |
|
return "error: lcuseradd failed: $lcstring\n"; |
} |
} |
my $pf = IO::File->new(">$passfilename"); |
my $pf = IO::File->new(">$passfilename"); |
print $pf "unix:\n"; |
print $pf "unix:\n"; |