Compare commits

..

18 Commits
sme9 ... master

Author SHA1 Message Date
Daniel Berteaud 7b6cbbffac Spec file update 8 years ago
Daniel Berteaud 7399d228c6 Fix httpd template when alias is enabled 8 years ago
Daniel Berteaud 96457a300d Spec file update 8 years ago
Daniel Berteaud 6e9820bfd6 Missing semicolon 8 years ago
Daniel Berteaud 152c1d08f1 Fix httpd template error 8 years ago
Daniel Berteaud 29f2690d33 Fix LocationMatch scope when using a dedicated vhost 8 years ago
Daniel Berteaud 6fc63e7980 Spec file update 8 years ago
Daniel Berteaud 82c7e91444 Force defining hook_get_auth_webserver_profile 9 years ago
Daniel Berteaud 6c2188e568 Spec file udpate 9 years ago
Daniel Berteaud 7812574a48 Make sure hooks are declared just one time 9 years ago
Daniel Berteaud f5e615f5f4 Spec file update 10 years ago
Daniel Berteaud 0d486971a0 Fix the new permission hook 10 years ago
Daniel Berteaud 9321182195 SPec file update 10 years ago
Daniel Berteaud 0d662b16e5 Adapt initial permissions 10 years ago
Daniel Berteaud b805a95afd Spec file update 11 years ago
Daniel Berteaud 46f288ba57 Add templates for the main .htaccess so the RewriteBase can adapted 11 years ago
Daniel Berteaud 85cc0e73ef Fix httpd template 11 years ago
Daniel Berteaud c178946437 Make it works with both SME8 and SME9 11 years ago
  1. 1
      createlinks
  2. 24
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/98LimeSurvey
  3. 2
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/60LimeSurveySSL
  4. 14
      root/etc/e-smith/templates/usr/share/limesurvey/.htaccess/10All
  5. 46
      root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/25ProfileHook
  6. 38
      smeserver-limesurvey.spec

@ -5,6 +5,7 @@ use esmith::Build::CreateLinks qw(:all);
# Templates to expand # Templates to expand
templates2events("/etc/e-smith/sql/init/limesurvey", qw(bootstrap-console-save webapps-update)); templates2events("/etc/e-smith/sql/init/limesurvey", qw(bootstrap-console-save webapps-update));
templates2events("/usr/share/limesurvey/application/config/config.php", qw(bootstrap-console-save webapps-update)); templates2events("/usr/share/limesurvey/application/config/config.php", qw(bootstrap-console-save webapps-update));
templates2events("/usr/share/limesurvey/.htaccess", qw(bootstrap-console-save webapps-update));
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/template-begin"); safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/template-begin");
safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/template-end"); safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/template-end");

