\n"; } else { print $text{'create_done'},"
\n"; $ok = 1; } if ($ok && $in{'example'}) { # Add the example user/alias if ($in{'example'} == 1 || $in{'example'} == 2) { # User $edn = "uid=example, ".$dn; @attrs = ( "cn", "Example user", "sn", "Example user", "uid", "example", "uidNumber", 9999, "gidNumber", 9999, "loginShell", "/bin/sh", "homeDirectory", "/home/example", "objectClass", [ "posixAccount", "person" ], "userPassword", "*LK*" ); if ($in{'example'} == 2) { # With mail push(@attrs, "mail", "example\@example.com"); } } elsif ($in{'example'} == 3) { # Virtuser # XXX not sure about these .. is there any standard? $edn = "cn=example\@example.com, ".$dn; @attrs = ( "mail", "example\@example.com", "mailForwardingAddress", "example\@somewhere.com", "objectClass", [ "top" ] ); } elsif ($in{'example'} == 4) { # Unix group $edn = "cn=example, ".$dn; @attrs = ( "cn", "example", "gidNumber", 9999, "memberUid", "example", "objectClass", [ "posixGroup" ] ); } print &text('create_doingex', "".&html_escape($edn).""),"\n"; $rv = $ldap->add($edn, attr => \@attrs); if (!$rv || $rv->code) { print &text('create_edoingex', &ldap_error($rv)),"
\n"; } } if ($ok) { &webmin_log("create", undef, $dn); } &ui_print_footer("", $text{'index_return'});