Server IP : 195.201.23.43 / Your IP : 3.147.73.62 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/ldap-server/ |
Upload File : |
#!/usr/bin/perl # Update local LDAP server LDIF file configuration options require './ldap-server-lib.pl'; &error_setup($text{'slapd_err'}); $access{'slapd'} || &error($text{'slapd_ecannot'}); &local_ldap_server() == 1 || &error($text{'slapd_elocal'}); &ReadParse(); &lock_slapd_files(); $conf = &get_ldif_config(); # Validate and store inputs # Top-level DN $defdb = &get_default_db(); $in{'suffix'} =~ /=/ || &error($text{'slapd_esuffix'}); &save_ldif_directive($conf, 'olcSuffix', $defdb, $in{'suffix'}); # Admin login $in{'rootdn'} =~ /=/ || &error($text{'slapd_erootdn'}); &save_ldif_directive($conf, 'olcRootDN', $defdb, $in{'rootdn'}); # Admin password if (!$in{'rootchange_def'}) { $in{'rootchange'} =~ /\S/ || &error($text{'slapd_erootpw'}); &save_ldif_directive($conf, 'olcRootPW', $defdb, &hash_ldap_password($in{'rootchange'})); $config{'pass'} = $in{'rootchange'}; $save_config = 1; } # Cache sizes if (!$in{'dbcachesize_def'}) { $in{'dbcachesize'} =~ /^\d+$/ || &error($text{'slapd_edbcachesize'}); &save_ldif_directive($conf, 'olcDbCachesize', $defdb, $in{'dbcachesize'}); } else { &save_ldif_directive($conf, 'olcDbCachesize', $defdb, undef); } # Size limit if ($in{'sizelimit_def'}) { &save_ldif_directive($conf, 'olcSizeLimit', $defdb, undef); } else { $in{'sizelimit'} =~ /^[1-9]\d*$/ || &error($text{'slapd_esizelimit'}); &save_ldif_directive($conf, 'olcSizeLimit', $defdb, $in{'sizelimit'}); } # LDAP protocols if (&can_get_ldap_protocols()) { @newprotos = split(/\0/, $in{'protos'}); @newprotos || &error($text{'slapd_eprotos'}); } # SSL file options $confdb = &get_config_db(); foreach $s ([ 'olcTLSCertificateFile', 'cert' ], [ 'olcTLSCertificateKeyFile', 'key' ], [ 'olcTLSCACertificateFile', 'ca' ]) { if ($in{$s->[1].'_def'}) { &save_ldif_directive($conf, $s->[0], $confdb, undef); } else { &valid_pem_file($in{$s->[1]}, $s->[1]) || &error($text{'slapd_e'.$s->[1]}); &save_ldif_directive($conf, $s->[0], $confdb, $in{$s->[1]}); } } # Write out the files &flush_file_lines(); &unlock_slapd_files(); if ($save_config) { &lock_file($module_config_file); &save_module_config(); &unlock_file($module_config_file); } if (&can_get_ldap_protocols()) { $protos = &get_ldap_protocols(); foreach $p (keys %$protos) { $protos->{$p} = 0; } foreach $p (@newprotos) { $protos->{$p} = 1; } &save_ldap_protocols($protos); } &webmin_log('slapd'); &redirect("");Private