@ -1,18 +1,17 @@
{ {
my $access = $limesurvey{'access'} || 'private'; my $access = $limesurvey{'access'} || 'private';
my $allow = ($access eq 'public')?'all':"$localAccess $externalSSLAccess"; my $allow = ($access eq 'public') ? 'all' : "$localAccess $externalSSLAccess";
my $alias = (($limesurvey{'AliasOnPrimary'} || 'enabled') ne 'enabled') ? my $alias = (($limesurvey{'AliasOnPrimary'} || 'enabled') ne 'enabled') ?
'':'Alias /limesurvey /usr/share/limesurvey'; '' : 'Alias /limesurvey /usr/share/limesurvey';
my $ver = $sysconfig{'ReleaseVersion'} || '8.1';
my $auth = (($limesurvey{'Authentication'} || 'http') eq 'http') ? "AuthName \"LimeSurvey\"\n" . my $auth = (($limesurvey{'Authentication'} || 'http') eq 'http') ? "AuthName \"LimeSurvey\"\n" .
" AuthType Basic\n" . " AuthType Basic\n" .
" AuthBasicProvider external\n" . " AuthExternal pwauth\n" . (($ver =~ m/^9/) ? " AuthBasicProvider external\n":'') .
" AuthExternal pwauth\n" .
" Require valid-user\n" : ''; " Require valid-user\n" : '';
if ($limesurvey{'status'} eq 'enabled'){ if ($limesurvey{'status'} eq 'enabled'){
$OUT .=<<"END" $OUT .=<<"END";
# LimeSurvey Configuration # LimeSurvey Configuration
$alias $alias
@ -38,15 +37,24 @@ $alias
allow from $allow allow from $allow
Satisfy all Satisfy all
</Directory> </Directory>
<Directory /usr/share/limesurvey/admin> END
if ($alias ne ''){
$OUT .=<<"END";
<LocationMatch "^/limesurvey/(index\.php/)?admin">
SSLRequireSSL on SSLRequireSSL on
$auth $auth
</Directory> </LocationMatch>
END
}
$OUT .=<<'END';
<DirectoryMatch "/usr/share/limesurvey/(framework|console|installer/sql|locale|application/(logs|config)|docs)"> <DirectoryMatch "/usr/share/limesurvey/(framework|console|installer/sql|locale|application/(logs|config)|docs)">
Deny from all Deny from all
</DirectoryMatch> </DirectoryMatch>
END END
} }
else{ else{
$OUT .= "# LimeSurvey is disabled\n"; $OUT .= "# LimeSurvey is disabled\n";

@ -7,6 +7,6 @@ if (($port ne $sslport) && ($status eq 'enabled') && ($alias eq 'enabled')){
## Redirect Web Address to Secure Address ## Redirect Web Address to Secure Address
$OUT .= " RewriteRule ^/limesurvey/admin(/.*|\$) https://%{HTTP_HOST}/limesurvey/admin\$1 \[L,R\]\n"; $OUT .= " RewriteRule ^/limesurvey/admin(/.*|\$) https://%{HTTP_HOST}/limesurvey/admin\$1 \[L,R\]\n";
$OUT .= " RewriteRule ^/limesurvey/index.php/admin(/.*|\$) https://%{HTTP_HOST}/limesurvey/index.php/admin\$1 \[L,R\]\n";
} }
} }

@ -0,0 +1,14 @@
<IfModule mod_rewrite.c>
RewriteEngine on
{
my $alias = $limesurvey{'AliasOnPrimary'} || 'enabled';
if ($alias ne 'disabled'){
$OUT .= " RewriteBase /limesurvey\n";
}
else{
$OUT .= '';
}
}
RewriteCond %\{REQUEST_FILENAME\} !-f
RewriteRule . index.php
</IfModule>

@ -22,31 +22,33 @@ function hook_get_auth_webserver_profile(\$user_name) {
else{ else{
\$email = \$login . '\@$DomainName'; \$email = \$login . '\@$DomainName';
} }
if ((isset(\$_SERVER['HTTP_USER_GROUPS']) && (
in_array('admins', preg_split("/; /", \$_SERVER['HTTP_USER_GROUPS'])) ||
in_array('surveyadmins', preg_split("/; /", \$_SERVER['HTTP_USER_GROUPS']))
)) ||
(\$login == "admin")){
\$admin = 1;
}
else{
\$admin = 0;
}
return Array( return Array(
'full_name' => \$name, 'full_name' => \$name,
'email' => \$email, 'email' => \$email,
'lang' => '$lang', 'lang' => '$lang',
'htmleditormode' => 'inline', 'htmleditormode' => 'inline',
'templatelist' => 'default,basic,MyOrgTemplate', 'templatelist' => 'default,basic,MyOrgTemplate',
'create_survey' => 1,
'create_user' => \$admin,
'delete_user' => \$admin,
'superadmin' => \$admin,
'configurator' => \$admin,
'manage_template' => \$admin,
'manage_label' => \$admin
); );
} }
if (!function_exists('hook_get_auth_webserver_permissions')){
function hook_get_auth_webserver_permissions(\$user_name) {
if ((isset(\$_SERVER['HTTP_USER_GROUPS']) && (
in_array('admins', preg_split("/;\\s?/", \$_SERVER['HTTP_USER_GROUPS'])) ||
in_array('surveyadmins', preg_split("/;\\s?/", \$_SERVER['HTTP_USER_GROUPS']))
)) || (\$user_name == "admin")){
return Array('superadmin' => Array('read'=>true));
}
else{
return Array('surveys' => Array(
'create'=>true,
'read'=>true,
'update'=>true,
'delete'=>true
));
}
}
}
EOF EOF
} }

