Project

General

Profile

« Previous | Next » 

Revision 4901

Added by walbridge over 15 years ago

Three small fixes:
- 'salutation' was misspelled and wasn't picked up correctly in document modificiation
- keyword handling wasn't setting the thesaurus correctly
- check against the full list of moderators for the ACL validation

View differences:

src/perl/register-dataset.cgi
2035 2035
            dontOccur($node, "../positionName|../onlineURL|../userId", 
2036 2036
              "positionName, onlineURL, userId");
2037 2037
        
2038
            dontOccur($node, "./saluation", "saluation");                
2038
            dontOccur($node, "./salutation", "salutation");                
2039 2039
        
2040 2040
            debug("Checking a creator in loop 1...");
2041 2041
            $tempResult = $node->findnodes('../address|../phone|../electronicmailAddress|../organizationName');
......
2217 2217

  
2218 2218
    my $count = 1;
2219 2219
    foreach $node ($results->get_nodelist) {
2220
        my $thesaurus = findValue($node, "keywordThesaurus");
2220 2221
        $tempResult = $node->findnodes('./keyword');
2221 2222
        foreach $tempNode ($tempResult->get_nodelist) {
2222 2223
            $$templateVars{"keyword$count"} = $tempNode->textContent();
2223 2224
            if ($tempNode->hasAttributes()) {
2224 2225
                my @attlist = $tempNode->attributes();
2225
                my $tmp = $attlist[0]->value;  #convert the first letter to upper case
2226
                $tmp =~ s/\b(\w)/\U$1/g;
2226
                my $tmp = $attlist[0]->value;
2227
                $tmp =~ s/\b(\w)/\U$1/g; # convert the first letter to upper case
2227 2228
                $$templateVars{"kwType$count"} = $tmp;
2228 2229
            }
2230
            $$templateVars{"kwTh$count"} = $thesaurus;
2231
            #debug("Keyword Found: $count `" . $tempNode->textContent() . "`, $thesaurus");
2232
            $count++;
2229 2233
        }
2230
        $$templateVars{"kwTh$count"} = findValue($node, "keywordThesaurus");
2231
        $count++;
2232 2234
    }
2233 2235

  
2234 2236
    $$templateVars{'keyCount'} = $count;
......
2579 2581
                $permission = $child->textContent();
2580 2582
            }
2581 2583
        }
2584
        # if the principal is any one of the moderators, the script will handle it
2585
        my @admins = $moderators;
2586
        push(@admins, $adminUsername);
2582 2587

  
2583 2588
        if ($principal eq 'public' && $permission ne 'read') { $accessError = 1; }
2584 2589
        if ($principal eq $adminUsername && $permission ne 'all') { $accessError = 2; }
2585
        if ($principal ne 'public' && $principal ne $adminUsername && $permission ne 'all') { $accessError = 3; }
2590
        if ($principal ne 'public' && !grep {$_ eq $principal} @admins && $permission ne 'all') { $accessError = 3; }
2586 2591
        # TODO: FIXME for 1.9.1
2587 2592
        # The ESA skin has a separate concept of 'moderator', which is defined by a property
2588 2593
        # within the configuration. This should be updated to check the user against the groups.

Also available in: Unified diff