Changeset 14571

Show
Ignore:
Timestamp:
25.09.2007 12:39:27 (12 years ago)
Author:
qq6
Message:

added a uer_validation method

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/web/WEB-INF/cgi/gliserver4gs3.pl

    r14383 r14571  
    109109    &new_collection_directory($gsdl_cgi, $username, $timestamp, $site); 
    110110    } 
    111     elsif ($cmd eq "authenticate_user") { 
    112         &authenticate_user($gsdl_cgi, $username, "a1-t1", $site); 
     111    elsif ($cmd eq "user-validation") { 
     112        &user_validation($gsdl_cgi, $username, $timestamp, $site); 
    113113    } 
    114114    elsif ($cmd eq "run-script") { 
     
    265265#   ACTIONS 
    266266# ---------------------------------------------------------------------------------------------------- 
    267  
     267sub user_validation{ 
     268    #print "Content-type: text/html\n\n"; 
     269     my ($gsdl_cgi, $username, $timestamp, $site) = @_; 
     270    
     271    # Users can be in any group to perform this action 
     272    my $user_err = &authenticate_user($gsdl_cgi, $username, "", $site); 
     273     if (defined $user_err && $user_err!~ /ERROR/){ 
     274     if ($user_err!~ /ERROR/){ 
     275         #$gsdl_cgi->generate_error("Authentication failed: $username is not valid"); 
     276         $gsdl_cgi->generate_ok($user_err); 
     277         #print $user_err; 
     278     }else{ 
     279         $gsdl_cgi->generate_error($user_err); 
     280         #print "not valid" . $user_err; 
     281     } 
     282     }else{ 
     283     $gsdl_cgi->generate_error("Authentication failed: $username is not valid");      
     284     } 
     285} 
    268286 
    269287sub check_installation 
     
    590608{ 
    591609    my ($gsdl_cgi, $username, $timestamp, $site) = @_; 
     610 
     611    # Users can be in any group to perform this action 
     612    my $user_groups = &authenticate_user($gsdl_cgi, $username, "", $site); 
    592613 
    593614    my $file = $gsdl_cgi->clean_param("file");