Merge branch 'master' of main:/home/e-smith/files/shares/dev/files/ipasserelle-gp

tags/0.2.16 0.2.16
Daniel Berteaud 12 years ago
commit 230bc867b4
  1. 10
      ipasserelle-gp.spec
  2. 1
      root/etc/e-smith/db/configuration/defaults/mozilla-mcd/NoEnforceGroups
  3. 8
      root/etc/e-smith/templates/usr/share/mozilla-mcd/conf.php/10All
  4. 46
      root/usr/share/mozilla-mcd/firefox.php
  5. 89
      root/usr/share/mozilla-mcd/thunderbird.php

@ -1,4 +1,4 @@
%define version 0.2.14
%define version 0.2.15
%define release 1
%define name ipasserelle-gp
@ -26,7 +26,13 @@ Ce paquet permet de gérer un parc de machines sous MS Windows
Basé sur WPKG et d'autres outils
%changelog
* Fri Sep 6 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.14-1
* Sat Sep 8 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.15-1
- Don't enforce Firefox or Thunderbird config for members of
specified groups
- Get the home URL from LDAP if it's set
- Make defaultPref for home URL works
* Fri Sep 7 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.14-1
- small improvments in Thunderbird auto config
* Thu Sep 6 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.13-1

@ -7,6 +7,12 @@ my $ldapbase = esmith::util::ldapBase ($DomainName);
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 $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";
@ -20,7 +26,7 @@ define('LDAP_SERVER', 'localhost');
define('TB_PREF', '$tbpref');
define('FF_PREF', '$ffpref');
define('HOME_URL', '$url');
\$NOENFORCEGROUPS = array($noenforcegroups);
EOF

