Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b2d9259b16 | ||
|
79abee1acd | ||
|
bf9b24aa02 | ||
|
ce58b0a648 | ||
|
10e01c0e15 | ||
|
151c62e9e3 | ||
|
7f90da9681 | ||
|
bc50cb2678 | ||
|
c4e10cb07e | ||
|
7405e55573 |
|
@ -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
|
||||
|
|
|
@ -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/>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user