Liste des groupes pour lesquels on ne force pas la configuration depuis la DB

tags/0.2.15
Daniel Berteaud 12 years ago
parent 217195fd3e
commit 73ebc83d63
  1. 1
      root/etc/e-smith/db/configuration/defaults/mozilla-mcd/NoEnforceGroups
  2. 8
      root/etc/e-smith/templates/usr/share/mozilla-mcd/conf.php/10All
  3. 4
      root/usr/share/mozilla-mcd/firefox.php
  4. 4
      root/usr/share/mozilla-mcd/thunderbird.php

@ -7,6 +7,12 @@ my $ldapbase = esmith::util::ldapBase ($DomainName);
my $tbpref = ((${'mozilla-mcd'}{'TBEnforce'} || 'disabled') =~ m/^enabled|on|1|yes$/) ? "lockPref":"defaultPref"; my $tbpref = ((${'mozilla-mcd'}{'TBEnforce'} || 'disabled') =~ m/^enabled|on|1|yes$/) ? "lockPref":"defaultPref";
my $ffpref = ((${'mozilla-mcd'}{'FFEnforce'} || 'disabled') =~ m/^enabled|on|1|yes$/) ? "lockPref":"defaultPref"; my $ffpref = ((${'mozilla-mcd'}{'FFEnforce'} || 'disabled') =~ m/^enabled|on|1|yes$/) ? "lockPref":"defaultPref";
my $url = ${'mozilla-mcd'}{'HomeURL'} || 'https://auth.' . "$DomainName"; my $url = ${'mozilla-mcd'}{'HomeURL'} || 'https://auth.' . "$DomainName";
my $noenforcegroups = ${'mozilla-mcd'}{'NoEnforceGroups'} || '';
# Format as a PHP array
$noenforcegroups =~ s/^,+|,+$//g;
$noenforcegroups =~ s/^/'/g;
$noenforcegroups =~ s/$/'/g;
$noenforcegroups =~ s/[;,]/','/g;
$OUT .=<<"EOF"; $OUT .=<<"EOF";
@ -20,7 +26,7 @@ define('LDAP_SERVER', 'localhost');
define('TB_PREF', '$tbpref'); define('TB_PREF', '$tbpref');
define('FF_PREF', '$ffpref'); define('FF_PREF', '$ffpref');
define('HOME_URL', '$url'); define('HOME_URL', '$url');
\$NOENFORCEGROUPS = array($noenforcegroups);
EOF EOF

@ -21,10 +21,10 @@ if(isset($_SERVER['QUERY_STRING']) && preg_match('/^.+@' . DOMAIN . '$/', $_SERV
exit; exit;
} }
$pref = FF_PREF; $pref = FF_PREF;
// Don't lock pref if the user is member of admins // Don't lock pref if the user is member of some special groups
// regardless of the setting // regardless of the setting
foreach ($user[0]['posixmemberof'] as $group){ foreach ($user[0]['posixmemberof'] as $group){
if ($group == 'admins'){ if (in_array($group, $NOENFORCEGROUPS)){
$pref = 'defaultPref'; $pref = 'defaultPref';
break; break;
} }

@ -20,10 +20,10 @@ if(isset($_SERVER['QUERY_STRING']) && preg_match('/^.+@' . DOMAIN . '$/', $_SERV
exit; exit;
} }
$pref = TB_PREF; $pref = TB_PREF;
// Don't lock pref if the user is member of admins // Don't lock pref if the user is member of some special groups
// regardless of the setting // regardless of the setting
foreach ($user[0]['posixmemberof'] as $group){ foreach ($user[0]['posixmemberof'] as $group){
if ($group == 'admins'){ if (in_array($group, $NOENFORCEGROUPS)){
$pref = 'defaultPref'; $pref = 'defaultPref';
break; break;
} }

Loading…
Cancel
Save