@ -1,11 +1,10 @@
%define name smeserver-limesurvey %define name smeserver-limesurvey
%define version 0.1.3 %define version 0.1.10
%define release 1 %define release 1
Summary: SME server integration of limesurvey Summary: SME server integration of limesurvey
Name: %{name} Name: %{name}
Version: %{version} Version: %{version}
Release: %{release}%{?dist} Release: %{release}%{?dist}
Epoch: 9
License: GNU GPL version 2 License: GNU GPL version 2
URL: http://www.limesurvey.org URL: http://www.limesurvey.org
Group: SMEserver/addon Group: SMEserver/addon
@ -15,7 +14,7 @@ BuildArchitectures: noarch
BuildRequires: e-smith-devtools BuildRequires: e-smith-devtools
BuildRoot: /var/tmp/%{name}-%{version} BuildRoot: /var/tmp/%{name}-%{version}
Requires: e-smith-base Requires: e-smith-base
Requires: limesurvey >= 2.05.131219 Requires: limesurvey >= 2.05.141229
Requires: smeserver-webapps-common Requires: smeserver-webapps-common
AutoReqProv: no AutoReqProv: no
@ -23,9 +22,31 @@ AutoReqProv: no
Integration of LimeSurvey on SME Server Integration of LimeSurvey on SME Server
%changelog %changelog
* Wed Apr 23 2014 Daniel Berteaud <daniel@firewall-services.com> 0.1.3-1.sme * Wed Jan 4 2017 Daniel Berteaud <daniel@firewall-services.com> 0.1.10-1.sme
- New branch for SME9 - Fix httpd template when alias is enabled
- Fix basic auth on SME9
* Mon Dec 12 2016 Daniel Berteaud <daniel@firewall-services.com> 0.1.9-1.sme
- Fix syntax error introduced in previous commit
* Sun Dec 11 2016 Daniel Berteaud <daniel@firewall-services.com> 0.1.8-1.sme
- Fix LocationMatch scope when using a dedicated vhost
* Tue Apr 12 2016 Daniel Berteaud <daniel@firewall-services.com> 0.1.7-1.sme
- Always define hook_get_auth_webserver_profile function or profile
will fallback to the default one
* Wed Dec 23 2015 Daniel Berteaud <daniel@firewall-services.com> 0.1.6-1.sme
- Make sure hooks are declared just once
* Fri Jan 16 2015 Daniel Berteaud <daniel@firewall-services.com> 0.1.5-1.sme
- Fix the new permission hook
* Fri Jan 16 2015 Daniel Berteaud <daniel@firewall-services.com> 0.1.4-1.sme
- Adapt templates to the new permission system
* Wed Aug 13 2014 Daniel Berteaud <daniel@firewall-services.com> 0.1.3-1.sme
- Merge branches for SME8 and SME9
- Fix http auth when not using Lemonldap::NG
* Fri Dec 20 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.2-1.sme * Fri Dec 20 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1.2-1.sme
- Adapt auth for LimeSurvey 2.05 (plugin based) - Adapt auth for LimeSurvey 2.05 (plugin based)
@ -49,12 +70,11 @@ rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \ /sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
> %{name}-%{version}-filelist > %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%clean %clean
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%postun %postun

Loading…
Cancel
Save