Compare commits
18 Commits
Author | SHA1 | Date |
---|---|---|
Daniel Berteaud | 7b6cbbffac | |
Daniel Berteaud | 7399d228c6 | |
Daniel Berteaud | 96457a300d | |
Daniel Berteaud | 6e9820bfd6 | |
Daniel Berteaud | 152c1d08f1 | |
Daniel Berteaud | 29f2690d33 | |
Daniel Berteaud | 6fc63e7980 | |
Daniel Berteaud | 82c7e91444 | |
Daniel Berteaud | 6c2188e568 | |
Daniel Berteaud | 7812574a48 | |
Daniel Berteaud | f5e615f5f4 | |
Daniel Berteaud | 0d486971a0 | |
Daniel Berteaud | 9321182195 | |
Daniel Berteaud | 0d662b16e5 | |
Daniel Berteaud | b805a95afd | |
Daniel Berteaud | 46f288ba57 | |
Daniel Berteaud | 85cc0e73ef | |
Daniel Berteaud | c178946437 |
|
@ -5,6 +5,7 @@ use esmith::Build::CreateLinks qw(:all);
|
|||
# Templates to expand
|
||||
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/.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-end-php", "root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/template-end");
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
{
|
||||
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') ?
|
||||
'':'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" .
|
||||
" AuthType Basic\n" .
|
||||
" AuthExternal pwauth\n" .
|
||||
" AuthExternal pwauth\n" . (($ver =~ m/^9/) ? " AuthBasicProvider external\n":'') .
|
||||
" Require valid-user\n" : '';
|
||||
|
||||
if ($limesurvey{'status'} eq 'enabled'){
|
||||
|
||||
$OUT .=<<"END"
|
||||
$OUT .=<<"END";
|
||||
|
||||
# LimeSurvey Configuration
|
||||
$alias
|
||||
|
@ -37,15 +37,24 @@ $alias
|
|||
allow from $allow
|
||||
Satisfy all
|
||||
</Directory>
|
||||
<Directory /usr/share/limesurvey/admin>
|
||||
END
|
||||
|
||||
if ($alias ne ''){
|
||||
$OUT .=<<"END";
|
||||
<LocationMatch "^/limesurvey/(index\.php/)?admin">
|
||||
SSLRequireSSL on
|
||||
$auth
|
||||
</Directory>
|
||||
</LocationMatch>
|
||||
END
|
||||
|
||||
}
|
||||
$OUT .=<<'END';
|
||||
<DirectoryMatch "/usr/share/limesurvey/(framework|console|installer/sql|locale|application/(logs|config)|docs)">
|
||||
Deny from all
|
||||
</DirectoryMatch>
|
||||
|
||||
END
|
||||
|
||||
}
|
||||
else{
|
||||
$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
|
||||
$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>
|
|
@ -12,41 +12,43 @@ function hook_get_auth_webserver_profile(\$user_name) {
|
|||
\$login = \$_SERVER['REMOTE_USER'];
|
||||
if (isset(\$_SERVER['HTTP_USER_NAME'])){
|
||||
\$name = \$_SERVER['HTTP_USER_NAME'];
|
||||
}
|
||||
}
|
||||
else{
|
||||
\$name = \$login;
|
||||
}
|
||||
if (isset(\$_SERVER['HTTP_USER_EMAIL'])){
|
||||
\$email = \$_SERVER['HTTP_USER_EMAIL'];
|
||||
}
|
||||
}
|
||||
else{
|
||||
\$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(
|
||||
'full_name' => \$name,
|
||||
'email' => \$email,
|
||||
'lang' => '$lang',
|
||||
'htmleditormode' => 'inline',
|
||||
'templatelist' => 'default,basic,MyOrgTemplate',
|
||||
'create_survey' => 1,
|
||||
'create_user' => \$admin,
|
||||
'delete_user' => \$admin,
|
||||
'superadmin' => \$admin,
|
||||
'configurator' => \$admin,
|
||||
'manage_template' => \$admin,
|
||||
'manage_label' => \$admin
|
||||
'full_name' => \$name,
|
||||
'email' => \$email,
|
||||
'lang' => '$lang',
|
||||
'htmleditormode' => 'inline',
|
||||
'templatelist' => 'default,basic,MyOrgTemplate',
|
||||
);
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%define name smeserver-limesurvey
|
||||
%define version 0.1.2
|
||||
%define version 0.1.10
|
||||
%define release 1
|
||||
Summary: SME server integration of limesurvey
|
||||
Name: %{name}
|
||||
|
@ -14,7 +14,7 @@ BuildArchitectures: noarch
|
|||
BuildRequires: e-smith-devtools
|
||||
BuildRoot: /var/tmp/%{name}-%{version}
|
||||
Requires: e-smith-base
|
||||
Requires: limesurvey >= 2.05.131219
|
||||
Requires: limesurvey >= 2.05.141229
|
||||
Requires: smeserver-webapps-common
|
||||
AutoReqProv: no
|
||||
|
||||
|
@ -22,6 +22,32 @@ AutoReqProv: no
|
|||
Integration of LimeSurvey on SME Server
|
||||
|
||||
%changelog
|
||||
* Wed Jan 4 2017 Daniel Berteaud <daniel@firewall-services.com> 0.1.10-1.sme
|
||||
- Fix httpd template when alias is enabled
|
||||
|
||||
* 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
|
||||
- Adapt auth for LimeSurvey 2.05 (plugin based)
|
||||
|
||||
|
@ -44,12 +70,11 @@ rm -f %{name}-%{version}-filelist
|
|||
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
|
||||
> %{name}-%{version}-filelist
|
||||
|
||||
%files -f %{name}-%{version}-filelist
|
||||
%defattr(-,root,root)
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files -f %{name}-%{version}-filelist
|
||||
%defattr(-,root,root)
|
||||
|
||||
%postun
|
||||
|
||||
|
|
Loading…
Reference in New Issue