Project

General

Profile

« Previous | Next » 

Revision 4870

Added by walbridge over 15 years ago

Include hack for UCNRS organization properties.

View differences:

ldapweb.cgi
117 117

  
118 118
my $config = $skinProperties->splitToTree(qr/\./, 'registry.config');
119 119

  
120
# XXX HACK: this is a temporary fix to pull out the UCNRS password property from the
121
#           NRS skin instead of metacat.properties. The intent is to prevent editing
122
#           of our core properties file, which is manipulated purely through the web.
123
#           Once organizations are editable, this section should be removed as should
124
#           the properties within nrs/nrs.properties.
125
my $nrsProperties = new Config::Properties();
126
my $nrsProps = "$skinsDir/nrs/nrs.properties";
127
unless (open (NRS_PROPERTIES, $nrsProps)) {
128
    print "Content-type: text/html\n\n";
129
    print "Unable to locate skin properties at $nrsProps.  Is this path correct?";
130
    exit(0);
131
}
132
$nrsProperties->load(*NRS_PROPERTIES);
133

  
134
my $nrsConfig = $nrsProperties->splitToTree(qr/\./, 'registry.config');
135

  
136
# XXX END HACK
137

  
138

  
120 139
my $searchBase;
121 140
my $ldapUsername;
122 141
my $ldapPassword;
......
157 176
my $orgNames = $properties->splitToTree(qr/\./, 'organization.name');
158 177
# pull out properties available e.g. 'name', 'base'
159 178
my @orgData = keys(%$orgProps);
179

  
160 180
my @orgList;
161 181
while (my ($oKey, $oVal) = each(%$orgNames)) {
162 182
    push(@orgList, $oKey);
......
169 189
        $ldapConfig->{$o}{$d} = $properties->getProperty("organization.$d.$o");
170 190
    }
171 191

  
192
    # XXX hack, remove after 1.9
193
    if ($o eq 'UCNRS') {
194
        $ldapConfig->{'UCNRS'}{'base'} = $nrsConfig->{'base'};
195
        $ldapConfig->{'UCNRS'}{'user'} = $nrsConfig->{'username'};
196
        $ldapConfig->{'UCNRS'}{'password'} = $nrsConfig->{'password'};
197
    }
198

  
172 199
    # set default base
173 200
    if (!$ldapConfig->{$o}{'base'}) {
174 201
        $ldapConfig->{$o}{'base'} = $authBase;

Also available in: Unified diff