89 |
"/bin/false", |
"/bin/false", |
90 |
"$ibayName" |
"$ibayName" |
91 |
- ) == 0 or die "Failed to create account $ibayName.\n"; |
- ) == 0 or die "Failed to create account $ibayName.\n"; |
92 |
+ ) == 0 or ( $x = 255, warn "Failed to create (unix) account $ibayName.\n"; |
+ ) == 0 or ( $x = 255, warn "Failed to create (unix) account $ibayName.\n" ); |
93 |
} |
} |
94 |
|
|
95 |
+ system( |
+ system( |
97 |
+ "-g", |
+ "-g", |
98 |
+ $ibay->prop("Gid"), |
+ $ibay->prop("Gid"), |
99 |
+ $ibayName |
+ $ibayName |
100 |
+ ) == 0 or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to create (ldap) group $ibayName.\n" ); |
+ ) == 0 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) group $ibayName.\n" ); |
101 |
+ |
+ |
102 |
+ system( |
+ system( |
103 |
+ "/usr/sbin/cpu", "useradd", |
+ "/usr/sbin/cpu", "useradd", |
115 |
+ "-s", |
+ "-s", |
116 |
+ "/bin/false", |
+ "/bin/false", |
117 |
+ "$ibayName" |
+ "$ibayName" |
118 |
+ ) == 0 or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to create (ldap) account $ibayName.\n" ); |
+ ) == 0 or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to create (ldap) account $ibayName.\n" ); |
119 |
+ |
+ |
120 |
#------------------------------------------------------------ |
#------------------------------------------------------------ |
121 |
# Create the ibay files and set the password. |
# Create the ibay files and set the password. |
146 |
} |
} |
147 |
+ |
+ |
148 |
+ system("/usr/sbin/cpu", "usermod", "-L", $ibayName) == 0 |
+ system("/usr/sbin/cpu", "usermod", "-L", $ibayName) == 0 |
149 |
+ or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Error locking (ldap) account $ibayName" ); |
+ or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Error locking (ldap) account $ibayName" ); |
150 |
} |
} |
151 |
elsif ($event eq 'ibay-modify') |
elsif ($event eq 'ibay-modify') |
152 |
{ |
{ |
171 |
|
|
172 |
+ system("/usr/sbin/cpu", "usermod", "-c", $ibay->prop("Name"), |
+ system("/usr/sbin/cpu", "usermod", "-c", $ibay->prop("Name"), |
173 |
+ "-G", "shared," . $ibay->prop("Group"), "$ibayName") == 0 |
+ "-G", "shared," . $ibay->prop("Group"), "$ibayName") == 0 |
174 |
+ or ( $x = $ldapauth ne 'enabled ? $x : 255, warn "Failed to modify (ldap) account $ibayName.\n" ); |
+ or ( $x = $ldapauth ne 'enabled' ? $x : 255, warn "Failed to modify (ldap) account $ibayName.\n" ); |
175 |
} |
} |
176 |
|
|
177 |
#------------------------------------------------------------ |
#------------------------------------------------------------ |