version 1.114, 2008/03/08 02:45:14
|
version 1.117, 2008/11/10 13:20:24
|
Line 150 sub get_posted_cgi {
|
Line 150 sub get_posted_cgi {
|
# balance them |
# balance them |
# returns OK if it was a SSO and user was handled |
# returns OK if it was a SSO and user was handled |
# undef if not SSO or no means to hanle the user |
# undef if not SSO or no means to hanle the user |
|
|
sub sso_login { |
sub sso_login { |
my ($r,$handle) = @_; |
my ($r,$handle) = @_; |
|
|
Line 187 sub sso_login {
|
Line 188 sub sso_login {
|
'server' => $r->dir_config('lonHostID'), |
'server' => $r->dir_config('lonHostID'), |
'sso.login' => 1 |
'sso.login' => 1 |
); |
); |
|
if ($r->dir_config("ssodirecturl") == 1) { |
|
$info{'origurl'} = $r->uri; |
|
} |
if (defined($r->dir_config("lonSSOReloginServer"))) { |
if (defined($r->dir_config("lonSSOReloginServer"))) { |
$info{'sso.reloginserver'} = |
$info{'sso.reloginserver'} = |
$r->dir_config('lonSSOReloginServer'); |
$r->dir_config('lonSSOReloginServer'); |
Line 203 sub sso_login {
|
Line 207 sub sso_login {
|
&Apache::lonnet::logthis(" SSO authorized unknown user $user "); |
&Apache::lonnet::logthis(" SSO authorized unknown user $user "); |
$r->subprocess_env->set('SSOUserUnknown' => $user); |
$r->subprocess_env->set('SSOUserUnknown' => $user); |
$r->subprocess_env->set('SSOUserDomain' => $domain); |
$r->subprocess_env->set('SSOUserDomain' => $domain); |
$r->internal_redirect($r->dir_config('lonSSOUserUnknownRedirect')); |
my @cancreate; |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['usercreation'],$domain); |
|
if (ref($domconfig{'usercreation'}) eq 'HASH') { |
|
if (ref($domconfig{'usercreation'}{'cancreate'}) eq 'HASH') { |
|
if (ref($domconfig{'usercreation'}{'cancreate'}{'selfcreate'}) eq 'ARRAY') { |
|
@cancreate = @{$domconfig{'usercreation'}{'cancreate'}{'selfcreate'}}; |
|
} elsif (($domconfig{'usercreation'}{'cancreate'}{'selfcreate'} ne 'none') && |
|
($domconfig{'usercreation'}{'cancreate'}{'selfcreate'} ne '')) { |
|
@cancreate = ($domconfig{'usercreation'}{'cancreate'}{'selfcreate'}); |
|
} |
|
} |
|
} |
|
if (grep(/^sso$/,@cancreate)) { |
|
$r->internal_redirect('/adm/createaccount'); |
|
} else { |
|
$r->internal_redirect($r->dir_config('lonSSOUserUnknownRedirect')); |
|
} |
$r->set_handlers('PerlHandler'=> undef); |
$r->set_handlers('PerlHandler'=> undef); |
return OK; |
return OK; |
} |
} |
Line 222 sub handler {
|
Line 243 sub handler {
|
|
|
my $result = &sso_login($r,$handle); |
my $result = &sso_login($r,$handle); |
if (defined($result)) { |
if (defined($result)) { |
return $result |
return $result; |
} |
} |
|
|
|
|