version 1.11, 2007/09/29 02:09:50
|
version 1.15, 2009/04/14 23:52:07
|
Line 67 sub handler {
|
Line 67 sub handler {
|
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['token']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['token']); |
my %data = &Apache::lonnet::tmpget($env{'form.token'}); |
my %data = &Apache::lonnet::tmpget($env{'form.token'}); |
|
if (keys(%data) == 0) { |
|
return &goto_login($r); |
|
} |
my $delete = &Apache::lonnet::tmpdel($env{'form.token'}); |
my $delete = &Apache::lonnet::tmpdel($env{'form.token'}); |
|
|
&Apache::lonlocal::get_language_handle($r); |
&Apache::lonlocal::get_language_handle($r); |
Line 87 sub handler {
|
Line 90 sub handler {
|
my $extra_env = &sso_check(\%data); |
my $extra_env = &sso_check(\%data); |
|
|
if (!$data{'role'}) { |
if (!$data{'role'}) { |
# check for exisiting valid session |
my $handle = &Apache::lonnet::check_for_valid_session($r); |
my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); |
if ($handle) { |
my $lonid=$cookies{'lonID'}; |
|
my $handle; |
|
if ($lonid) { |
|
$handle=&LONCAPA::clean_handle($lonid->value); |
|
} |
|
if ($lonid |
|
&& -e $r->dir_config('lonIDsDir').'/'.$handle.'.id' |
|
&& $handle ne '') { |
|
&Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'), |
&Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'), |
$handle); |
$handle); |
if ($env{'request.course.id'}) { |
if ($data{'origurl'} ne '') { |
$r->internal_redirect('/adm/navmaps'); |
$r->internal_redirect($data{'origurl'}); |
|
} elsif ($env{'request.course.id'}) { |
|
$r->internal_redirect('/adm/navmaps'); |
} else { |
} else { |
$r->internal_redirect('/adm/roles'); |
$r->internal_redirect('/adm/roles'); |
} |
} |
} else { |
} else { |
|
my $desturl = '/adm/roles'; |
|
if ($data{'origurl'} ne '') { |
|
$desturl = $data{'origurl'}; |
|
} |
&Apache::lonauth::success($r,$data{'username'},$data{'domain'}, |
&Apache::lonauth::success($r,$data{'username'},$data{'domain'}, |
$home,'/adm/roles',$extra_env); |
$home,$desturl,$extra_env); |
|
|
} |
} |
return OK; |
return OK; |
Line 114 sub handler {
|
Line 115 sub handler {
|
} |
} |
|
|
my $next_url='/adm/roles?selectrole=1&'.&escape($data{'role'}).'=1'; |
my $next_url='/adm/roles?selectrole=1&'.&escape($data{'role'}).'=1'; |
|
if ($data{'origurl'} ne '') { |
|
$next_url .= '&orgurl='.&escape($data{'origurl'}); |
|
} |
|
if ($data{'symb'} ne '') { |
|
$next_url .= '&symb='.&escape($data{'symb'}); |
|
} |
|
|
&Apache::lonauth::success($r,$data{'username'},$data{'domain'},$home, |
&Apache::lonauth::success($r,$data{'username'},$data{'domain'},$home, |
$next_url,$extra_env); |
$next_url,$extra_env); |