/[smeserver]/rpms/e-smith-base/sme8/e-smith-base-5.2.0-add-extra-ldap.patch
ViewVC logotype

Diff of /rpms/e-smith-base/sme8/e-smith-base-5.2.0-add-extra-ldap.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.1 by slords, Thu Nov 4 20:02:03 2010 UTC Revision 1.3 by slords, Fri Nov 5 01:37:08 2010 UTC
# Line 1  Line 1 
1  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-create-unix.add-extra-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-create-unix  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-create-unix.add-extra-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-create-unix
2  --- e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-create-unix.add-extra-ldap 2010-11-04 10:57:22.000000000 -0600  --- e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-create-unix.add-extra-ldap 2010-11-04 19:17:44.000000000 -0600
3  +++ e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-create-unix        2010-11-04 11:06:42.000000000 -0600  +++ e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-create-unix        2010-11-04 19:17:55.000000000 -0600
4  @@ -27,6 +27,7 @@ use strict;  @@ -27,6 +27,7 @@ use strict;
5   use Errno;   use Errno;
6   use esmith::ConfigDB;   use esmith::ConfigDB;
# Line 20  diff -up e-smith-base-5.2.0/root/etc/e-s Line 20  diff -up e-smith-base-5.2.0/root/etc/e-s
20   my $event = $ARGV [0];   my $event = $ARGV [0];
21   my $groupName = $ARGV [1];   my $groupName = $ARGV [1];
22    
23  @@ -93,11 +98,16 @@ if ($ldapauth ne 'enabled')  @@ -93,11 +98,17 @@ if ($ldapauth ne 'enabled')
24   }   }
25    
26   # Create the user's unique group first (in ldap)   # Create the user's unique group first (in ldap)
27  +my $tmpattr = File::Temp->new();  +my $tmpattr = File::Temp->new();
28  +print $tmpattr "mail: $groupName\@$domain\n";  +print $tmpattr "mail: $groupName\@$domain\n";
29  +print $tmpattr "description: $description\n";  +print $tmpattr "description: $description\n";
30    +$tmpattr->flush();
31   system(   system(
32           "/usr/sbin/cpu", "groupadd",           "/usr/sbin/cpu", "groupadd",
33  +        "-a", "$tmpattr",  +        "-a", "$tmpattr",
# Line 38  diff -up e-smith-base-5.2.0/root/etc/e-s Line 39  diff -up e-smith-base-5.2.0/root/etc/e-s
39   # Now create the dummy user account (in ldap)   # Now create the dummy user account (in ldap)
40   system(   system(
41  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix.add-extra-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix.add-extra-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix
42  --- e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix.add-extra-ldap 2010-11-04 10:57:22.000000000 -0600  --- e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix.add-extra-ldap 2010-11-04 19:17:44.000000000 -0600
43  +++ e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix        2010-11-04 11:06:52.000000000 -0600  +++ e-smith-base-5.2.0/root/etc/e-smith/events/actions/group-modify-unix        2010-11-04 19:17:55.000000000 -0600
44  @@ -27,6 +27,7 @@ use strict;  @@ -27,6 +27,7 @@ use strict;
45   use Errno;   use Errno;
46   use esmith::ConfigDB;   use esmith::ConfigDB;
# Line 59  diff -up e-smith-base-5.2.0/root/etc/e-s Line 60  diff -up e-smith-base-5.2.0/root/etc/e-s
60   my $event = shift || die "Event name arg missing\n";;   my $event = shift || die "Event name arg missing\n";;
61   my @groups;   my @groups;
62    
63  @@ -76,6 +81,16 @@ foreach my $group (@groups)  @@ -76,6 +81,17 @@ foreach my $group (@groups)
64       system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-c", "$groupDesc", "$groupName") == 0       system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "usermod", "-c", "$groupDesc", "$groupName") == 0
65           or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to modify (ldap) group description for $groupName.\n" );           or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to modify (ldap) group description for $groupName.\n" );
66    
67  +    my $tmpattr = File::Temp->new();  +    my $tmpattr = File::Temp->new();
68  +    print $tmpattr "mail: $groupName\@$domain\n";  +    print $tmpattr "mail: $groupName\@$domain\n";
69  +    print $tmpattr "description: $groupDesc\n";  +    print $tmpattr "description: $groupDesc\n";
70    +    $tmpattr->flush();
71  +    system(  +    system(
72  +            "/usr/sbin/cpu", "-C/etc/cpu-system.conf", "groupmod",  +            "/usr/sbin/cpu", "-C/etc/cpu-system.conf", "groupmod",
73  +            "-a", "$tmpattr",  +            "-a", "$tmpattr",
# Line 77  diff -up e-smith-base-5.2.0/root/etc/e-s Line 79  diff -up e-smith-base-5.2.0/root/etc/e-s
79       my @oldMembers = split (/\s+/, $members);       my @oldMembers = split (/\s+/, $members);
80       my @newMembers = split (/,/, $properties {'Members'});       my @newMembers = split (/,/, $properties {'Members'});
81  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-create-unix.add-extra-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-create-unix  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-create-unix.add-extra-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-create-unix
82  --- e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-create-unix.add-extra-ldap  2010-11-04 10:57:22.000000000 -0600  --- e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-create-unix.add-extra-ldap  2010-11-04 19:17:44.000000000 -0600
83  +++ e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-create-unix 2010-11-04 11:10:41.000000000 -0600  +++ e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-create-unix 2010-11-04 19:35:47.000000000 -0600
84  @@ -27,6 +27,7 @@ use strict;  @@ -27,6 +27,7 @@ use strict;
85   use Errno;   use Errno;
86   use esmith::ConfigDB;   use esmith::ConfigDB;
# Line 104  diff -up e-smith-base-5.2.0/root/etc/e-s Line 106  diff -up e-smith-base-5.2.0/root/etc/e-s
106   my $last = $acct->prop('LastName') || '';   my $last = $acct->prop('LastName') || '';
107  +my $phone = $acct->prop('Phone') || '';  +my $phone = $acct->prop('Phone') || '';
108  +my $company = $acct->prop('Company') || '';  +my $company = $acct->prop('Company') || '';
109  +my $dept = $acct->prop('Department') || '';  +my $dept = $acct->prop('Dept') || '';
110  +my $city = $acct->prop('City') || '';  +my $city = $acct->prop('City') || '';
111  +my $street = $acct->prop('Street') || '';  +my $street = $acct->prop('Street') || '';
112   my $shell = $acct->prop('Shell') || '/usr/bin/rssh';   my $shell = $acct->prop('Shell') || '/usr/bin/rssh';
# Line 113  diff -up e-smith-base-5.2.0/root/etc/e-s Line 115  diff -up e-smith-base-5.2.0/root/etc/e-s
115   if ($ldapauth ne 'enabled')   if ($ldapauth ne 'enabled')
116   {   {
117       # Create the user's unique group first       # Create the user's unique group first
118  @@ -99,6 +108,12 @@ system(  @@ -99,6 +108,15 @@ system(
119       ) == 0 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) group $userName.\n" );       ) == 0 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) group $userName.\n" );
120    
121   # Now create the user account (in ldap)   # Now create the user account (in ldap)
122    +my @attrs;
123  +my $tmpattr = File::Temp->new();  +my $tmpattr = File::Temp->new();
124  +print $tmpattr "telephoneNumber: $phone\n";  +print $tmpattr "telephoneNumber: $phone\n" if $phone;
125  +print $tmpattr "o: $company\n";  +print $tmpattr "o: $company\n" if $company;
126  +print $tmpattr "ou: $dept\n";  +print $tmpattr "ou: $dept\n" if $dept;
127  +print $tmpattr "l: $city\n";  +print $tmpattr "l: $city\n" if $city;
128  +print $tmpattr "street: $street\n";  +print $tmpattr "street: $street\n" if $street;
129    +$tmpattr->flush();
130    +push @attrs, ('-a', "$tmpattr") if -s $tmpattr;
131   system(   system(
132           "/usr/sbin/cpu", "useradd",           "/usr/sbin/cpu", "useradd",
133           "-u", $uid,           "-u", $uid,
134  @@ -106,6 +121,8 @@ system(  @@ -106,6 +124,8 @@ system(
135           "-c", "$first $last",           "-c", "$first $last",
136           "-f", "$first",           "-f", "$first",
137           "-E", "$last",           "-E", "$last",
138  +        "-e", "$userName\@$domain",  +        "-e", "$userName\@$domain",
139  +        "-a", "$tmpattr",  +        $attrs,
140           "-d", "/home/e-smith/files/users/$userName",           "-d", "/home/e-smith/files/users/$userName",
141           "-G", "shared",           "-G", "shared",
142           "-m",           "-m",
143  @@ -113,6 +130,7 @@ system(  @@ -113,6 +133,7 @@ system(
144           "-s", "$shell",           "-s", "$shell",
145           $userName           $userName
146       ) == 0 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) account $userName.\n" );       ) == 0 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) account $userName.\n" );
# Line 144  diff -up e-smith-base-5.2.0/root/etc/e-s Line 149  diff -up e-smith-base-5.2.0/root/etc/e-s
149    
150   # Release lock if we have one   # Release lock if we have one
151  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix.add-extra-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix  diff -up e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix.add-extra-ldap e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix
152  --- e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix.add-extra-ldap  2010-11-04 10:57:22.000000000 -0600  --- e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix.add-extra-ldap  2010-11-04 19:17:44.000000000 -0600
153  +++ e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix 2010-11-04 11:12:28.000000000 -0600  +++ e-smith-base-5.2.0/root/etc/e-smith/events/actions/user-modify-unix 2010-11-04 19:17:55.000000000 -0600
154  @@ -22,12 +22,17 @@ use strict;  @@ -22,12 +22,17 @@ use strict;
155   use Errno;   use Errno;
156   use esmith::AccountsDB;   use esmith::AccountsDB;
# Line 164  diff -up e-smith-base-5.2.0/root/etc/e-s Line 169  diff -up e-smith-base-5.2.0/root/etc/e-s
169   my $event = $ARGV [0];   my $event = $ARGV [0];
170   my $userName = $ARGV [1];   my $userName = $ARGV [1];
171    
172  @@ -115,9 +120,25 @@ foreach my $u (@users)  @@ -115,9 +120,28 @@ foreach my $u (@users)
173                   or ( $x = 255, warn "Failed to modify comment of (unix) account $userName.\n" );                   or ( $x = 255, warn "Failed to modify comment of (unix) account $userName.\n" );
174           }           }
175    
# Line 176  diff -up e-smith-base-5.2.0/root/etc/e-s Line 181  diff -up e-smith-base-5.2.0/root/etc/e-s
181  +  +
182  +    my $new_phone = $u->prop('Phone') || '';  +    my $new_phone = $u->prop('Phone') || '';
183  +    my $new_company = $u->prop('Company') || '';  +    my $new_company = $u->prop('Company') || '';
184  +    my $new_dept = $u->prop('Department') || '';  +    my $new_dept = $u->prop('Dept') || '';
185  +    my $new_city = $u->prop('City') || '';  +    my $new_city = $u->prop('City') || '';
186  +    my $new_street = $u->prop('Street') || '';  +    my $new_street = $u->prop('Street') || '';
187  +  +
188    +    my @attrs;
189  +    my $tmpattr = File::Temp->new();  +    my $tmpattr = File::Temp->new();
190  +    print $tmpattr "telephoneNumber: $new_phone\n" if $new_phone;  +    print $tmpattr "telephoneNumber: $new_phone\n" if $new_phone;
191  +    print $tmpattr "o: $new_company\n" if $new_company;  +    print $tmpattr "o: $new_company\n" if $new_company;
192  +    print $tmpattr "ou: $new_dept\n" if $new_dept;  +    print $tmpattr "ou: $new_dept\n" if $new_dept;
193  +    print $tmpattr "l: $new_city\n" if $new_city;  +    print $tmpattr "l: $new_city\n" if $new_city;
194  +    print $tmpattr "street: $new_street\n" $new_street;  +    print $tmpattr "street: $new_street\n" if $new_street;
195  +    system("/usr/sbin/cpu", "usermod", "-a", "$tmpattr", "-e", "$userName\@$domain", "-G", "$groups", $userName) == 0  +    $tmpattr->flush();
196    +    push @attrs, ('-a', "$tmpattr") if -s $tmpattr;
197    +    system("/usr/sbin/cpu", "usermod", @attrs, "-e", "$userName\@$domain", "-G", "$groups", $userName) == 0
198  +        or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to modify email of (ldap) account $userName.\n" );  +        or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to modify email of (ldap) account $userName.\n" );
199  +    undef $tmpattr;  +    undef $tmpattr;
200   }   }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed