Compare commits

...

13 Commits

Author SHA1 Message Date
Daniel Berteaud
7b6cbbffac Spec file update 2017-01-04 09:57:08 +01:00
Daniel Berteaud
7399d228c6 Fix httpd template when alias is enabled 2017-01-04 09:54:01 +01:00
Daniel Berteaud
96457a300d Spec file update 2016-12-14 08:45:20 +01:00
Daniel Berteaud
6e9820bfd6 Missing semicolon 2016-12-11 21:02:43 +01:00
Daniel Berteaud
152c1d08f1 Fix httpd template error 2016-12-11 20:53:57 +01:00
Daniel Berteaud
29f2690d33 Fix LocationMatch scope when using a dedicated vhost 2016-12-11 14:20:19 +01:00
Daniel Berteaud
6fc63e7980 Spec file update 2016-12-11 14:18:23 +01:00
Daniel Berteaud
82c7e91444 Force defining hook_get_auth_webserver_profile
Or it just won't do anything
2016-04-12 16:56:42 +02:00
Daniel Berteaud
6c2188e568 Spec file udpate 2015-12-23 11:31:49 +01:00
Daniel Berteaud
7812574a48 Make sure hooks are declared just one time 2015-12-23 11:22:44 +01:00
Daniel Berteaud
f5e615f5f4 Spec file update 2015-01-16 14:52:41 +01:00
Daniel Berteaud
0d486971a0 Fix the new permission hook 2015-01-16 12:11:21 +01:00
Daniel Berteaud
9321182195 SPec file update 2015-01-16 11:25:55 +01:00
3 changed files with 60 additions and 30 deletions

View File

@ -11,9 +11,7 @@ my $auth = (($limesurvey{'Authentication'} || 'http') eq 'http') ? "AuthName \"L
if ($limesurvey{'status'} eq 'enabled'){
my $path = ($alias eq '') ? '' : 'limesurvey/';
$OUT .=<<"END"
$OUT .=<<"END";
# LimeSurvey Configuration
$alias
@ -39,15 +37,24 @@ $alias
allow from $allow
Satisfy all
</Directory>
<LocationMatch "^/$path(index\.php/)?admin">
END
if ($alias ne ''){
$OUT .=<<"END";
<LocationMatch "^/limesurvey/(index\.php/)?admin">
SSLRequireSSL on
$auth
</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";

View File

@ -12,39 +12,41 @@ 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';
}
return Array(
'full_name' => \$name,
'email' => \$email,
'lang' => '$lang',
'htmleditormode' => 'inline',
'templatelist' => 'default,basic,MyOrgTemplate',
'full_name' => \$name,
'email' => \$email,
'lang' => '$lang',
'htmleditormode' => 'inline',
'templatelist' => 'default,basic,MyOrgTemplate',
);
}
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']))
)) || (\$login == "admin")){
return Array('superadmin' => Array('read'=>true));
}
else{
return Array('surveys' => Array(
'create'=>true,
'read'=>true,
'update'=>true,
'delete'=>true
));
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
));
}
}
}

View File

@ -1,5 +1,5 @@
%define name smeserver-limesurvey
%define version 0.1.3
%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,28 @@ 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
@ -48,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