Works with php-fpm if available

tags/0.2.0_0.fc26_el6 0.2.0_0.fc26_el6
Daniel Berteaud 8 years ago
parent 10e01c0e15
commit ce58b0a648
  1. 2
      ipasserelle-phpmyadmin.spec
  2. 31
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98phpMyAdmin
  3. 20
      root/usr/share/phpMyAdmin/sso.php

@ -1,6 +1,7 @@
%define version 0.1.8 %define version 0.1.8
%define release 1 %define release 1
%define name ipasserelle-phpmyadmin %define name ipasserelle-phpmyadmin
%define phpversion 71
Name: %{name} Name: %{name}
Version: %{version} Version: %{version}
@ -65,6 +66,7 @@ phpMyAdmin integration for iPasserelle
%build %build
%{__mkdir_p} root/var/lib/phpMyAdmin/tmp %{__mkdir_p} root/var/lib/phpMyAdmin/tmp
perl ./createlinks perl ./createlinks
find root/ -type f | xargs grep -l __PHP_VERSION__ | xargs sed -i -e "s/__PHP_VERSION__/%{phpversion}/g"
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT

@ -5,6 +5,29 @@ my $status = $phpmyadmin{'status'} || 'disabled';
if ($status eq 'enabled'){ if ($status eq 'enabled'){
my $access = (($phpmyadmin{'access'} || 'private') eq 'public') ? 'all':"$localAccess $externalSSLAccess"; my $access = (($phpmyadmin{'access'} || 'private') eq 'public') ? 'all':"$localAccess $externalSSLAccess";
my $php;
my $php =<<'_EOF';
AddType application/x-httpd-php .php
php_admin_value openbase_dir /usr/share/phpMyAdmin:/etc/phpMyAdmin:/var/lib/phpMyAdmin
php_admin_value session.save_path /var/lib/phpMyAdmin/tmp
php_admin_value post_max_size 100M
php_admin_value upload_max_filesize 100M
php_admin_value memory_limit 500M
php_admin_flag session.use_trans_sid 0
_EOF
if ($fastcgi_mod eq 'mod_fastcgi'){
$php =<<'_EOF';
AddHandler php__PHP_VERSION__-fastcgi .php
_EOF
}
elsif ($fastcgi_mod eq 'mod_proxy_fcgi'){
$php =<<'_EOF';
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php-fpm/php__PHP_VERSION__.sock|fcgi://localhost"
</FilesMatch>
_EOF
}
$OUT .=<<"END"; $OUT .=<<"END";
@ -15,13 +38,7 @@ $OUT .=<<"END";
order deny,allow order deny,allow
deny from all deny from all
allow from $access allow from $access
AddType application/x-httpd-php .php .php3 $php
php_admin_value openbase_dir /usr/share/phpMyAdmin:/etc/phpMyAdmin:/var/lib/phpMyAdmin
php_admin_value session.save_path /var/lib/phpMyAdmin/tmp
php_admin_value post_max_size 100M
php_admin_value upload_max_filesize 100M
php_admin_value memory_limit 500M
php_admin_flag session.use_trans_sid 0
</Directory> </Directory>
<Directory /usr/share/phpMyAdmin/setup/> <Directory /usr/share/phpMyAdmin/setup/>

@ -2,20 +2,26 @@
require('/etc/phpMyAdmin/sso.inc.php'); require('/etc/phpMyAdmin/sso.inc.php');
if(isset($_SERVER['REMOTE_USER']) && isset($login[$_SERVER['REMOTE_USER']]) && isset($password[$_SERVER['REMOTE_USER']])) { if (isSet($_SERVER['REDIRECT_REMOTE_USER'])){
$ssologin = $_SERVER['REDIRECT_REMOTE_USER'];
}
else{
$ssologin = $_SERVER['REMOTE_USER'];
}
if(isset($ssologin) && isset($login[$ssologin]) && isset($password[$ssologin]])) {
session_set_cookie_params(0, '/', '', 0); session_set_cookie_params(0, '/', '', 0);
session_name('SignonSession'); session_name('SignonSession');
session_start(); session_start();
$_SESSION['PMA_single_signon_user'] = $login[$_SERVER['REMOTE_USER']]; $_SESSION['PMA_single_signon_user'] = $login[$ssologin];
$_SESSION['PMA_single_signon_password'] = $password[$_SERVER['REMOTE_USER']]; $_SESSION['PMA_single_signon_password'] = $password[$ssologin];
session_write_close(); session_write_close();
header('Location: /index.php'); header('Location: /index.php');
} }
else { else {
// This location is forbiden header('HTTP/1.0 403 Forbidden');
// So it will just display the access denied echo 'Not logged in the SSO system';
// msg from LemonLDAP die;
header('Location: /libraries');
} }
?> ?>

Loading…
Cancel
Save