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 18:21:40.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 18:22: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; |
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", |
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 18:21:40.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 18:23:00.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; |
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", |
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 18:21:40.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 18:23:40.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; |
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'; |
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,13 @@ 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) |
125 |
+print $tmpattr "ou: $dept\n"; |
+print $tmpattr "ou: $dept\n"; |
126 |
+print $tmpattr "l: $city\n"; |
+print $tmpattr "l: $city\n"; |
127 |
+print $tmpattr "street: $street\n"; |
+print $tmpattr "street: $street\n"; |
128 |
|
+$tmpattr->flush(); |
129 |
system( |
system( |
130 |
"/usr/sbin/cpu", "useradd", |
"/usr/sbin/cpu", "useradd", |
131 |
"-u", $uid, |
"-u", $uid, |
132 |
@@ -106,6 +121,8 @@ system( |
@@ -106,6 +122,8 @@ system( |
133 |
"-c", "$first $last", |
"-c", "$first $last", |
134 |
"-f", "$first", |
"-f", "$first", |
135 |
"-E", "$last", |
"-E", "$last", |
138 |
"-d", "/home/e-smith/files/users/$userName", |
"-d", "/home/e-smith/files/users/$userName", |
139 |
"-G", "shared", |
"-G", "shared", |
140 |
"-m", |
"-m", |
141 |
@@ -113,6 +130,7 @@ system( |
@@ -113,6 +131,7 @@ system( |
142 |
"-s", "$shell", |
"-s", "$shell", |
143 |
$userName |
$userName |
144 |
) == 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" ); |
147 |
|
|
148 |
# Release lock if we have one |
# Release lock if we have one |
149 |
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 |
150 |
--- 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 18:21:40.000000000 -0600 |
151 |
+++ 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 18:24:58.000000000 -0600 |
152 |
@@ -22,12 +22,17 @@ use strict; |
@@ -22,12 +22,17 @@ use strict; |
153 |
use Errno; |
use Errno; |
154 |
use esmith::AccountsDB; |
use esmith::AccountsDB; |
167 |
my $event = $ARGV [0]; |
my $event = $ARGV [0]; |
168 |
my $userName = $ARGV [1]; |
my $userName = $ARGV [1]; |
169 |
|
|
170 |
@@ -115,9 +120,25 @@ foreach my $u (@users) |
@@ -115,9 +120,28 @@ foreach my $u (@users) |
171 |
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" ); |
172 |
} |
} |
173 |
|
|
179 |
+ |
+ |
180 |
+ my $new_phone = $u->prop('Phone') || ''; |
+ my $new_phone = $u->prop('Phone') || ''; |
181 |
+ my $new_company = $u->prop('Company') || ''; |
+ my $new_company = $u->prop('Company') || ''; |
182 |
+ my $new_dept = $u->prop('Department') || ''; |
+ my $new_dept = $u->prop('Dept') || ''; |
183 |
+ my $new_city = $u->prop('City') || ''; |
+ my $new_city = $u->prop('City') || ''; |
184 |
+ my $new_street = $u->prop('Street') || ''; |
+ my $new_street = $u->prop('Street') || ''; |
185 |
+ |
+ |
186 |
|
+ my @attrs; |
187 |
+ my $tmpattr = File::Temp->new(); |
+ my $tmpattr = File::Temp->new(); |
188 |
+ print $tmpattr "telephoneNumber: $new_phone\n" if $new_phone; |
+ print $tmpattr "telephoneNumber: $new_phone\n" if $new_phone; |
189 |
+ print $tmpattr "o: $new_company\n" if $new_company; |
+ print $tmpattr "o: $new_company\n" if $new_company; |
190 |
+ print $tmpattr "ou: $new_dept\n" if $new_dept; |
+ print $tmpattr "ou: $new_dept\n" if $new_dept; |
191 |
+ print $tmpattr "l: $new_city\n" if $new_city; |
+ print $tmpattr "l: $new_city\n" if $new_city; |
192 |
+ print $tmpattr "street: $new_street\n" $new_street; |
+ print $tmpattr "street: $new_street\n" if $new_street; |
193 |
+ system("/usr/sbin/cpu", "usermod", "-a", "$tmpattr", "-e", "$userName\@$domain", "-G", "$groups", $userName) == 0 |
+ $tmpattr->flush(); |
194 |
|
+ push @attrs, ('-a', "$tmpattr") if -s $tmpattr; |
195 |
|
+ system("/usr/sbin/cpu", "usermod", @attrs, "-e", "$userName\@$domain", "-G", "$groups", $userName) == 0 |
196 |
+ 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" ); |
197 |
+ undef $tmpattr; |
+ undef $tmpattr; |
198 |
} |
} |