Fixing stupidity.
This commit is contained in:
parent
908ead7a4e
commit
a77f92424c
3 changed files with 28 additions and 28 deletions
|
|
@ -66,8 +66,8 @@ sub authenticate {
|
|||
#-------------------------------------------------------------------
|
||||
sub adminForm {
|
||||
my $userData = WebGUI::Authentication::getParams($_[0],'LDAP');
|
||||
my $ldapURL = $session{form}{authLDAP.ldapURL} || $userData->{ldapURL} || $session{setting}{ldapURL};
|
||||
my $connectDN = $session{form}{authLDAP.connectDN} || $userData->{connectDN};
|
||||
my $ldapURL = $session{form}{'authLDAP.ldapURL'} || $userData->{ldapURL} || $session{setting}{ldapURL};
|
||||
my $connectDN = $session{form}{'authLDAP.connectDN'} || $userData->{connectDN};
|
||||
my $f;
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->readOnly('<b>'.optionsLabel().'</b>');
|
||||
|
|
@ -80,8 +80,8 @@ sub adminForm {
|
|||
sub adminFormSave {
|
||||
WebGUI::Authentication::saveParams($_[0],'LDAP',
|
||||
{
|
||||
connectDN => $session{form}{authLDAP.connectDN},
|
||||
ldapURL => $session{form}{authLDAP.ldapURL}
|
||||
connectDN => $session{form}{'authLDAP.connectDN'},
|
||||
ldapURL => $session{form}{'authLDAP.ldapURL'}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ sub registrationFormSave {
|
|||
%args = (port => $port);
|
||||
$ldap = Net::LDAP->new($uri->host, %args);
|
||||
$ldap->bind;
|
||||
$search = $ldap->search (base => $uri->dn, filter => $session{setting}{ldapId}."=".$session{form}{authLDAP.ldapId});
|
||||
$search = $ldap->search (base => $uri->dn, filter => $session{setting}{ldapId}."=".$session{form}{'authLDAP.ldapId'});
|
||||
if (defined $search->entry(0)) {
|
||||
$connectDN = "cn=".$search->entry(0)->get_value("cn");
|
||||
}
|
||||
|
|
@ -127,7 +127,7 @@ sub registrationFormSave {
|
|||
connectDN => $connectDN,
|
||||
ldapURL => $session{setting}{ldapURL}
|
||||
});
|
||||
return $session{form}{authLDAP.ldapId};
|
||||
return $session{form}{'authLDAP.ldapId'};
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -141,15 +141,15 @@ sub registrationFormValidate {
|
|||
}
|
||||
if ($ldap = Net::LDAP->new($uri->host, {port=>$port})) {
|
||||
if ($ldap->bind) {
|
||||
$search = $ldap->search (base=>$uri->dn,filter=>$session{setting}{ldapId}."=".$session{form}{authLDAP.ldapId});
|
||||
$search = $ldap->search (base=>$uri->dn,filter=>$session{setting}{ldapId}."=".$session{form}{'authLDAP.ldapId'});
|
||||
if (defined $search->entry(0)) {
|
||||
$connectDN = "cn=".$search->entry(0)->get_value("cn");
|
||||
$ldap->unbind;
|
||||
$ldap = Net::LDAP->new($uri->host, {port=>$port}) or $error .= WebGUI::International::get(2,'Auth/LDAP');
|
||||
$auth = $ldap->bind(dn=>$connectDN, password=>$session{form}{authLDAP.ldapPassword});
|
||||
$auth = $ldap->bind(dn=>$connectDN, password=>$session{form}{'authLDAP.ldapPassword'});
|
||||
if ($auth->code == 48 || $auth->code == 49) {
|
||||
$error .= '<li>'.WebGUI::International::get(68);
|
||||
WebGUI::ErrorHandler::warn("Invalid LDAP information for registration of LDAP ID: ".$session{form}{authLDAP.ldapId});
|
||||
WebGUI::ErrorHandler::warn("Invalid LDAP information for registration of LDAP ID: ".$session{form}{'authLDAP.ldapId'});
|
||||
} elsif ($auth->code > 0) {
|
||||
$error .= '<li>LDAP error "'.$ldapStatusCode{$auth->code}.'" occured. '
|
||||
.WebGUI::International::get(69);
|
||||
|
|
@ -158,7 +158,7 @@ sub registrationFormValidate {
|
|||
$ldap->unbind;
|
||||
} else {
|
||||
$error .= '<li>'.WebGUI::International::get(68);
|
||||
WebGUI::ErrorHandler::warn("Invalid LDAP information for registration of LDAP ID: ".$session{form}{authLDAP.ldapId});
|
||||
WebGUI::ErrorHandler::warn("Invalid LDAP information for registration of LDAP ID: ".$session{form}{'authLDAP.ldapId'});
|
||||
}
|
||||
} else {
|
||||
$error = WebGUI::International::get(2,'Auth/LDAP');
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@ sub authenticate {
|
|||
#-------------------------------------------------------------------
|
||||
sub adminForm {
|
||||
my $userData = WebGUI::Authentication::getParams($_[0], 'SMB');
|
||||
my $pdc = $session{form}{authSMB.smbPDC} || $userData->{smbPDC} || $session{setting}{smbPDC};
|
||||
my $bdc = $session{form}{authSMB.smbBDC} || $userData->{smbBDC} || $session{setting}{smbBDC};
|
||||
my $domain = $session{form}{authSMB.smbDomain} || $userData->{smbDomain} || $session{setting}{smbDomain};
|
||||
my $login = $session{form}{authSMB.smbLogin} || $userData->{smbLogin};
|
||||
my $pdc = $session{form}{'authSMB.smbPDC'} || $userData->{smbPDC} || $session{setting}{smbPDC};
|
||||
my $bdc = $session{form}{'authSMB.smbBDC'} || $userData->{smbBDC} || $session{setting}{smbBDC};
|
||||
my $domain = $session{form}{'authSMB.smbDomain'} || $userData->{smbDomain} || $session{setting}{smbDomain};
|
||||
my $login = $session{form}{'authSMB.smbLogin'} || $userData->{smbLogin};
|
||||
my $f;
|
||||
$f = WebGUI::HTMLForm->new;
|
||||
$f->readOnly('<b>'.optionsLabel().'</b>');
|
||||
|
|
@ -61,10 +61,10 @@ sub adminForm {
|
|||
sub adminFormSave {
|
||||
WebGUI::Authentication::saveParams($session{form}{uid},'SMB',
|
||||
{
|
||||
smbPDC => $session{form}{authSMB.smbPDC},
|
||||
smbBDC => $session{form}{authSMB.smbBDC},
|
||||
smbDomain => $session{form}{authSMB.smbDomain},
|
||||
smbLogin => $session{form}{authSMB.smbLogin}
|
||||
smbPDC => $session{form}{'authSMB.smbPDC'},
|
||||
smbBDC => $session{form}{'authSMB.smbBDC'},
|
||||
smbDomain => $session{form}{'authSMB.smbDomain'},
|
||||
smbLogin => $session{form}{'authSMB.smbLogin'}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ sub registrationFormSave {
|
|||
smbPDC => $session{setting}{smbPDC},
|
||||
smbBDC => $session{setting}{smbBDC},
|
||||
smbDomain => $session{setting}{smbDomain},
|
||||
smbLogin => $session{form}{authSMB.loginId}
|
||||
smbLogin => $session{form}{'authSMB.loginId'}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -101,8 +101,8 @@ sub registrationFormValidate {
|
|||
$pdc = $session{setting}{smbPDC};
|
||||
$bdc = $session{setting}{smbBDC};
|
||||
$ntDomain = $session{setting}{smbDomain};
|
||||
$smbLogin = $session{form}{authSMB.loginId};
|
||||
$smb = Authen::Smb::authen($smbLogin, $session{form}{authSMB.smbPassword}, $pdc, $bdc, $ntDomain);
|
||||
$smbLogin = $session{form}{'authSMB.loginId'};
|
||||
$smb = Authen::Smb::authen($smbLogin, $session{form}{'authSMB.smbPassword'}, $pdc, $bdc, $ntDomain);
|
||||
if ($smb > 0) {
|
||||
$error = '<li>'. $smbError{$smb} . "pdc: $pdc, bdc: $bdc, domain: $ntDomain";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ sub adminForm {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
sub adminFormSave {
|
||||
unless ($session{form}{authWebGUI.identifier} eq "password") {
|
||||
WebGUI::Authentication::saveParams($_[0],'WebGUI',{identifier => Digest::MD5::md5_base64($session{form}{authWebGUI.identifier})});
|
||||
unless ($session{form}{'authWebGUI.identifier'} eq "password") {
|
||||
WebGUI::Authentication::saveParams($_[0],'WebGUI',{identifier => Digest::MD5::md5_base64($session{form}{'authWebGUI.identifier'})});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -75,13 +75,13 @@ sub registrationFormSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub registrationFormValidate {
|
||||
my ($error);
|
||||
if ($session{form}{authWebGUI.identifier} ne $session{form}{authWebGUI.identifierConfirm}) {
|
||||
if ($session{form}{'authWebGUI.identifier'} ne $session{form}{'authWebGUI.identifierConfirm'}) {
|
||||
$error = '<li>'.WebGUI::International::get(3,'Auth/WebGUI');
|
||||
}
|
||||
if ($session{form}{authWebGUI.identifier} eq "password") {
|
||||
if ($session{form}{'authWebGUI.identifier'} eq "password") {
|
||||
$error .= '<li>'.WebGUI::International::get(5,'Auth/WebGUI');
|
||||
}
|
||||
if ($session{form}{authWebGUI.identifier} eq "") {
|
||||
if ($session{form}{'authWebGUI.identifier'} eq "") {
|
||||
$error .= '<li>'.WebGUI::International::get(4,'Auth/WebGUI');
|
||||
}
|
||||
return $error;
|
||||
|
|
@ -109,10 +109,10 @@ sub userFormSave {
|
|||
#-------------------------------------------------------------------
|
||||
sub userFormValidate {
|
||||
my ($error);
|
||||
if ($session{form}{authWebGUI.identifier} ne $session{form}{identifierConfirm}) {
|
||||
if ($session{form}{'authWebGUI.identifier'} ne $session{form}{identifierConfirm}) {
|
||||
$error = '<li>'.WebGUI::International::get(3,'Auth/WebGUI');
|
||||
}
|
||||
if ($session{form}{authWebGUI.identifier} eq "") {
|
||||
if ($session{form}{'authWebGUI.identifier'} eq "") {
|
||||
$error .= '<li>'.WebGUI::International::get(4,'Auth/WebGUI');
|
||||
}
|
||||
return $error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue