Compare commits

...

10 Commits

Author SHA1 Message Date
Daniel Berteaud
b2d9259b16 Spec file update 2017-08-02 18:47:06 +02:00
Daniel Berteaud
79abee1acd Fix typo in sso.php 2017-08-02 18:35:36 +02:00
Daniel Berteaud
bf9b24aa02 Fix double $php var 2017-08-02 10:30:23 +02:00
Daniel Berteaud
ce58b0a648 Works with php-fpm if available 2017-08-02 09:25:39 +02:00
Daniel Berteaud
10e01c0e15 Spec file update 2015-09-23 12:49:54 +02:00
Daniel Berteaud
151c62e9e3 Don't force redirection on server 1 2015-09-23 12:48:50 +02:00
Daniel Berteaud
7f90da9681 Spec file update 2014-08-08 18:19:31 +02:00
Daniel Berteaud
bc50cb2678 Disable PHP bool session.use_trans_sid as it breaks ajax requests 2014-08-08 18:14:39 +02:00
Daniel Berteaud
c4e10cb07e Keep displaying the query after the result is displayed 2014-08-08 14:30:25 +02:00
Daniel Berteaud
7405e55573 Disable OBGzip and VersionCheck 2014-08-08 14:28:28 +02:00
4 changed files with 55 additions and 15 deletions

View File

@ -1,6 +1,7 @@
%define version 0.1.6
%define version 0.2.1
%define release 1
%define name ipasserelle-phpmyadmin
%define phpversion 71
Name: %{name}
Version: %{version}
@ -28,6 +29,18 @@ Obsoletes: smeserver-phpmyadmin
phpMyAdmin integration for iPasserelle
%changelog
* Wed Aug 2 2017 Daniel Berteaud <daniel@firewall-services.com> - 0.2.1-1
- Fix a typo in sso.php
* Wed Aug 2 2017 Daniel Berteaud <daniel@firewall-services.com> - 0.2.0-1
- Works with php-fpm if available
* Wed Sep 23 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.1.8-1
- Don't force redirection on server 1
* Fri Aug 8 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.1.7-1
- Disable session.use_trans_sid as it breaks ajax requests
* Wed Nov 13 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.1.6-1
- Requires phpMyAdmin as phpMyAdmin3 provides it
Makes it compatible with SME9
@ -59,6 +72,7 @@ phpMyAdmin integration for iPasserelle
%build
%{__mkdir_p} root/var/lib/phpMyAdmin/tmp
perl ./createlinks
find root/ -type f | xargs grep -l __PHP_VERSION__ | xargs sed -i -e "s/__PHP_VERSION__/%{phpversion}/g"
%install
rm -rf $RPM_BUILD_ROOT

View File

@ -5,6 +5,28 @@ my $status = $phpmyadmin{'status'} || 'disabled';
if ($status eq 'enabled'){
my $access = (($phpmyadmin{'access'} || 'private') eq 'public') ? 'all':"$localAccess $externalSSLAccess";
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";
@ -15,12 +37,7 @@ $OUT .=<<"END";
order deny,allow
deny from all
allow from $access
AddType application/x-httpd-php .php .php3
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
</Directory>
<Directory /usr/share/phpMyAdmin/setup/>

View File

@ -49,3 +49,6 @@ $cfg['DefaultLang'] = 'fr';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '/var/lib/phpMyAdmin/upload';
$cfg['SaveDir'] = '/var/lib/phpMyAdmin/save';
$cfg['VersionCheck'] = false;
$cfg['OBGzip'] = false;
$cfg['RetainQueryBox'] = true;

View File

@ -2,20 +2,26 @@
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_name('SignonSession');
session_start();
$_SESSION['PMA_single_signon_user'] = $login[$_SERVER['REMOTE_USER']];
$_SESSION['PMA_single_signon_password'] = $password[$_SERVER['REMOTE_USER']];
$_SESSION['PMA_single_signon_user'] = $login[$ssologin];
$_SESSION['PMA_single_signon_password'] = $password[$ssologin];
session_write_close();
header('Location: /index.php?server=1');
header('Location: /index.php');
}
else {
// This location is forbiden
// So it will just display the access denied
// msg from LemonLDAP
header('Location: /libraries');
header('HTTP/1.0 403 Forbidden');
echo 'Not logged in the SSO system';
die;
}
?>