Enable CAS authentication if smeserver-dovecot is installed

tags/ipasserelle-groupware-0.2.37-1
Daniel Berteaud 11 years ago
parent 84cedb6958
commit 09229996a1
  1. 1
      createlinks
  2. 3
      ipasserelle-groupware.spec
  3. 10
      root/etc/e-smith/templates/etc/pam.d/dovecot/05cas
  4. 4
      root/etc/e-smith/templates/etc/pam.d/dovecot/10SystemAuth
  5. 8
      root/etc/e-smith/templates/etc/pam.d/dovecot/template-begin
  6. 16
      root/etc/e-smith/templates/var/lib/lemonldap-ng/conf/lmConf/060SOGo
  7. 10
      root/etc/e-smith/templates/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults/55authSource
  8. 52
      root/usr/lib/perl5/site_perl/Apache/FilterChangeLength.pm

@ -10,6 +10,7 @@ templates2events("/etc/cron.d/sogo-alarm", qw(email-update bootstrap-console-sav
templates2events("/var/lib/sogo/GNUstep/Defaults/.GNUstepDefaults", qw(email-update bootstrap-console-save pre-backup));
templates2events("/etc/sysconfig/sogo", qw(email-update bootstrap-console-save));
templates2events("/etc/logrotate.d/sogo", qw(email-update bootstrap-console-save));
templates2events("/etc/pam.d/dovecot", qw(email-update bootstrap-console-save));
safe_symlink("restart", "root/etc/e-smith/events/email-update/services2adjust/sogod");
safe_symlink("restart", "root/etc/e-smith/events/email-update/services2adjust/memcached-sogo");

@ -23,6 +23,9 @@ Requires: sope49-gdl1-mysql
Requires: sogo-ealarms-notify
Requires: ipasserelle-base
Requires: memcached
Requires: ipasserelle-portal
Requires: smeserver-lemonldap-ng >= 0.2.6
Requires: smeserver-pam_cas
Obsoletes: smeserver-sogo
Provides: smeserver-sogo

@ -0,0 +1,10 @@
{
if (-d '/var/service/dovecot'){
$OUT .=<<"HERE";
auth sufficient pam_cas.so -simap://localhost -f/etc/pam_cas.conf
HERE
}
else{
return "";
}
}

@ -0,0 +1,4 @@
auth required pam_nologin.so
auth include system-auth
account include system-auth
session include system-auth

@ -0,0 +1,8 @@
{
$OUT = <<HERE;
#%PAM-1.0
HERE
$OUT .=
Text::Template::_load_text("/etc/e-smith/templates-default/template-begin");
}

@ -0,0 +1,16 @@
{
$conf->{'applicationList'}->{'010apps'}->{'sogo'} = {
'options' => {
'logo' => 'mail.png',
'name' => 'SOGo',
'description' => 'Mails, agendas, contacts',
'uri' => "https://$host.$domain/SOGo",
'display' => 'on'
},
'type' => 'application'
} unless ($conf->{'applicationList'}->{'010apps'}->{'sogo'});
$OUT = '';
}

@ -55,4 +55,12 @@
type = ldap;
\}
);
{
# is smeserver-dovecot installed ?
if (-d '/var/service/dovecot'){
$OUT .=<<"HERE";
SOGoAuthenticationType = cas;
SOGoCASServiceURL = "https://auth.$DomainName/cas/";
HERE
}
}

@ -0,0 +1,52 @@
package Apache::FilterChangeLength;
use strict;
use warnings FATAL => 'all';
use Apache2::RequestRec ();
use APR::Table ();
use APR::Bucket ();
use APR::Brigade ();
use base qw(Apache2::Filter);
use Apache2::Const -compile => qw(OK);
use APR::Const -compile => ':common';
sub handler {
my ($filter, $bb) = @_;
my $ctx = $filter->ctx;
my $data = exists $ctx->{data} ? $ctx->{data} : '';
$ctx->{invoked}++;
my ($bdata, $seen_eos) = flatten_bb($bb);
$data .= $bdata if $bdata;
if ($seen_eos) {
my $len = length $data;
$filter->r->headers_out->set('Content-Length', $len);
$filter->print($data) if $data;
}
else {
# store context for all but the last invocation
$ctx->{data} = $data;
$filter->ctx($ctx);
}
return Apache2::Const::OK;
}
sub flatten_bb {
my ($bb) = shift;
my $seen_eos = 0;
my @data;
for (my $b = $bb->first; $b; $b = $bb->next($b)) {
$seen_eos++, last if $b->is_eos;
$b->read(my $bdata);
push @data, $bdata;
}
return (join('', @data), $seen_eos);
}
1;
Loading…
Cancel
Save