Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7b6cbbffac | ||
|
7399d228c6 | ||
|
96457a300d | ||
|
6e9820bfd6 | ||
|
152c1d08f1 | ||
|
29f2690d33 | ||
|
6fc63e7980 | ||
|
82c7e91444 | ||
|
6c2188e568 | ||
|
7812574a48 | ||
|
f5e615f5f4 | ||
|
0d486971a0 | ||
|
9321182195 | ||
|
0d662b16e5 | ||
|
b805a95afd | ||
|
46f288ba57 | ||
|
85cc0e73ef | ||
|
c178946437 |
|
@ -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,17 +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" .
|
||||||
" AuthExternal pwauth\n" .
|
" AuthExternal pwauth\n" . (($ver =~ m/^9/) ? " AuthBasicProvider external\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
|
||||||
|
@ -37,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>
|
|
@ -12,41 +12,43 @@ function hook_get_auth_webserver_profile(\$user_name) {
|
||||||
\$login = \$_SERVER['REMOTE_USER'];
|
\$login = \$_SERVER['REMOTE_USER'];
|
||||||
if (isset(\$_SERVER['HTTP_USER_NAME'])){
|
if (isset(\$_SERVER['HTTP_USER_NAME'])){
|
||||||
\$name = \$_SERVER['HTTP_USER_NAME'];
|
\$name = \$_SERVER['HTTP_USER_NAME'];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
\$name = \$login;
|
\$name = \$login;
|
||||||
}
|
}
|
||||||
if (isset(\$_SERVER['HTTP_USER_EMAIL'])){
|
if (isset(\$_SERVER['HTTP_USER_EMAIL'])){
|
||||||
\$email = \$_SERVER['HTTP_USER_EMAIL'];
|
\$email = \$_SERVER['HTTP_USER_EMAIL'];
|
||||||
}
|
}
|
||||||
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,5 +1,5 @@
|
||||||
%define name smeserver-limesurvey
|
%define name smeserver-limesurvey
|
||||||
%define version 0.1.2
|
%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}
|
||||||
|
@ -14,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
|
||||||
|
|
||||||
|
@ -22,6 +22,32 @@ AutoReqProv: no
|
||||||
Integration of LimeSurvey on SME Server
|
Integration of LimeSurvey on SME Server
|
||||||
|
|
||||||
%changelog
|
%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
|
* 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)
|
||||||
|
|
||||||
|
@ -44,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…
Reference in New Issue
Block a user