version 1.373, 2007/04/10 23:11:30
|
version 1.380.2.1, 2007/09/29 04:05:29
|
Line 135 my @adderrors = ("ok",
|
Line 135 my @adderrors = ("ok",
|
"lcuseradd Unable to make www member of users's group", |
"lcuseradd Unable to make www member of users's group", |
"lcuseradd Unable to su to root", |
"lcuseradd Unable to su to root", |
"lcuseradd Unable to set password", |
"lcuseradd Unable to set password", |
"lcuseradd Usrname has invalid characters", |
"lcuseradd Username has invalid characters", |
"lcuseradd Password has an invalid character", |
"lcuseradd Password has an invalid character", |
"lcuseradd User already exists", |
"lcuseradd User already exists", |
"lcuseradd Could not add user.", |
"lcuseradd Could not add user.", |
Line 2095 sub rename_user_file_handler {
|
Line 2095 sub rename_user_file_handler {
|
®ister_handler("renameuserfile", \&rename_user_file_handler, 0,1,0); |
®ister_handler("renameuserfile", \&rename_user_file_handler, 0,1,0); |
|
|
# |
# |
|
# Checks if the specified user has an active session on the server |
|
# return ok if so, not_found if not |
|
# |
|
# Parameters: |
|
# cmd - The request keyword that dispatched to tus. |
|
# tail - The tail of the request (colon separated parameters). |
|
# client - Filehandle open on the client. |
|
# Return: |
|
# 1. |
|
sub user_has_session_handler { |
|
my ($cmd, $tail, $client) = @_; |
|
|
|
my ($udom, $uname) = map { &unescape($_) } (split(/:/, $tail)); |
|
|
|
&logthis("Looking for $udom $uname"); |
|
opendir(DIR,$perlvar{'lonIDsDir'}); |
|
my $filename; |
|
while ($filename=readdir(DIR)) { |
|
last if ($filename=~/^\Q$uname\E_\d+_\Q$udom\E_/); |
|
} |
|
if ($filename) { |
|
&Reply($client, "ok\n", "$cmd:$tail"); |
|
} else { |
|
&Failure($client, "not_found\n", "$cmd:$tail"); |
|
} |
|
return 1; |
|
|
|
} |
|
®ister_handler("userhassession", \&user_has_session_handler, 0,1,0); |
|
|
|
# |
# Authenticate access to a user file by checking that the token the user's |
# Authenticate access to a user file by checking that the token the user's |
# passed also exists in their session file |
# passed also exists in their session file |
# |
# |
Line 2187 sub subscribe_handler {
|
Line 2218 sub subscribe_handler {
|
®ister_handler("sub", \&subscribe_handler, 0, 1, 0); |
®ister_handler("sub", \&subscribe_handler, 0, 1, 0); |
|
|
# |
# |
# Determine the version of a resource (?) Or is it return |
# Determine the latest version of a resource (it looks for the highest |
# the top version of the resource? Not yet clear from the |
# past version and then returns that +1) |
# code in currentversion. |
|
# |
# |
# Parameters: |
# Parameters: |
# $cmd - The command that got us here. |
# $cmd - The command that got us here. |
# $tail - Tail of the command (remaining parameters). |
# $tail - Tail of the command (remaining parameters). |
|
# (Should consist of an absolute path to a file) |
# $client - File descriptor connected to client. |
# $client - File descriptor connected to client. |
# Returns |
# Returns |
# 0 - Requested to exit, caller should shut down. |
# 0 - Requested to exit, caller should shut down. |
Line 5048 sub UpdateHosts {
|
Line 5079 sub UpdateHosts {
|
|
|
foreach my $child (keys(%children)) { |
foreach my $child (keys(%children)) { |
my $childip = $children{$child}; |
my $childip = $children{$child}; |
if (!defined(&Apache::lonnet::get_hosts_from_ip($childip))) { |
if ($childip ne '127.0.0.1' |
|
&& !defined(&Apache::lonnet::get_hosts_from_ip($childip))) { |
logthis('<font color="blue"> UpdateHosts killing child ' |
logthis('<font color="blue"> UpdateHosts killing child ' |
." $child for ip $childip </font>"); |
." $child for ip $childip </font>"); |
kill('INT', $child); |
kill('INT', $child); |
Line 5485 sub make_new_child {
|
Line 5517 sub make_new_child {
|
# ---------------- New known client connecting, could mean machine online again |
# ---------------- New known client connecting, could mean machine online again |
if (&Apache::lonnet::get_host_ip($currenthostid) ne $clientip |
if (&Apache::lonnet::get_host_ip($currenthostid) ne $clientip |
&& $clientip ne '127.0.0.1') { |
&& $clientip ne '127.0.0.1') { |
&Apache::lonnet::reconlonc(); |
&Apache::lonnet::reconlonc($clientname); |
} |
} |
&logthis("<font color='green'>Established connection: $clientname</font>"); |
&logthis("<font color='green'>Established connection: $clientname</font>"); |
&status('Will listen to '.$clientname); |
&status('Will listen to '.$clientname); |
Line 5769 sub validate_user {
|
Line 5801 sub validate_user {
|
$password, |
$password, |
$credentials); |
$credentials); |
$validated = ($krbreturn == 1); |
$validated = ($krbreturn == 1); |
|
if (!$validated) { |
|
&logthis('krb5: '.$user.', '.$contentpwd.', '. |
|
&Authen::Krb5::error()); |
|
} |
} else { |
} else { |
$validated = 0; |
$validated = 0; |
} |
} |