Diff for /loncom/lond between versions 1.489.2.43.2.7 and 1.489.2.43.2.11

version 1.489.2.43.2.7, 2023/07/05 21:55:22 version 1.489.2.43.2.11, 2024/08/18 16:20:24
Line 2834  sub user_has_session_handler { Line 2834  sub user_has_session_handler {
 }  }
 &register_handler("userhassession", \&user_has_session_handler, 0,1,0);  &register_handler("userhassession", \&user_has_session_handler, 0,1,0);
   
   sub del_usersession_handler {
       my ($cmd, $tail, $client) = @_;
   
       my $result;
       my ($udom, $uname) = map { &unescape($_) } (split(/:/, $tail));
       if (($udom =~ /^$LONCAPA::match_domain$/) && ($uname =~ /^$LONCAPA::match_username$/)) {
           my $lonidsdir = $perlvar{'lonIDsDir'};
           if (-d $lonidsdir) {
               if (opendir(DIR,$lonidsdir)) {
                   my $filename;
                   while ($filename=readdir(DIR)) {
                       if ($filename=~/^\Q$uname\E_\d+_\Q$udom\E_/) {
                           if (tie(my %oldenv,'GDBM_File',"$lonidsdir/$filename",
                                   &GDBM_READER(),0640)) {
                               my $linkedfile;
                               if (exists($oldenv{'user.linkedenv'})) {
                                   $linkedfile = $oldenv{'user.linkedenv'};
                               }
                               untie(%oldenv);
                               $result = unlink("$lonidsdir/$filename");
                               if ($result) {
                                   if ($linkedfile =~ /^[a-f0-9]+_linked$/) {
                                       if (-l "$lonidsdir/$linkedfile.id") {
                                           unlink("$lonidsdir/$linkedfile.id");
                                       }
                                   }
                               }
                           } else {
                               $result = unlink("$lonidsdir/$filename");
                           }
                           last;
                       }
                   }
               }
           }
           if ($result == 1) {
               &Reply($client, "$result\n", "$cmd:$tail");
           } else {
               &Reply($client, "not_found\n", "$cmd:$tail");
           }
       } else {
           &Failure($client, "invalid_user\n", "$cmd:$tail");
       }
       return 1;
   }
   
   &register_handler("delusersession", \&del_usersession_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 4893  sub lti_handler { Line 4941  sub lti_handler {
 #  Side effects:  #  Side effects:
 #     The reply will contain the LTI payload, as & separated key=value pairs,  #     The reply will contain the LTI payload, as & separated key=value pairs,
 #     where value is itself a frozen hash, if the required key and secret  #     where value is itself a frozen hash, if the required key and secret
 #     for the apecific tool ID are available. The payload data are retrieved from  #     for the specific tool ID are available. The payload data are retrieved from
 #     a call to Lond::sign_lti_payload(), and the reply is encrypted before being  #     a call to Lond::sign_lti_payload(), and the reply is encrypted before being
 #     written to $client.  #     written to $client.
 #  #
Line 7028  undef $perlvarref; Line 7076  undef $perlvarref;
 # ----------------------------- Make sure this process is running from user=www  # ----------------------------- Make sure this process is running from user=www
 my $wwwid=getpwnam('www');  my $wwwid=getpwnam('www');
 if ($wwwid!=$<) {  if ($wwwid!=$<) {
    my $emailto="$perlvar{'lonAdmEMail'},$perlvar{'lonSysEMail'}";     my $emailto="$perlvar{'lonAdmEMail'} $perlvar{'lonSysEMail'}";
    my $subj="LON: $currenthostid User ID mismatch";     my $subj="LON: $currenthostid User ID mismatch";
    system("echo 'User ID mismatch.  lond must be run as user www.' |".     system("echo 'User ID mismatch.  lond must be run as user www.' |".
           " mail -s '$subj' $emailto > /dev/null");            " mail -s '$subj' $emailto > /dev/null");
Line 8236  sub currentversion { Line 8284  sub currentversion {
     if (-e $ulsdir) {      if (-e $ulsdir) {
  if(-d $ulsdir) {   if(-d $ulsdir) {
     if (opendir(LSDIR,$ulsdir)) {      if (opendir(LSDIR,$ulsdir)) {
                   if (-e $fname) {
                       $version=0;
                   }
  my $ulsfn;   my $ulsfn;
  while ($ulsfn=readdir(LSDIR)) {   while ($ulsfn=readdir(LSDIR)) {
 # see if this is a regular file (ignore links produced earlier)  # see if this is a regular file (ignore links produced earlier)

Removed from v.1.489.2.43.2.7  
changed lines
  Added in v.1.489.2.43.2.11


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>