diff -Nur --no-dereference smeserver-phpldapadmin-1.5.0.old/createlinks smeserver-phpldapadmin-1.5.0/createlinks --- smeserver-phpldapadmin-1.5.0.old/createlinks 2014-06-21 12:53:47.000000000 -0400 +++ smeserver-phpldapadmin-1.5.0/createlinks 2021-06-01 12:51:13.224000000 -0400 @@ -14,3 +14,16 @@ templates2events("/etc/phpldapadmin/config.php", $event) } safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/etc/phpldapadmin/config.php/template-begin"); + +for my $event (qw( + smeserver-phpldapadmin-update + )) + { + templates2events("/etc/httpd/conf/httpd.conf", $event); + templates2events("/etc/phpldapadmin/config.php", $event); + templates2events("/etc/opt/remi/php____PHPVERSION____/php-fpm.d/www.conf", $event) unless "____PHPVERSION____" eq ""; + templates2events("/etc/php-fpm.d/www.conf", $event) if "____PHPVERSION____" eq ""; + safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); + safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php____PHPVERSION____-php-fpm") unless "____PHPVERSION____" eq ""; + safe_symlink("reload-or-restart", "root/etc/e-smith/events/$event/services2adjust/php-fpm") if "____PHPVERSION____" eq ""; + } diff -Nur --no-dereference smeserver-phpldapadmin-1.5.0.old/root/etc/e-smith/db/configuration/defaults/phpldapadmin/status smeserver-phpldapadmin-1.5.0/root/etc/e-smith/db/configuration/defaults/phpldapadmin/status --- smeserver-phpldapadmin-1.5.0.old/root/etc/e-smith/db/configuration/defaults/phpldapadmin/status 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-phpldapadmin-1.5.0/root/etc/e-smith/db/configuration/defaults/phpldapadmin/status 2021-06-01 13:08:02.020000000 -0400 @@ -0,0 +1 @@ +enabled diff -Nur --no-dereference smeserver-phpldapadmin-1.5.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86Phpldapadmin smeserver-phpldapadmin-1.5.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86Phpldapadmin --- smeserver-phpldapadmin-1.5.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86Phpldapadmin 2014-06-21 12:53:47.000000000 -0400 +++ smeserver-phpldapadmin-1.5.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86Phpldapadmin 2021-06-01 13:04:03.628000000 -0400 @@ -21,8 +21,10 @@ AuthExternal pwauth require user admin Satisfy all - AddType application/x-httpd-php .php .php3 - php_flag magic_quotes_gpc on - php_flag track_vars on + + SetHandler "proxy:unix:/var/run/php-fpm/php____PHPVERSION____-phpldapadmin.sock|fcgi://localhost" + + SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=\$1 + diff -Nur --no-dereference smeserver-phpldapadmin-1.5.0.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpldapadmin smeserver-phpldapadmin-1.5.0/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpldapadmin --- smeserver-phpldapadmin-1.5.0.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpldapadmin 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-phpldapadmin-1.5.0/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/15phpldapadmin 2021-06-01 13:10:34.241000000 -0400 @@ -0,0 +1,73 @@ +{ + +if ($PHP_VERSION eq '____PHPVERSION____'){ + if (($phpldapadmin{'status'} || 'disabled') eq 'enabled'){ + my $max_upload_size = ($phpldapadmin{MaxUploadSize} || '100M');# 104857600 bytes + $max_upload_size .= 'M' if ($max_upload_size =~ m/^\d+$/); + my $memory_limit = ($phpldapadmin{MemoryLimit} || '512M'); + $memory_limit .= 'M' if ($memory_limit =~ m/^\d+$/); + my $open_basedir= $phpldapadmin{PHPBaseDir} || ''; + $open_basedir = "/etc/phpldapadmin/:/usr/share/phpldapadmin/:/var/lib/php/phpldapadmin:". +"/var/lib/phpldapadmin/temp:/var/lib/phpldapadmin/save/:/var/lib/phpldapadmin/upload:/var/lib/phpldapadmin/cache/:". +"/usr/share/php/:". +"/var/log/php/phpldapadmin::/dev/urandom:$open_basedir"; + my $max_children = $phpldapadmin{'PHPmaxChildren'} || 20; + my $min_spare_servers = $phpldapadmin{'PHPminServers'} || 4; + my $start_servers = $phpldapadmin{'PHPstartServers'} || 6; + my $max_spare_servers = $phpldapadmin{'PHPmaxServers'} || 8; + my $max_requests = $phpldapadmin{'PHPmaxRequests'} || 1000; + $min_spare_servers = ( $min_spare_servers > $max_spare_servers ) ? printf("%.0f",$max_spare_servers/2) : $min_spare_servers; + $start_servers = ( $start_servers > $max_spare_servers ) ? printf("%.0f", $max_spare_servers /2 + $min_spare_servers/2 ) : $start_servers; + my $id = 'phpldapadmin'; # Note the package is phpldapadmin + $OUT .=<<"_EOF"; + +[php$PHP_VERSION-$id] +user = www +group = www +listen.owner = root +listen.group = www +listen.mode = 0660 +listen = /var/run/php-fpm/php$PHP_VERSION-$id.sock +pm = dynamic +pm.max_children = $max_children +pm.start_servers = $start_servers +pm.min_spare_servers = $min_spare_servers +pm.max_spare_servers = $max_spare_servers +pm.max_requests = $max_requests +; Used in nextcloud +php_admin_value[session.save_path] = /var/lib/php/$id/session +php_admin_value[session.gc_maxlifetime] = 86400 +php_admin_value[opcache.file_cache] = /var/lib/php/$id/opcache +php_admin_value[upload_tmp_dir] = /var/lib/php/$id/tmp +php_admin_value[sys_temp_dir] = /var/lib/php/$id/tmp +php_admin_value[error_log] = /var/log/php/$id/error.log +slowlog = /var/log/php/$id/slow.log +php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f php@{ $DomainName } +php_admin_flag[display_errors] = off +php_admin_flag[log_errors] = on +php_admin_value[memory_limit] = $memory_limit +php_admin_value[max_execution_time] = 3600 +php_admin_value[post_max_size] = $max_upload_size +php_admin_value[upload_max_filesize] = $max_upload_size +php_admin_value[disable_functions] = system, show_source, symlink, exec, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd +php_admin_value[open_basedir] = $open_basedir +php_admin_flag[allow_url_fopen] = on +php_admin_flag[file_upload] = on +php_admin_flag[session.cookie_httponly] = on +php_admin_flag[allow_url_include] = off +php_admin_value[session.save_handler] = files +php_admin_flag[output_buffering] = off +php_admin_value[auto_prepend_file] = /usr/share/php/auth_translation.php +php_flag[session.use_trans_sid] = off +php_flag[track_vars] = on +php_flag[magic_quotes_gpc] = on + +_EOF + + } + else{ + $OUT .= '; phpldapadmin is disabled'; + } +} +} + diff -Nur --no-dereference smeserver-phpldapadmin-1.5.0.old/root/etc/e-smith/templates/etc/phpldapadmin/config.php/06SASLAuth smeserver-phpldapadmin-1.5.0/root/etc/e-smith/templates/etc/phpldapadmin/config.php/06SASLAuth --- smeserver-phpldapadmin-1.5.0.old/root/etc/e-smith/templates/etc/phpldapadmin/config.php/06SASLAuth 2014-06-21 12:53:47.000000000 -0400 +++ smeserver-phpldapadmin-1.5.0/root/etc/e-smith/templates/etc/phpldapadmin/config.php/06SASLAuth 2021-06-01 14:02:24.703000000 -0400 @@ -43,8 +43,8 @@ /* Default password hashing algorithm. One of md5, ssha, sha, md5crpyt, smd5, blowfish, crypt or leave blank for now default algorithm. */ -// $servers->setValue('appearance','password_hash','md5'); -$servers->setValue('appearance','password_hash',''); +// $servers->setValue('appearance','pla_password_hash','md5'); +$servers->setValue('appearance','pla_password_hash',''); /* If you specified 'cookie' or 'session' as the auth_type above, you can optionally specify here an attribute to use when logging in. If you enter diff -Nur --no-dereference smeserver-phpldapadmin-1.5.0.old/root/etc/e-smith/templates/etc/phpldapadmin/config.php/08Others smeserver-phpldapadmin-1.5.0/root/etc/e-smith/templates/etc/phpldapadmin/config.php/08Others --- smeserver-phpldapadmin-1.5.0.old/root/etc/e-smith/templates/etc/phpldapadmin/config.php/08Others 2014-06-21 12:53:47.000000000 -0400 +++ smeserver-phpldapadmin-1.5.0/root/etc/e-smith/templates/etc/phpldapadmin/config.php/08Others 2021-06-01 14:02:47.857000000 -0400 @@ -25,7 +25,7 @@ $servers->setValue('sasl','authz_id_replacement','$1'); $servers->setValue('sasl','props',null); -$servers->setValue('appearance','password_hash','md5'); +$servers->setValue('appearance','pla_password_hash','md5'); $servers->setValue('login','attr','dn'); $servers->setValue('login','fallback_dn',false); $servers->setValue('login','class',null);