Server IP : 195.201.23.43 / Your IP : 18.118.31.32 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/webmin/acl/ |
Upload File : |
#!/usr/bin/perl # Create the LDAP base DN use strict; use warnings; no warnings 'redefine'; no warnings 'uninitialized'; require './acl-lib.pl'; our (%in, %text, %config, %access); $access{'pass'} || &error($text{'sql_ecannot'}); &ReadParse(); &error_setup($text{'makedn_err'}); my %miniserv; &get_miniserv_config(\%miniserv); my $dbh = &connect_userdb($in{'userdb'}); ref($dbh) || &error($dbh); &ui_print_unbuffered_header(undef, $text{'makedn_title'}, ""); # Work out object class for the DN my ($proto, $user, $pass, $host, $prefix, $argstr) = &split_userdb_string($in{'userdb'}); my $schema = $dbh->schema(); my @allocs = map { $_->{'name'} } grep { $_->{'structural'} } $schema->all_objectclasses(); my @ocs = ( ); foreach my $poc ("top", "domain") { if (&indexof($poc, @allocs) >= 0) { push(@ocs, $poc); } } @ocs || &error(&text('makedn_eoc')); # Create the DN print &text('makedn_exec', "<tt>$prefix</tt>"),"<br>\n"; my @attrs = ( "objectClass", \@ocs ); if (&indexof("domain", @ocs) >= 0 && $prefix =~ /^([^=]+)=([^, ]+)/) { # Domain class needs dc push(@attrs, $1, $2); } my $rv = $dbh->add($prefix, attr => \@attrs); if (!$rv || $rv->code) { print &text('makedn_failed', $rv ? $rv->error : "Unknown error"),"<p>\n"; } else { print &text('makedn_done'),"<p>\n"; } &disconnect_userdb($in{'userdb'}, $dbh); # Check again if OK my $err = &validate_userdb($in{'userdb'}, 0); if ($err) { print "<b>",&text('makedn_still', $err),"</b><p>\n"; } else { &lock_file($ENV{'MINISERV_CONFIG'}); $miniserv{'userdb'} = $in{'userdb'}; $miniserv{'userdb_addto'} = $in{'addto'}; &put_miniserv_config(\%miniserv); &unlock_file($ENV{'MINISERV_CONFIG'}); &reload_miniserv(); } &ui_print_footer("", $text{'index_return'});Private