version 1.317, 2006/02/07 05:08:27
|
version 1.321, 2006/02/21 18:43:37
|
Line 4348 sub photo_permission_handler {
|
Line 4348 sub photo_permission_handler {
|
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
my $cdom = $tail; |
my $cdom = $tail; |
my ($perm_reqd,$conditions); |
my ($perm_reqd,$conditions); |
my $outcome = &localenroll::photo_permission($cdom,\$perm_reqd, |
my $outcome; |
\$conditions); |
eval { |
&Reply($client, &escape($outcome.':'.$perm_reqd.':'. $conditions)."\n", |
local($SIG{__DIE__})='DEFAULT'; |
$userinput); |
$outcome = &localenroll::photo_permission($cdom,\$perm_reqd, |
|
\$conditions); |
|
}; |
|
if (!$@) { |
|
&Reply($client, &escape($outcome.':'.$perm_reqd.':'. $conditions)."\n", |
|
$userinput); |
|
} else { |
|
&Failure($client,"unknown_cmd\n",$userinput); |
|
} |
|
return 1; |
} |
} |
®ister_handler("autophotopermission",\&photo_permission_handler,0,1,0); |
®ister_handler("autophotopermission",\&photo_permission_handler,0,1,0); |
|
|
Line 4376 sub photo_check_handler {
|
Line 4385 sub photo_check_handler {
|
my $result = &localstudentphoto::fetch($udom,$uname,$pid,\$response); |
my $result = &localstudentphoto::fetch($udom,$uname,$pid,\$response); |
$result .= ':'.$response; |
$result .= ':'.$response; |
&Reply($client, &escape($result)."\n",$userinput); |
&Reply($client, &escape($result)."\n",$userinput); |
|
return 1; |
} |
} |
®ister_handler("autophotocheck",\&photo_check_handler,0,1,0); |
®ister_handler("autophotocheck",\&photo_check_handler,0,1,0); |
|
|
Line 4389 sub photo_choice_handler {
|
Line 4399 sub photo_choice_handler {
|
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
my $cdom = &unescape($tail); |
my $cdom = &unescape($tail); |
my ($update,$comment) = &localenroll::manager_photo_update($cdom); |
my ($update,$comment); |
&Reply($client,&escape($update).':'.&escape($comment)."\n",$userinput); |
eval { |
|
local($SIG{__DIE__})='DEFAULT'; |
|
($update,$comment) = &localenroll::manager_photo_update($cdom); |
|
}; |
|
if (!$@) { |
|
&Reply($client,&escape($update).':'.&escape($comment)."\n",$userinput); |
|
} else { |
|
&Failure($client,"unknown_cmd\n",$userinput); |
|
} |
|
return 1; |
} |
} |
®ister_handler("autophotochoice",\&photo_choice_handler,0,1,0); |
®ister_handler("autophotochoice",\&photo_choice_handler,0,1,0); |
|
|
Line 4423 sub student_photo_handler {
|
Line 4442 sub student_photo_handler {
|
&mkpath($path); |
&mkpath($path); |
my $file; |
my $file; |
if ($type eq 'thumbnail') { |
if ($type eq 'thumbnail') { |
$file=&localstudentphoto::fetch_thumbnail($domain,$uname); |
eval { |
|
local($SIG{__DIE__})='DEFAULT'; |
|
$file=&localstudentphoto::fetch_thumbnail($domain,$uname); |
|
}; |
} else { |
} else { |
$file=&localstudentphoto::fetch($domain,$uname); |
$file=&localstudentphoto::fetch($domain,$uname); |
} |
} |
Line 5146 sub sub_sql_reply {
|
Line 5168 sub sub_sql_reply {
|
Type => SOCK_STREAM, |
Type => SOCK_STREAM, |
Timeout => 10) |
Timeout => 10) |
or return "con_lost"; |
or return "con_lost"; |
print $sclient "$cmd\n"; |
print $sclient "$cmd:$currentdomainid\n"; |
my $answer=<$sclient>; |
my $answer=<$sclient>; |
chomp($answer); |
chomp($answer); |
if (!$answer) { $answer="con_lost"; } |
if (!$answer) { $answer="con_lost"; } |
Line 5481 sub is_author {
|
Line 5503 sub is_author {
|
|
|
# Author role should show up as a key /domain/_au |
# Author role should show up as a key /domain/_au |
|
|
my $key = "/$domain/_au"; |
my $key = "/$domain/_au"; |
my $value = $hashref->{$key}; |
my $value; |
|
if (defined($hashref)) { |
|
$value = $hashref->{$key}; |
|
} |
|
|
if(defined($value)) { |
if(defined($value)) { |
&Debug("$user @ $domain is an author"); |
&Debug("$user @ $domain is an author"); |