diff options
-rwxr-xr-x | bin/ldap2apache | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/ldap2apache b/bin/ldap2apache index ff15a5c..38b69a8 100755 --- a/bin/ldap2apache +++ b/bin/ldap2apache @@ -141,6 +141,12 @@ clients.each{ |c| end end + phpincludepath = [ + '.', + "#{home}/include", + "/usr/share/php", + "/usr/share/pear", + "/usr/share/php/smarty/libs" ].map { |d| File.exists?(d) ? d : nil }.compact.join ':' if ssl crtfile = "/etc/ssl/certs/apache-#{server_name}.pem" @@ -215,7 +221,7 @@ clients.each{ |c| config << " php_value magic_quotes_gpc 0" config << " php_admin_value open_basedir \"#{basedir}\"" if basedir config << " php_admin_value safe_mode_include_dir \"#{safemode_include}\"" if safemode_include - config << " php_value include_path \".:#{home}/include:/usr/share/php:/usr/share/pear\"" + config << " php_value include_path \"#{phpincludepath}\"" config << " </IfModule>" end config << " Options #{docdiroptions}" if docdiroptions != "" @@ -247,7 +253,7 @@ clients.each{ |c| phpini << "sendmail_path = \"/usr/sbin/sendmail -t -i -f #{server_admin}\"" phpini << "allow_url_fopen = 0" phpini << "magic_quotes_gpc = 0" - phpini << "include_path = \".:#{home}/include:/usr/share/php:/usr/share/pear\"" + phpini << "include_path = \"#{phpincludepath}\"" inilp = c['o'][0] +"-"+ server_name throw "Clash on #{server_name} of client#{c['o'][0]} for phpinifiles" if phpinifiles[ inilp ] |