Ajout script d'autoconf pour Firefox

tags/0.2.8
Daniel Berteaud 13 years ago
parent 3451b56329
commit 3e19c3c45f
  1. 6
      createlinks
  2. 1
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/99MozillaMcd
  3. 8
      root/etc/e-smith/templates/usr/share/mozilla-mcd/conf.php/10All
  4. 62
      root/usr/share/mozilla-mcd/firefox.php
  5. 68
      root/usr/share/mozilla-mcd/thunderbird.php

@ -12,9 +12,9 @@ templates2events("/home/e-smith/files/shares/wpkg/files/config.xml", qw(wpkg-upd
templates2events("/home/e-smith/files/shares/wpkg/files/profiles/variables.xml", qw(wpkg-update bootstrap-console-save));
templates2events("/home/e-smith/files/samba/netlogon/netlogon.bat", qw(workgroup-update bootstrap-consolesave));
templates2events("/usr/share/mozilla-mcd/thunderbird.conf.php", qw(wpkg-update webapps-update bootstrap-consolesave));
templates2events("/usr/share/mozilla-mcd/conf.php", qw(wpkg-update webapps-update bootstrap-console-save));
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/usr/share/mozilla-mcd/thunderbird.conf.php/template-begin");
safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/usr/share/mozilla-mcd/thunderbird.conf.php/template-end");
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/usr/share/mozilla-mcd/conf.php/template-begin");
safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/usr/share/mozilla-mcd/conf.php/template-end");
panel_link('logonscript','manager');

@ -7,6 +7,7 @@ if ((${'mozilla-mcd'}{'status'} || 'disabled')eq 'enabled'){
$OUT .=<<"EOF";
Alias /thunderbird.cfg /usr/share/mozilla-mcd/thunderbird.php
Alias /firefox.cfg /usr/share/mozilla-mcd/firefox.php
<Directory /usr/share/mozilla-mcd/>
AddType application/x-httpd-php .php .php3

@ -4,7 +4,9 @@ use esmith::util;
my $ldapbase = esmith::util::ldapBase ($DomainName);
my $pref = ((${'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 $url = ${'mozilla-mcd'}{'HomeURL'} || 'https://auth.' . "$DomainName";
$OUT .=<<"EOF";
@ -15,7 +17,9 @@ define('IMAP_PORT', '$imaps{'TCPPort'}');
define('SMTP_SERVER', '$SystemName.$DomainName');
define('SMTP_PORT', '$ssmtpd{'TCPPort'}');
define('LDAP_SERVER', 'localhost');
define('PREF', '$pref');
define('TB_PREF', '$tbpref');
define('FF_PREF', '$ffpref');
define('HOME_URL', '$url');
EOF

@ -0,0 +1,62 @@
<?php
ini_set('log_errors', 1);
ini_set('display_errors', 0);
require('conf.php');
if(isset($_SERVER['QUERY_STRING']) && preg_match('/^.+@' . DOMAIN . '$/', $_SERVER['QUERY_STRING'])) {
$temp = explode('@', $_SERVER['QUERY_STRING']);
$uid = $temp[0];
// Bind to the LDAP server
// Not used for now, but might be usefull one day to generate conf per group or per user
$link = @ldap_connect(LDAP_SERVER) or die ("Couldn't connect to the LDAP server");
ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, 3);
@ldap_bind($link) or die ("Couldn't bind to the LDAP server");
// Lookup the user
$result = ldap_search($link, USER_BASE, "uid=" . $uid);
$user = ldap_get_entries($link, $result);
if($user['count'] == 0) {
// user not found
exit;
}
}
else {
exit;
}
?>
// Disable auto updates
<?php echo FF_PREF;?>("app.update.enabled", false);
<?php echo FF_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);
// Disable the "know your rights" message
<?php echo FF_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";
}
?>
<?php echo FF_PREF;?>("startup.homepage_override_url", "");
<?php echo FF_PREF;?>("startup.homepage_welcome_url", "");
// Do not check for default browser
<?php echo FF_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);
// Block 3rd party cookies
<?php echo FF_PREF;?>("network.cookie.cookieBehavior", 1);

@ -37,24 +37,24 @@ else {
}
// Local Account
<?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");
<?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");
// SMTP config
<?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; ?>");
<?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; ?>");
// Default account is acocunt2 (the personal account)
<?php echo PREF;?>("mail.accountmanager.defaultaccount", "account2");
<?php echo TB_PREF;?>("mail.accountmanager.defaultaccount", "account2");
<?php
@ -67,23 +67,23 @@ $identities = ''
?>
// Personnal account
<?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 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
for ($i=0; $i < count($user[0]['mail'])-1; $i++){
?>
<?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);
<?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);
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 +95,20 @@ $account++;
$id++;
}
?>
<?php echo PREF;?>("mail.account.account2.identities", "<?php echo $identities;?>");
<?php echo PREF;?>("mail.accountmanager.accounts", "account1,account2");
<?php echo TB_PREF;?>("mail.account.account2.identities", "<?php echo $identities;?>");
<?php echo TB_PREF;?>("mail.accountmanager.accounts", "account1,account2");
// Disable auto updates
<?php echo PREF;?>("app.update.enabled", false);
<?php echo PREF;?>("app.update.auto", false);
<?php echo TB_PREF;?>("app.update.enabled", false);
<?php echo TB_PREF;?>("app.update.auto", false);
// Extensions
<?php echo PREF;?>("extensions.installDistroAddons", true);
<?php echo PREF;?>("extensions.enabledScopes", 13);
<?php echo PREF;?>("extensions.autoDisableScopes", 2);
<?php echo TB_PREF;?>("extensions.installDistroAddons", true);
<?php echo TB_PREF;?>("extensions.enabledScopes", 13);
<?php echo TB_PREF;?>("extensions.autoDisableScopes", 2);
// Spam
<?php echo PREF;?>("mail.adaptivefilters.junk_threshold", 500);
<?php echo TB_PREF;?>("mail.adaptivefilters.junk_threshold", 500);
// Checks IMAP folders
defaultPref("mail.check_all_imap_folders_for_new", true);

Loading…
Cancel
Save