Ignore:
Timestamp:
2012-09-18T18:10:37+12:00 (12 years ago)
Author:
ak19
Message:

Fixes to get Remote Greenstone 3 working with client-gli: 1. client-GLI should not start the local GS3 server, since client-GLI will be running against a remote server. 2. The encryption process for authentication had been changed for GS3, so now Authentication.java has a main function which is invoked by gliserver's gsdlCGI.pm to encrypt the password. 4. UsersDB when converted to txt for parsing by gliserver.pl has a different structure, so gliserver.pl needs to take that into account. 5. util.pm's functions for prepending and appending to environment variables needs to use an OS dependant path separator. This was not noticed when testing the remote GS server on 32 bit linux so far, but the windows style path separator (semicolon) used so far didn't work on the 64 bit linux test machine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/cgi-bin/gliserver.pl

    r25963 r26206  
    230230    # Get the user account information from the usersDB database
    231231    my %users_db_data = ();
    232     foreach my $users_db_entry (split(/-{70}/, $users_db_content)) {
    233     if ($users_db_entry =~ m/\n?\[(.+)\]\n/) {
     232
     233    # a line dividing one user entry from another is made up of 70 hyphens for GS2 (37 hyphens for GS3)
     234    my $horizontal_divider = ($gsdl_cgi->greenstone_version() == 2) ? q/-{70}/ : q/-{37}/;
     235    foreach my $users_db_entry (split($horizontal_divider, $users_db_content)) {   
     236    if ($users_db_entry =~ m/\n?\[(.+)\]\n/ || $users_db_entry =~ m/\n?USERNAME = ([^\n]*)\n/) { # GS2 and GS3 formats
    234237        $users_db_data{$1} = $users_db_entry;
    235238    }
     
    243246
    244247    # Check password
    245     my ($valid_user_password) = ($user_data =~ m/\<password\>(.*)/);
     248    my $pwdLine = ($gsdl_cgi->greenstone_version() == 2) ? q/\<password\>(.*)/ : q/\n?PASSWORD = (.*)\n/;
     249    my ($valid_user_password) = ($user_data =~ m/$pwdLine/);
    246250    if ($user_password ne $valid_user_password) {
    247251    $gsdl_cgi->generate_error("Authentication failed: incorrect password.");
     
    249253
    250254    # Check group
    251     my ($user_groups) = ($user_data =~ m/\<groups\>(.*)/);
     255    my $groupLine = ($gsdl_cgi->greenstone_version() == 2) ? q/\<groups\>(.*)/ : q/\n?GROUPS = (.*)\n/;
     256    my ($user_groups) = ($user_data =~ m/$groupLine/);
    252257
    253258    if ($collection eq "") {
Note: See TracChangeset for help on using the changeset viewer.