svnno****@sourc*****
svnno****@sourc*****
2008年 1月 4日 (金) 14:00:04 JST
Revision: 402 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=slashdotjp&view=rev&rev=402 Author: caesar Date: 2008-01-04 14:00:04 +0900 (Fri, 04 Jan 2008) Log Message: ----------- creation and deletion are tested Modified Paths: -------------- slashjp/branches/deluser/Slash/LDAPDB/lib/Slash/LDAPDB.pm -------------- next part -------------- Modified: slashjp/branches/deluser/Slash/LDAPDB/lib/Slash/LDAPDB.pm =================================================================== --- slashjp/branches/deluser/Slash/LDAPDB/lib/Slash/LDAPDB.pm 2008-01-04 04:02:25 UTC (rev 401) +++ slashjp/branches/deluser/Slash/LDAPDB/lib/Slash/LDAPDB.pm 2008-01-04 05:00:04 UTC (rev 402) @@ -34,8 +34,11 @@ our %PREFIX_KEY; @PREFIX_KEY{qw(UidNumber Passwd Email Realname)} = (); -our %keymap_s2l; +our %keymap_s2l = (uid => 'UidNumber', passwd => 'Passwd', nickname => 'displayName', + matchname => 'cn', realname => 'Realname', realemail => 'Email' + ); our %keymap_l2s; + @ keymap_l2s{@keymap_s2l{keys(%keymap_s2l)}} = keys(%keymap_s2l); # make reverse map our $DEBUG_LEVEL = 5; @@ -52,11 +55,6 @@ @_ }; bless $self, $class; - our %keymap_s2l = (uid => 'UidNumber', passwd => $constants->{ldap_attrib_prefix}.'Passwd', nickname => 'displayName', - matchname => 'cn', realname => $constants->{ldap_attrib_prefix}.'Realname', realemail => $constants->{ldap_attrib_prefix}.'Email' - ); - @keymap_l2s{@keymap_s2l{keys(%keymap_s2l)}} = keys(%keymap_s2l); # make reverse map - $DEBUG_LEVEL = $constants->{ldap_debug_level} || $DEBUG_LEVEL; if (!$self->{_disabled} && @@ -162,12 +160,12 @@ __debug(8, "LDAP::deleteUser: User $user is also OTP's. The LDAP entry is only modified."); $self->_timeout(sub { $self->{_ldap}->modify("cn=$user,$self->{base_dn}", delete => [qw(slashdotRealname)])}); $mesg = $self->_timeout(sub { $self->{_ldap}->modify("cn=$user,$self->{base_dn}", - changes => [ - delete => [slashdotUidNumber => []], - delete => [slashdotPasswd => []], - delete => [slashdotEmail => []], - delete => [objectClass => 'slashdotUserInfo'] - ]) }); + changes => [ + delete => [slashdotUidNumber => []], + delete => [slashdotPasswd => []], + #delete => [slashdotEmail => []], # this is done by deleteUser() in MySQL.pm + delete => [objectClass => 'slashdotUserInfo'] + ]) }); } else { $mesg = $self->_timeout(sub { $self->{_ldap}->delete("cn=${user},".$self->{base_dn}) }); }