Diff for /loncom/auth/lonroles.pm between versions 1.182 and 1.183

version 1.182, 2008/01/26 21:12:32 version 1.183, 2008/01/30 01:18:58
Line 134  sub handler { Line 134  sub handler {
                     last;                      last;
                 }                  }
 # Is this a recent ad-hoc CA-role?  # Is this a recent ad-hoc CA-role?
                 if (my ($domain,$coursenum) =                  if (my ($domain,$user) =
     ($envkey =~ m-^form\.ca\./($match_domain)/($match_courseid)$-)) {      ($envkey =~ m-^form\.ca\./($match_domain)/($match_username)$-)) {
                     if ($dcroles{$domain}) {                      if (($dcroles{$domain}) && (&is_author_homeserver($user,$domain))) {
                         &check_privs($domain,$coursenum,$then,$now,'ca');                          &check_privs($domain,$user,$then,$now,'ca');
                       } else {
                           delete($env{$envkey});
                     }                      }
                     last;                      last;
                 }                  }
Line 147  sub handler { Line 149  sub handler {
                     if ($dcroles{$domain}) {                      if ($dcroles{$domain}) {
                         my $user=$env{'form.adhoccauname.'.$domain};                          my $user=$env{'form.adhoccauname.'.$domain};
                         if (!$user) { $user=$env{'form.adhoccaunamerecent.'.$domain} };                          if (!$user) { $user=$env{'form.adhoccaunamerecent.'.$domain} };
                         if (($user) && ($user=~/$match_username/)) {                           if (($user) && ($user=~/$match_username/) && (&is_author_homeserver($user,$domain))) { 
                            &check_privs($domain,$user,$then,$now,'ca');                             &check_privs($domain,$user,$then,$now,'ca');
                            $env{'form.ca./'.$domain.'/'.$user}=1;                             $env{'form.ca./'.$domain.'/'.$user}=1;
        }         }
Line 905  sub build_roletext { Line 907  sub build_roletext {
     return $roletext;      return $roletext;
 }  }
   
   sub is_author_homeserver {
       my ($uname,$udom)=@_;
       my $home = &Apache::lonnet::homeserver($uname,$udom);
       my @ids=&Apache::lonnet::current_machine_ids();
       foreach my $id (@ids) { 
          if ($id eq $home) { 
             if (-e "/home/".$uname."/public_html") {
                return 1;
             }
          }
       }
       return 0;
   }
   
 sub check_privs {  sub check_privs {
     my ($cdom,$cnum,$then,$now,$checkrole) = @_;      my ($cdom,$cnum,$then,$now,$checkrole) = @_;
     my $cckey = 'user.role.'.$checkrole.'./'.$cdom.'/'.$cnum;       my $cckey = 'user.role.'.$checkrole.'./'.$cdom.'/'.$cnum; 

Removed from v.1.182  
changed lines
  Added in v.1.183


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>
500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.