Tatsuki SUGIURA
sugi****@users*****
2006年 7月 14日 (金) 14:39:44 JST
Index: slashjp/plugins/Login/login.pl diff -u slashjp/plugins/Login/login.pl:1.3 slashjp/plugins/Login/login.pl:1.4 --- slashjp/plugins/Login/login.pl:1.3 Wed Jul 12 20:41:50 2006 +++ slashjp/plugins/Login/login.pl Fri Jul 14 14:39:44 2006 @@ -2,7 +2,7 @@ # This code is a part of Slash, and is released under the GPL. # Copyright 1997-2005 by Open Source Technology Group. See README # and COPYING for more information, or see http://slashcode.com/. -# $Id: login.pl,v 1.3 2006/07/12 11:41:50 sugi Exp $ +# $Id: login.pl,v 1.4 2006/07/14 05:39:44 sugi Exp $ use strict; use Slash 2.003; @@ -10,9 +10,10 @@ use Slash::Display; use Slash::Utility; use Slash::XML; +use Slash::LDAPDB; use vars qw($VERSION); -($VERSION) = ' $Revision: 1.3 $ ' =~ /\$Revision:\s+([^\s]+)/; +($VERSION) = ' $Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/; sub main { my $slashdb = getCurrentDB(); @@ -59,7 +60,7 @@ _validFormkey('generate_formkey') or return; header(getData('newuserformhead')) or return; - slashDisplay('newUserForm', { note => $note }); + slashDisplay('newUserForm', { note => $note, form => $form }); footer(); } @@ -80,7 +81,11 @@ my @note; my $error = 0; - if (!$form->{email} || !emailValid($form->{email})) { + $ldap = Slash::LDAPDB->new(attrib_prefix => getCurrentStatic->{ldap_peer_attrib_prefix}); + if (!$form->{agree_priv_cont}) { + push @note, getData('not_agree_priv_cont'); + $error = 1; + } elsif (!$form->{email} || !emailValid($form->{email})) { push @note, getData('email_invalid'); $error = 1; } elsif ($form->{email} ne $form->{email2}) { @@ -89,6 +94,12 @@ } elsif ($slashdb->existsEmail($form->{email})) { push @note, getData('email_exists'); $error = 1; + } elsif ($constants->{ldap_enable} && (!defined($ldap) || !$ldap->bind())) { + push @note, getData('ldap_conn_fail'); + $error = 1; + } elsif ($constants->{ldap_enable} && $ldap->getUser($matchname) && !$ldap->authUser($matchname, $form->{peerpasswd}) { + push @note, getData('ldap_peer_pass_fail'); + $error = 1; } elsif ($matchname ne '' && $form->{newusernick} ne '') { if ($constants->{newuser_portscan}) { my $is_trusted = $slashdb->checkAL2($user->{srcids}, 'trusted');