@ -20,6 +20,19 @@ if(isset($_SERVER['QUERY_STRING']) && preg_match('/^.+@' . DOMAIN . '$/', $_SERV
// user not found
exit;
}
$pref = FF_PREF;
// Don't lock pref if the user is member of some special groups
// regardless of the setting
foreach ($user[0]['posixmemberof'] as $group){
if (in_array($group, $NOENFORCEGROUPS)){
$pref = 'defaultPref';
break;
}
}
$url = HOME_URL;
if (preg_match('/^https?:\/\//', $user[0]['labeleduri'][0]))
$url = $user[0]['labeleduri'][0];
}
else {
exit;
@ -27,38 +40,39 @@ else {
?>
// Disable auto updates
<?php echo FF_PREF;?>("app.update.enabled", false);
<?php echo FF_PREF;?>("app.update.auto", false);
<?php echo $pref;?>("app.update.enabled", false);
<?php echo $pref;?>("app.update.auto", false);
// Extensions
<?php echo FF_PREF;?>("extensions.installDistroAddons", true);
<?php echo FF_PREF;?>("extensions.enabledScopes", 13);
<?php echo FF_PREF;?>("extensions.autoDisableScopes", 2);
<?php echo $pref;?>("extensions.installDistroAddons", true);
<?php echo $pref;?>("extensions.enabledScopes", 13);
<?php echo $pref;?>("extensions.autoDisableScopes", 2);
// Disable the "know your rights" message
<?php echo FF_PREF;?>("browser.rights.3.shown", true);
<?php echo $pref;?>("browser.rights.3.shown", true);
// Home page
<?php
if (FF_PREF == 'lockPref'){
// Bug somewhere: defaultPref doesn't set the home page
// only lockPref works
echo 'lockPref("browser.startup.homepage", "'.HOME_URL.'");'."\n";
echo 'lockPref("browser.startup.page", 1);'."\n";
if ($pref == 'defaultPref'){
// startup.homepage is a complex setting.
// see http://mike.kaply.com/2012/08/29/setting-the-default-firefox-homepage-with-autoconfig/
$url = 'data:text/plain,browser.startup.homepage='.$url;
}
?>
<?php echo FF_PREF;?>("startup.homepage_override_url", "");
<?php echo FF_PREF;?>("startup.homepage_welcome_url", "");
<?php echo $pref;?>("browser.startup.homepage", "'.<?php echo $url;?>.'");
<?php echo $pref;?>("browser.startup.page", 1);
<?php echo $pref;?>("startup.homepage_override_url", "");
<?php echo $pref;?>("startup.homepage_welcome_url", "");
// Do not check for default browser
<?php echo FF_PREF;?>("browser.shell.checkDefaultBrowser", false);
<?php echo $pref;?>("browser.shell.checkDefaultBrowser", false);
// Disable popup blocker
// not that very useful anymore, and blocks legitim popups from SOGo
<?php echo FF_PREF;?>("dom.disable_open_during_load", false);
<?php echo $pref;?>("dom.disable_open_during_load", false);
// Block 3rd party cookies
<?php echo FF_PREF;?>("network.cookie.cookieBehavior", 1);
<?php echo $pref;?>("network.cookie.cookieBehavior", 1);
<?php
// Include other conf fragment if they exist

@ -19,6 +19,15 @@ if(isset($_SERVER['QUERY_STRING']) && preg_match('/^.+@' . DOMAIN . '$/', $_SERV
// user not found
exit;
}
$pref = TB_PREF;
// Don't lock pref if the user is member of some special groups
// regardless of the setting
foreach ($user[0]['posixmemberof'] as $group){
if (in_array($group, $NOENFORCEGROUPS)){
$pref = 'defaultPref';
break;
}
}
}
else {
exit;
@ -37,24 +46,24 @@ else {
}
// Local Account
<?php echo TB_PREF;?>("mail.account.account1.server", "server1");
<?php echo TB_PREF;?>("mail.accountmanager.localfoldersserver", "server1");
<?php echo TB_PREF;?>("mail.server.server1.directory-rel", "[ProfD]Mail/Local Folders");
<?php echo TB_PREF;?>("mail.server.server1.hostname", "Local Folders");
<?php echo TB_PREF;?>("mail.server.server1.name", "Dossiers locaux");
<?php echo TB_PREF;?>("mail.server.server1.type", "none");
<?php echo TB_PREF;?>("mail.server.server1.userName", "nobody");
<?php echo $pref;?>("mail.account.account1.server", "server1");
<?php echo $pref;?>("mail.accountmanager.localfoldersserver", "server1");
<?php echo $pref;?>("mail.server.server1.directory-rel", "[ProfD]Mail/Local Folders");
<?php echo $pref;?>("mail.server.server1.hostname", "Local Folders");
<?php echo $pref;?>("mail.server.server1.name", "Dossiers locaux");
<?php echo $pref;?>("mail.server.server1.type", "none");
<?php echo $pref;?>("mail.server.server1.userName", "nobody");
// SMTP config
<?php echo TB_PREF;?>("mail.smtp.defaultserver", "smtp1");
<?php echo TB_PREF;?>("mail.smtpservers", "smtp1");
<?php echo TB_PREF;?>("mail.smtpserver.smtp1.try_ssl", 3);
<?php echo TB_PREF;?>("mail.smtpserver.smtp1.port", <?php echo SMTP_PORT; ?>);
<?php echo TB_PREF;?>("mail.smtpserver.smtp1.hostname", "<?php echo SMTP_SERVER; ?>");
<?php echo TB_PREF;?>("mail.smtpserver.smtp1.username", "<?php echo $uid; ?>");
<?php echo $pref;?>("mail.smtp.defaultserver", "smtp1");
<?php echo $pref;?>("mail.smtpservers", "smtp1");
<?php echo $pref;?>("mail.smtpserver.smtp1.try_ssl", 3);
<?php echo $pref;?>("mail.smtpserver.smtp1.port", <?php echo SMTP_PORT; ?>);
<?php echo $pref;?>("mail.smtpserver.smtp1.hostname", "<?php echo SMTP_SERVER; ?>");
<?php echo $pref;?>("mail.smtpserver.smtp1.username", "<?php echo $uid; ?>");
// Default account is acocunt2 (the personal account)
<?php echo TB_PREF;?>("mail.accountmanager.defaultaccount", "account2");
<?php echo $pref;?>("mail.accountmanager.defaultaccount", "account2");
<?php
@ -67,23 +76,23 @@ $identities = ''
?>
// Personnal account
<?php echo TB_PREF;?>("mail.account.account2.server", "server<?php echo $server?>");
<?php echo TB_PREF;?>("mail.server.server2.hostname", "<?php echo IMAP_SERVER; ?>");
<?php echo TB_PREF;?>("mail.server.server2.name", "<?php echo $user[0]['mail'][0]; ?>");
<?php echo TB_PREF;?>("mail.server.server2.port", <?php echo IMAP_PORT; ?>);
<?php echo TB_PREF;?>("mail.server.server2.socketType", 3);
<?php echo TB_PREF;?>("mail.server.server2.type", "imap");
<?php echo TB_PREF;?>("mail.server.server2.userName", "<?php echo $uid; ?>");
<?php echo $pref;?>("mail.account.account2.server", "server<?php echo $server?>");
<?php echo $pref;?>("mail.server.server2.hostname", "<?php echo IMAP_SERVER; ?>");
<?php echo $pref;?>("mail.server.server2.name", "<?php echo $user[0]['mail'][0]; ?>");
<?php echo $pref;?>("mail.server.server2.port", <?php echo IMAP_PORT; ?>);
<?php echo $pref;?>("mail.server.server2.socketType", 3);
<?php echo $pref;?>("mail.server.server2.type", "imap");
<?php echo $pref;?>("mail.server.server2.userName", "<?php echo $uid; ?>");
<?php
for ($i=0; $i < count($user[0]['mail'])-1; $i++){
?>
<?php echo TB_PREF;?>("mail.identity.id<?php echo $id; ?>.fullName", "<?php echo $user[0]['cn'][0]; ?>");
<?php echo TB_PREF;?>("mail.identity.id<?php echo $id; ?>.organization", "<?php echo $user[0]['o'][0]; ?>");
<?php echo TB_PREF;?>("mail.identity.id<?php echo $id; ?>.smtpServer", "smtp1");
<?php echo TB_PREF;?>("mail.identity.id<?php echo $id; ?>.useremail", "<?php echo $user[0]['mail'][$i]; ?>");
<?php echo TB_PREF;?>("mail.identity.id<?php echo $id; ?>.valid", true);
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.fullName", "<?php echo $user[0]['cn'][0]; ?>");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.organization", "<?php echo $user[0]['o'][0]; ?>");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.smtpServer", "smtp1");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.useremail", "<?php echo $user[0]['mail'][$i]; ?>");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.valid", true);
defaultPref("mail.identity.id<?php echo $id; ?>.fcc_folder", "imap://<?php echo $uid; ?>@<?php echo IMAP_SERVER; ?>/Sent");
defaultPref("mail.identity.id<?php echo $id; ?>.draft_folder", "imap://<?php echo $uid; ?>@<?php echo IMAP_SERVER; ?>/Drafts");
defaultPref("mail.identity.id<?php echo $id; ?>.stationery_folder", "imap://<?php echo $uid; ?>@<?php echo IMAP_SERVER; ?>/Templates");
@ -95,20 +104,20 @@ $account++;
$id++;
}
?>
<?php echo TB_PREF;?>("mail.account.account2.identities", "<?php echo $identities;?>");
<?php echo TB_PREF;?>("mail.accountmanager.accounts", "account1,account2");
<?php echo $pref;?>("mail.account.account2.identities", "<?php echo $identities;?>");
<?php echo $pref;?>("mail.accountmanager.accounts", "account1,account2");
// Disable auto updates
<?php echo TB_PREF;?>("app.update.enabled", false);
<?php echo TB_PREF;?>("app.update.auto", false);
<?php echo $pref;?>("app.update.enabled", false);
<?php echo $pref;?>("app.update.auto", false);
// Extensions
<?php echo TB_PREF;?>("extensions.installDistroAddons", true);
<?php echo TB_PREF;?>("extensions.enabledScopes", 13);
<?php echo TB_PREF;?>("extensions.autoDisableScopes", 2);
<?php echo $pref;?>("extensions.installDistroAddons", true);
<?php echo $pref;?>("extensions.enabledScopes", 13);
<?php echo $pref;?>("extensions.autoDisableScopes", 2);
// Spam
<?php echo TB_PREF;?>("mail.adaptivefilters.junk_threshold", 500);
<?php echo $pref;?>("mail.adaptivefilters.junk_threshold", 500);
// Checks IMAP folders
defaultPref("mail.check_all_imap_folders_for_new", true);
@ -125,14 +134,14 @@ defaultPref("mail.imap.expunge_threshold_number", 100);
// Adds the domain from your email address to the
// recipients email address if it doesn't have a domain
<?php echo TB_PREF;?>("mail.enable_autocomplete", true);
<?php echo $pref;?>("mail.enable_autocomplete", true);
// Hide useless messages
<?php echo TB_PREF;?>("mail.ui.show.migration.on.upgrade", false);
<?php echo TB_PREF;?>("app.update.showInstalledUI", false);
<?php echo TB_PREF;?>("browser.startup.homepage_override.mstone", "ignore");
<?php echo TB_PREF;?>("mailnews.start_page_override.mstone", "ignore");
<?php echo TB_PREF;?>("mail.rights.version", 1);
<?php echo $pref;?>("mail.ui.show.migration.on.upgrade", false);
<?php echo $pref;?>("app.update.showInstalledUI", false);
<?php echo $pref;?>("browser.startup.homepage_override.mstone", "ignore");
<?php echo $pref;?>("mailnews.start_page_override.mstone", "ignore");
<?php echo $pref;?>("mail.rights.version", 1);
<?php
// Include other conf fragment if they exist

Loading…
Cancel
Save