sub setup { my $self = shift; $self->start_mode('mode1'); $self->run_modes( 'mode1' => 'showSelectGroup', 'mode2' => 'showSelectGroupEmail', 'mode3' => 'showComposeMessage', 'mode4' => 'showConfirm' ); $self->tmpl_path("c:/Apache/htdocs/ncimail/"); my @prop; # Store the properties in a file so it is easily changed. open(PROP,"c:/apache/prop/ldap.properties") || die "Can't open ldap.properties for reading!"; while() { chomp; push(@prop, $_); } close(PROP); my $hostname = $prop[4]; my $search_dn = $prop[5]; my $search_pwd = $prop[6]; my $scope = $prop[7]; my $port = $prop[8]; my $ldap = Net::LDAPS->new($hostname,port => $port,timeout => TIMEOUT) or die "Can't connect to LDAP server " . $hostname; my $result = $ldap->bind($search_dn, password => $search_pwd, version => 3); my $error = $result->error(); if($error ne "Success") { print ("
LDAP Bind Error: $error
"); exit; } my %session; my $id; tie %session, 'Apache::Session::File', $id, {Directory => 'c:/apache/tmp/sessions', LockDirectory => 'c:/apache/tmp/lock'}; my $session_id = $session{_session_id}; $self->param('session_id' => $session_id); }