Compare commits

..

101 Commits

Author SHA1 Message Date
Daniel Berteaud 6c422e9a9a Spec file update 10 years ago
Daniel Berteaud 36812a326e Create a default email_modif.txt for outlook if it doesn't already exist 10 years ago
Daniel Berteaud 76f1f1c435 Spec file update 10 years ago
Daniel Berteaud 5b4e54b128 Add default value for signature props 10 years ago
Daniel Berteaud 3f030f8c88 Add support for Outlook signature deployment 10 years ago
Daniel Berteaud 34f7a00a12 Spec file update 10 years ago
Daniel Berteaud 6748efda31 Add xmind in sample profile 10 years ago
Daniel Berteaud 3eb043126a Spec file update 10 years ago
Daniel Berteaud 7007bd4664 Also exclude ImapMail_old from TB profile's backup 10 years ago
Daniel Berteaud 028463ebc6 Also exclude ImapMail_old from TB profile's backup 10 years ago
Daniel Berteaud f0c85fc707 Spec file update 11 years ago
Daniel Berteaud 14710547c8 Typo in bootstrap-console-save event 11 years ago
Daniel Berteaud bc124aa488 Spec file update 11 years ago
Daniel Berteaud 032e151849 Enable signature on forward and reply 11 years ago
Daniel Berteaud abdbf88aa2 Spec file update 11 years ago
Daniel Berteaud be196577cf Do not hardcode defaultPref, use the global pref style (either defaultPref or lockPref) 11 years ago
Daniel Berteaud 379804126f Configure TB to reply on top by default 11 years ago
Daniel Berteaud 982f9f8098 Spec file update 11 years ago
Daniel Berteaud 241a1a5f8a Add a few packages (disabled) in the workstation profile 11 years ago
Daniel Berteaud d01206046d update spec file 12 years ago
Daniel Berteaud abba59aa8f Revert "Use UTF-8 in Thunderbird" 12 years ago
Daniel Berteaud 66cf339370 update spec file 12 years ago
Daniel Berteaud dcdd5c5c01 Use UTF-8 in Thunderbird 12 years ago
Daniel Berteaud 6fbbfeab71 update spec file 12 years ago
Daniel Berteaud bbfa4b540d add userprofile in workstation 12 years ago
Daniel Berteaud 17a01b868d update spec file 12 years ago
Daniel Berteaud bdf0ef3b71 Add hostname pref in mozilla MCD config 12 years ago
Daniel Berteaud 75fc94d446 Load Services.jsm and don't disable popup blocker 12 years ago
Daniel Berteaud 7a611d706b Fix merge conflict on spec file 12 years ago
Daniel Berteaud 986d0b0ea4 Update spec file 12 years ago
Daniel Berteaud 6189ec3f00 Exclude ImapMail.old and Mail from Thunderbird profile backups 12 years ago
Daniel Berteaud 3da1a5e5b9 Update spec file 12 years ago
Daniel Berteaud 96276bd696 Fix missing GOTO in mozBackup script 12 years ago
Daniel Berteaud d6d1573820 Update spec file 12 years ago
Daniel Berteaud ac7cb79b54 Use GOTO :EOF instead of exit in mozBackup script so the personal script can after 12 years ago
Daniel Berteaud a05e9dc338 Update spec file 12 years ago
Daniel Berteaud 460e13c606 Let other packages add variables 12 years ago
Daniel Berteaud 8332271688 Mise à jour du fichier spec 12 years ago
Daniel Berteaud 56854dc1d3 Ajout de kompozer au profile graphhiste 12 years ago
Daniel Berteaud 720c4d846a Ne pas sauver les mots de passe des profiles TB et FF, question de sécurité 12 years ago
Daniel Berteaud 8f1b16430f Ajout du logiciel freemind dans le profile worstation (commenté par défaut) 12 years ago
Daniel Berteaud 9785ce92e2 Exclusion des bases sqlite corrompues 12 years ago
Daniel Berteaud dfdd92deef Correction des répertoires Sent, Drafts et Templates 12 years ago
Daniel Berteaud d53d1d258a Ajout d'un script pour la sauvegarde des profiles Thunderbird et Firefox 12 years ago
Daniel Berteaud 82084ac2ac Mise à jour du fichier spec 12 years ago
Daniel Berteaud 1591c16e95 Ajout du support de liste blanche de groupes 12 years ago
Daniel Berteaud 74d999647f Ne pas générer la configuration des comptes si on reçoit une adresse mail valide qui n'est pas un UID 12 years ago
Daniel Berteaud 851414d445 Mise à jour du fichier spec 12 years ago
Daniel Berteaud 050f63759c Revert du lookup sur adresse mail 12 years ago
Daniel Berteaud 7802991e8a Mise à jour du fichier spec 12 years ago
Daniel Berteaud 229febd1e0 Correction de l'UID des utilisateurs si une adresse mail est passée en paramètre 12 years ago
Daniel Berteaud d160f9de45 Mise à jour du fichier spec 12 years ago
Daniel Berteaud 74abf41837 Correction de mail.content_disposition_type 12 years ago
Daniel Berteaud f2c68832d5 Toujours utiliser lockPref ou defaultPref (suppression de préférence en defaultPref) 12 years ago
Daniel Berteaud b3a2de359d Recherche sur l'adresse mail si l'uid ne donne aucun résultat 12 years ago
Daniel Berteaud 02a2f7de90 Mise à jour du fichier spec 12 years ago
Daniel Berteaud b56bedcb24 Correction de l'URL de la page d'accueil 12 years ago
Daniel Berteaud 117fce88ce Mise à jour du fichier spec 12 years ago
Daniel Berteaud 230bc867b4 Merge branch 'master' of main:/home/e-smith/files/shares/dev/files/ipasserelle-gp 12 years ago
Daniel Berteaud a49821f919 Inclusion des fragments de conf pour Firefox 12 years ago
Daniel Berteaud 970153eec1 Mise à jour du fichier spec 12 years ago
Daniel Berteaud 73ebc83d63 Liste des groupes pour lesquels on ne force pas la configuration depuis la DB 12 years ago
Daniel Berteaud 217195fd3e Récupérer la page d'accueil depuis LDAP, et contourne le réglage par défaut 12 years ago
Daniel Berteaud 8618a4bc34 Ne pas forcer les paramètres pour les membres du groupe admins 12 years ago
Daniel Berteaud b23850764b Mise à jour du fichier spec 12 years ago
Daniel Berteaud 9cc683b3f0 Config Thunderbird: activer l'autocomplétion des adresses 12 years ago
Daniel Berteaud 7ebe03f8ec Masquer les messages de nouvelles versions de Thunderbird et équivalents 12 years ago
Daniel Berteaud 889a9461ca Mise à jour du fichier spec 12 years ago
Daniel Berteaud 816d24ad6d Mise à jour du profile workstation 12 years ago
Daniel Berteaud 02eff29f66 Mise à jour du fichier spec 12 years ago
Daniel Berteaud 4cf5746a1f Ajout de la variable ZBX_SERVER_IP 12 years ago
Daniel Berteaud 7c52d7b8ef Mise à jour du fichier spec 13 years ago
Daniel Berteaud cf7730567d Les partages wpkg et wpkg logs seront masqués dans le server-manager 13 years ago
Daniel Berteaud 36a0569a32 Mise à jour du fichier spec 13 years ago
Daniel Berteaud ee0d3f3c9d Ajout du paquet settings au profile par défaut 13 years ago
Daniel Berteaud 87d79382ad Mise à jour du fichier spec 13 years ago
Daniel Berteaud a9a8f81866 thunderbird.conf.php -> conf.php dans le générateur de configuration Thunderbird 13 years ago
Daniel Berteaud f37b7a06c8 Bloquer l'acces au fichier conf.php (mozilla-mcd) 13 years ago
Daniel Berteaud 5cbe45a469 Ajout d'un profile spares 13 years ago
Daniel Berteaud 05d2bdd302 Mise à jour du fichier spec 13 years ago
Daniel Berteaud e871b4c5ac Ajout du paquet firefox-config en commenté dans le profile workstation 13 years ago
Daniel Berteaud 3e19c3c45f Ajout script d'autoconf pour Firefox 13 years ago
Daniel Berteaud 3451b56329 Utilise esmith::AccountsDB pour la génération des scripts netlogon 13 years ago
Daniel Berteaud 22fca83f58 Ne pas se placer dans le répertoire contenant les scripts run.bat et install.bat, mais appeler le script conf par son chemin. Permet d'exécuter nstall.bat et run.bat directement depuis le réseau 13 years ago
Daniel Berteaud 6008a1a3cd Mise à jour du fichier spec 13 years ago
Daniel Berteaud 2f68dd9269 Nettoyage des commentaires 13 years ago
Daniel Berteaud e5c19b4f7c Chemin absolu vers la signature 13 years ago
Daniel Berteaud 16992624d7 Mise à jour du fichier spec 13 years ago
Daniel Berteaud 170484e4f8 Utilisation de LogonDrive au lieu de HomeDrive 13 years ago
Daniel Berteaud 9553ace923 Mise à jour du fichier spec 13 years ago
Daniel Berteaud cec299bfa7 Correction hôte SERVER d'exemple 13 years ago
Daniel Berteaud 48fe593f93 Ajout de sketchup au profile graphiste 13 years ago
Daniel Berteaud d2e152cd25 Mise à jour du fichier spec 13 years ago
Daniel Berteaud 582729be81 Script de session pour la config du nom d'utilisateur dans Office 13 years ago
Daniel Berteaud 61e181c9f7 Mise à jour du fichier spec 13 years ago
Daniel Berteaud 3ce15801e3 Ajout profile server 13 years ago
Daniel Berteaud 899f30a3f8 Mise à jour du fichier spec 13 years ago
Daniel Berteaud 35948270a4 Ajout du paquet jce (commenté par défaut) 13 years ago
Daniel Berteaud 780c2b664f Mise à jour du fichier spec 13 years ago
Daniel Berteaud d4d35a638a Ajout du paquet ultradefrag au profile default 13 years ago
Daniel Berteaud 1e67fb8538 Mise à jour du fichier spec 13 years ago
  1. 8
      createlinks
  2. 141
      ipasserelle-gp.spec
  3. 1
      root/etc/e-smith/db/configuration/defaults/mozilla-mcd/NoEnforceGroups
  4. 1
      root/etc/e-smith/db/configuration/defaults/wpkg/OutlookSignatures
  5. 1
      root/etc/e-smith/db/configuration/defaults/wpkg/ThunderbirdSignatures
  6. 8
      root/etc/e-smith/events/actions/wpkg-init
  7. 3
      root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/99MozillaMcd
  8. 2
      root/etc/e-smith/templates/etc/smb.conf/22MapHomeDir
  9. 6
      root/etc/e-smith/templates/home/e-smith/files/shares/tools/files/scripts/wpkg/conf.bat/10All
  10. 4
      root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/profiles/variables.xml/10All
  11. 2
      root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/profiles/variables.xml/template-begin
  12. 1
      root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/profiles/variables.xml/template-end
  13. 34
      root/etc/e-smith/templates/usr/share/mozilla-mcd/conf.php/10All
  14. 23
      root/etc/e-smith/templates/usr/share/mozilla-mcd/thunderbird.conf.php/10All
  15. 16
      root/etc/e-smith/web/functions/logonscript
  16. 72
      root/home/e-smith/files/shares/tools/files/scripts/session/010signature.bat
  17. 3
      root/home/e-smith/files/shares/tools/files/scripts/session/012setOfficeName.bat
  18. 70
      root/home/e-smith/files/shares/tools/files/scripts/session/015mozBackup.bat
  19. 3
      root/home/e-smith/files/shares/tools/files/scripts/wpkg/install.bat
  20. 3
      root/home/e-smith/files/shares/tools/files/scripts/wpkg/run.bat
  21. 2
      root/home/e-smith/files/shares/wpkg/files/hosts.xml
  22. 30
      root/home/e-smith/files/shares/wpkg/files/profiles.xml
  23. 39
      root/sbin/e-smith/generate_netlogon
  24. 2
      root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/logonscript.pm
  25. 84
      root/usr/share/mozilla-mcd/firefox.php
  26. 190
      root/usr/share/mozilla-mcd/thunderbird.php

@ -10,11 +10,11 @@ templates2events("/home/e-smith/files/shares/tools/files/scripts/session/001conf
templates2events("/home/e-smith/files/shares/tools/files/scripts/wpkg/conf.bat", qw(wpkg-update bootstrap-console-save));
templates2events("/home/e-smith/files/shares/wpkg/files/config.xml", qw(wpkg-update bootstrap-console-save));
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("/home/e-smith/files/samba/netlogon/netlogon.bat", qw(workgroup-update bootstrap-console-save));
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');

@ -1,4 +1,4 @@
%define version 0.1.2
%define version 0.2.39
%define release 1
%define name ipasserelle-gp
@ -18,11 +18,149 @@ BuildRequires: e-smith-devtools
Requires: ipasserelle-base
Requires: smeserver-fusioninventory-agent
Obsoletes: smeserver-loginscript
Provides: smeserver-loginscript
%description
Ce paquet permet de gérer un parc de machines sous MS Windows
Basé sur WPKG et d'autres outils
%changelog
* Tue Apr 21 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.39-1
- Create a default email_modif.txt if missing (for outlook)
* Thu Apr 2 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.38-1
- Add support for Outlook signature deployment
* Tue Mar 24 2015 Daniel Berteaud <daniel@firewall-services.com> - 0.2.37-1
- Add xmind in the sample workstation profile
* Fri Dec 19 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.2.36-1
- Also exclude ImapMail_old from thunderbird profile's backup
* Wed Jul 16 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.2.35-1
- Fix a typo in bootstrap-console-save event name
* Tue Feb 25 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.2.34-1
- Configure Thunderbird to add signature on reply and forward
* Thu Feb 6 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.2.33-1
- Configure Thunderbird to reply on top by default
- Remove some hardcoded defaultPref, use the global type instead
* Fri Jan 10 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.2.32-1
- Add a few packages (disabled) in the workstation profile
* Thu Apr 4 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.31-1
- Revert previous change as it prevents XMPP accounts to work properly
* Thu Feb 21 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.30-1
- Use UTF-8 for Thunderbird conf
* Wed Feb 20 2013 Daniel Berteaud <daniel@firewall-services.com> - 0.2.29-1
- Add userprofile package in workstation profile
* Wed Dec 19 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.28-1
- Add HOSTNAME constant in mcd config
- Don't disable popup blocker
* Tue Nov 20 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.27-1
- Exclude ImapMail.old and Mail from Thunderbird profile backups
* Sat Nov 10 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.26-1
- Fix missing GOTO in mozBackup script
* Fri Nov 9 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.25-1
- Use GOTO :EOF instead of exit in mozBackup
* Thu Oct 18 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.24-1
- Let other package add variables
* Thu Sep 27 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.23-1
- Fix default imap folders
- Add a session script to backup Thunderbird and Firefox profiles
- Add freemap in workstation profile (commented)
- Add kompozer in graphiste profile
* Mon Sep 24 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.22-1
- Don't generate accounts config if we receive a email address which
is not an uid
- Support a whitelist of groups
* Fri Sep 21 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.21-1
- Revert lookup with an email address
* Fri Sep 21 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.20-1
- Fix uid if a email address is passed
* Thu Sep 20 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.19-1
- Fix mail.content_disposition_type pref
* Thu Sep 20 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.18-1
- Don't force defaultPref for some settings (use the default, either defaultPref or lockPref)
- Lookup in LDAP using the mail address if the uid doesn't return any result
* Wed Sep 12 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.17-1
- Fix home page URL for Firefox
* Wed Sep 12 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.16-1
- Include Firefox conf fragments
* 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
- Update workstation profile
* Wed Aug 29 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.12-1
- Add ZBX_SERVER_IP in the variable profile
* Fri Aug 24 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.11-1
- Create wpkg and wpkglogs shares as hidden and non removable
* Thu Aug 23 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.10-1
- Add settings in the default profile
* Thu Jul 26 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.9-1
- Fix Thunderbird conf generator
* Fri Jul 20 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.8-1
- Add basic firefox autoconf support
* Wed Jul 18 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.7-1
- Use full path for the mail signature (using javascript and env var)
- Cleanups comments in mozilla-mcd script
* Mon Jul 16 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.6-1
- Fix logon drive mapping
* Mon Jul 16 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.5-1
- Add sketchup in graphiste profile
- Fix SERVER1 exemple in hosts.xml
* Thu Jul 12 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.4-1
- Add a session script to set username in Office
* Mon Jul 9 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.3-1
- Add a "server" profile
* Fri Jul 6 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.2-1
- Add JCE in workstation profile
* Wed Jul 4 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.1-1
- Add ultradefrag in default profile
* Mon Jul 2 2012 Daniel Berteaud <daniel@firewall-services.com> - 0.2.0-1
- Provide a session script framework
- Include a panel to manage custom session script
- Provides scripts to autoconfigure Thunderbird
* Wed Jun 20 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.2-1
- Make standard profiles depends on workstation instead of default
@ -38,6 +176,7 @@ Basé sur WPKG et d'autres outils
%build
%{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/profiles/
%{__mkdir_p} root/home/e-smith/files/shares/tools/files/scripts/users
perl createlinks
%install

@ -91,7 +91,9 @@ if (!$wpkg){
ReadUsers => 'deploiement',
smbAccess => 'non-browseable',
httpAccess => 'none',
RecycleBin => 'disabled'
RecycleBin => 'disabled',
Hide => 'yes',
Removable => 'no'
});
unless ( system("/sbin/e-smith/signal-event", "share-create", "wpkg") == 0 ){
@ -110,7 +112,9 @@ if (!$wpkglogs){
WriteUsers => 'deploiement',
smbAccess => 'non-browseable',
httpAccess => 'none',
RecycleBin => 'disabled'
RecycleBin => 'disabled',
Hide => 'yes',
Removable => 'no'
});
unless ( system("/sbin/e-smith/signal-event", "share-create", "wpkglogs") == 0 ){

@ -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
@ -14,7 +15,7 @@ Alias /thunderbird.cfg /usr/share/mozilla-mcd/thunderbird.php
Order deny,allow
Deny from all
Allow from $access
<FilesMatch "\.conf\.php$">
<FilesMatch "conf\.php$">
order deny,allow
Deny from all
</FilesMatch>

@ -1,2 +0,0 @@
logon drive = { $smb{'HomeDrive'} || 'h:' }

@ -7,6 +7,9 @@ my $wg = $smb{'Workgroup'};
my $name = $SystemName;
my $url = "https://auth." . $DomainName;
my $comp = $ldap{'defaultCompany'};
my $mozbackup = (($wpkg{'MozillaBackup'} || 'no') =~ m/^yes|enabled|on|1$/) ? 'yes':'no';
my $olsig = (($wpkg{'OutlookSignatures'} || 'no') =~ m/^yes|enabled|on|1$/) ? 'yes':'no';
my $tbsig = (($wpkg{'ThunderbirdSignatures'} || 'yes') =~ m/^yes|enabled|on|1$/) ? 'yes':'no';
$OUT .=<<"EOF";
@ -19,6 +22,9 @@ SET COMPANY=$comp
SET SOFTWARE=\\\\%IPASSERELLE_IP%\\wpkg\\softwares
SET SETTINGS=\\\\%IPASSERELLE_IP%\\wpkg\\settings
SET WPKGLOGS=\\\\%IPASSERELLE_IP%\\wpkglogs
SET MOZBACKUP=$mozbackup
SET TBSIG=$tbsig
SET OLSIG=$olsig
EOF

@ -1,14 +1,12 @@
<profile id="variables">
<variable name="IPASSERELLE_DOMAIN" value="{$DomainName}" />
<variable name="IPASSERELLE_NT_DOMAIN" value="{uc($smb{'Workgroup'})}" />
<variable name="IPASSERELLE_NAME" value="{$smb{'ServerName'}}" />
<variable name="IPASSERELLE_IP" value="{$InternalInterface{'IPAddress'}}" />
<variable name="BACKUP_SERVER_IP" value="{$wpkg{'BackupServer'} || $InternalInterface{'IPAddress'}}" />
<variable name='BACKUP_USER' value="{$wpkg{'BackupUser'} || 'backup'}" />
<variable name='ZBX_SERVER_IP' value="{$wpkg{'ZabbixServer'} || $InternalInterface{'IPAddress'}}" />
<variable name="IPASSERELLE_HOME_URL" value="http://auth.%IPASSERELLE_DOMAIN%" />
<variable name="TOOLS" value="\\%IPASSERELLE_IP%\tools" />
<variable name="WPKGLOGS" value="\\%IPASSERELLE_IP%\wpkglogs" />
<variable name="SOFTWARE" value="\\%IPASSERELLE_IP%\wpkg\softwares" />
<variable name="SETTINGS" value="\\%IPASSERELLE_IP%\wpkg\settings" />
</profile>

@ -13,3 +13,5 @@
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
-->
<profile id="variables">

@ -0,0 +1,34 @@
{
use esmith::util;
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 = split( /[;,]/, (${'mozilla-mcd'}{'NoEnforceGroups'} || '') );
my @wlgroups = split( /[;,]/, (${'mozilla-mcd'}{'WhiteListGroups'} || '') );
my $noenforcegroups = join (',', @noenforcegroups);
my $wlgroups = join (',', @wlgroups);
$OUT .=<<"EOF";
define('HOSTNAME', '$SystemName');
define('DOMAIN', '$DomainName');
define('USER_BASE', 'ou=Users,$ldapbase');
define('IMAP_SERVER', '$SystemName.$DomainName');
define('IMAP_PORT', '$imaps{'TCPPort'}');
define('SMTP_SERVER', '$SystemName.$DomainName');
define('SMTP_PORT', '$ssmtpd{'TCPPort'}');
define('LDAP_SERVER', 'localhost');
define('TB_PREF', '$tbpref');
define('FF_PREF', '$ffpref');
define('HOME_URL', '$url');
\$NOENFORCEGROUPS = array($noenforcegroups);
\$WHITELISTGROUPS = array($wlgroups);
EOF
}

@ -1,23 +0,0 @@
{
use esmith::util;
my $ldapbase = esmith::util::ldapBase ($DomainName);
my $pref = ((${'mozilla-mcd'}{'TBEnforce'} || 'disabled') =~ m/^enabled|on|1|yes$/) ? "lockPref":"defaultPref";
$OUT .=<<"EOF";
define('DOMAIN', '$DomainName');
define('USER_BASE', 'ou=Users,$ldapbase');
define('IMAP_SERVER', '$SystemName.$DomainName');
define('IMAP_PORT', '$imaps{'TCPPort'}');
define('SMTP_SERVER', '$SystemName.$DomainName');
define('SMTP_PORT', '$ssmtpd{'TCPPort'}');
define('LDAP_SERVER', 'localhost');
define('PREF', '$pref');
EOF
}

@ -42,14 +42,14 @@ __DATA__
<description>FIRSTPAGE_DESC</description>
<field type="select"
id="homedrive"
options="'a:' => 'A:', 'b:' => 'B:', 'c:' => 'C:', 'd:' => 'D:',
'e:' => 'E:', 'f:' => 'F:', 'g:' => 'G:', 'h:' => 'H:',
'i:' => 'I:', 'j:' => 'J:', 'k:' => 'K:', 'l:' => 'L:',
'm:' => 'M:', 'n:' => 'N:', 'o:' => 'O:', 'p:' => 'P:',
'q:' => 'Q:', 'r:' => 'R:', 's:' => 'S:', 't:' => 'T:',
'u:' => 'U:', 'v:' => 'V:', 'w:' => 'W:', 'x:' => 'X:',
'y:' => 'Y:', 'z:' => 'Z:'"
value="get_prop('smb', 'HomeDrive')">
options="'a' => 'A:', 'b' => 'B:', 'c' => 'C:', 'd' => 'D:',
'e' => 'E:', 'f' => 'F:', 'g' => 'G:', 'h' => 'H:',
'i' => 'I:', 'j' => 'J:', 'k' => 'K:', 'l' => 'L:',
'm' => 'M:', 'n' => 'N:', 'o' => 'O:', 'p' => 'P:',
'q' => 'Q:', 'r' => 'R:', 's' => 'S:', 't' => 'T:',
'u' => 'U:', 'v' => 'V:', 'w' => 'W:', 'x' => 'X:',
'y' => 'Y:', 'z' => 'Z:'"
value="get_prop('smb', 'LogonDrive')">
<label>LABEL_HOME_DRIVE</label>
<description>DESC_HOME_DRIVE</description>
</field>

@ -1,3 +1,73 @@
if exist "\\%IPASSERELLE_IP%\tools\signatures\%USERNAME%" (
@echo off
REM gestion des signatures de mail
if not exist "\\%IPASSERELLE_IP%\tools\signatures\%USERNAME%" GOTO :EOF
REM Pour Thunderbird, simple copie, le resrte étant fait par MCD
if "%TBSIG%" EQU "yes" (
if exist "\\%IPASSERELLE_IP%\tools\signatures\%USERNAME%" (
xcopy /E /I /Y \\%IPASSERELLE_IP%\tools\signatures\%USERNAME% "%USERPROFILE%\signature"
)
)
if "%OLSIG%" EQU "yes" (
REM premier deploiement ?
if not exist "%APPDATA%\Microsoft\Signatures\email.htm" (
SET OV="unknown"
REM Detection version Outlook
REM 2013 = 15.0
reg query "HKLM\Software\Microsoft\Office\15.0\Outlook" >NUL 2>NUL
if %errorlevel% EQU 0 (
SET OV=15.0
GOTO :MODREG
)
REM 2010 = 14.0
reg query "HKLM\Software\Microsoft\Office\14.0\Outlook" >NUL 2>NUL
if %errorlevel% EQU 0 (
SET OV=14.0
GOTO :MODREG
)
REM 2007 = 12.0
reg query "HKLM\Software\Microsoft\Office\12.0\Outlook" >NUL 2>NUL
if %errorlevel% EQU 0 (
SET OV=12.0
GOTO :MODREG
)
REM Version inconnue d'office, on arrete
IF "%OV%" EQU "unknown" GOTO :EOF
echo "Office %OV%"
:MODREG
REM Supprimer First Run pour que Outlook prenne en compte les signatures au prochain lancement
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Office\%OV%\Outlook\Setup" /v "First-Run" /f
REM TODO: selection de la signature via le serveur
SET SIG="email"
if exist "\\%IPASSERELLE_IP%\tools\signatures\%USERNAME%\email_modif.html" (
SET SIG="email_modif"
)
REM Configurer la signature pour les nouveaux mails et les reponses
reg add "HKEY_CURRENT_USER\Software\Microsoft\Office\%OV%\Common\MailSettings" /t REG_EXPAND_SZ /v NewSignature /d "%SIG%" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Office\%OV%\Common\MailSettings" /t REG_EXPAND_SZ /v ReplySignature /d "%SIG%" /f
REM Les images des signatures doivent etre inline pour s'afficher
reg add "HKEY_CURRENT_USER\Software\Microsoft\Office\%OV%\Outlook\Options\Mail" /t REG_DWORD /v "Send Pictures With Document" /d 1 /f
)
REM Copie des signatures
xcopy /E /I /Y "\\%IPASSERELLE_IP%\tools\signatures\%USERNAME%\*" "%APPDATA%\Microsoft\Signatures\"
del /Q /F "%APPDATA%\Microsoft\Signatures\email.htm"
rename "%APPDATA%\Microsoft\Signatures\email.html" "email.htm"
echo -- > "%APPDATA%\Microsoft\Signatures\email.rtf"
type "%APPDATA%\Microsoft\Signatures\email.txt" >> "%APPDATA%\Microsoft\Signatures\email.rtf"
copy /Y "%APPDATA%\Microsoft\Signatures\email.rtf" "%APPDATA%\Microsoft\Signatures\email.txt"
if exist "%APPDATA%\Microsoft\Signatures\email_modif.html" (
del /Q /F "%APPDATA%\Microsoft\Signatures\email_modif.htm"
rename "%APPDATA%\Microsoft\Signatures\email_modif.html" "email_modif.htm"
if not exist "%APPDATA%\Microsoft\Signatures\email_modif.txt" (
copy /Y "%APPDATA%\Microsoft\Signatures\email.txt" "%APPDATA%\Microsoft\Signatures\email_modif.txt"
)
)
if exist "%APPDATA%\Microsoft\Signatures\email_modif.txt" (
echo -- > "%APPDATA%\Microsoft\Signatures\email_modif.rtf"
type "%APPDATA%\Microsoft\Signatures\email_modif.txt" >> "%APPDATA%\Microsoft\Signatures\email_modif.rtf"
copy /Y "%APPDATA%\Microsoft\Signatures\email_modif.rtf" "%APPDATA%\Microsoft\Signatures\email_modif.txt"
)
)

@ -0,0 +1,3 @@
REM Configuration du nom de l'utilisateur dans Office
for /f "Tokens=2*" %%m in ('net user %USERNAME% /domain ^| find "Nom complet"') do SET FULLNAME=%%n
reg add "HKCU\Software\Microsoft\Office\Common\UserInfo" /v "UserName" /d "%FULLNAME%" /t REG_SZ /f"

@ -0,0 +1,70 @@
@echo off
REM Ce script permet de sauvegarder les profiles
REM de Thunderbird et Firefox
REM Il conserve les 10 dernières version de chaque
REM Si la fonction n'est pas activée, on s'arrête là
IF "%MOZBACKUP%" NEQ "yes" GOTO :EOF
REM L'archivage des profile va utiliser 7-Zip
REM On s'arrête si cet outil n'est pas disponible
SET ZIP="%PROGRAMFILES%\7-Zip\7z.exe"
IF NOT EXIST %ZIP% GOTO :EOF
REM Les sauvegardes seront stockées dans un répertoire caché
REM du dossier personnel. Un sous répertoire est créé pour chaque
REM machine de l'utilisateur
SET DEST="\\%IPASSERELLE_IP%\%USERNAME%\.backup\%COMPUTERNAME%"
IF NOT EXIST "%DEST%" mkdir "%DEST%"
IF NOT EXIST "%DEST%" GOTO :EOF
REM Recherche du répertoire de profile de Thunderbird
for /f %%a in ('dir /b "%APPDATA%\Thunderbird\Profiles\*.default"') do SET TBPROFILE=%APPDATA%\Thunderbird\Profiles\%%a
REM Si le répertoire de profile n'existe pas, on s'arrête
IF NOT EXIST "%TBPROFILE%" GOTO :EOF
REM Rotation des anciennes sauvegardes
REM Pas très élégant, mais on fait ce qu'on peut
REM souvenez-vous qu'on est qu'en batch ;-)
IF EXIST "%DEST%\thunderbird10.7z" DEL /Q /F "%DEST%\thunderbird10.7z"
IF EXIST "%DEST%\thunderbird9.7z" REN "%DEST%\thunderbird9.7z" thunderbird10.7z
IF EXIST "%DEST%\thunderbird8.7z" REN "%DEST%\thunderbird8.7z" thunderbird9.7z
IF EXIST "%DEST%\thunderbird7.7z" REN "%DEST%\thunderbird7.7z" thunderbird8.7z
IF EXIST "%DEST%\thunderbird6.7z" REN "%DEST%\thunderbird6.7z" thunderbird7.7z
IF EXIST "%DEST%\thunderbird5.7z" REN "%DEST%\thunderbird5.7z" thunderbird6.7z
IF EXIST "%DEST%\thunderbird4.7z" REN "%DEST%\thunderbird4.7z" thunderbird5.7z
IF EXIST "%DEST%\thunderbird3.7z" REN "%DEST%\thunderbird3.7z" thunderbird4.7z
IF EXIST "%DEST%\thunderbird2.7z" REN "%DEST%\thunderbird2.7z" thunderbird3.7z
IF EXIST "%DEST%\thunderbird1.7z" REN "%DEST%\thunderbird1.7z" thunderbird2.7z
REM On compresse tout le profile, sauf le répertoire ImapMail (qui peut être énorme)
REM le fichier global-message-db.sqlite (peut faire plusieurs Go) et quelques autres fichiers non essentiels
REM Le répertoire ImapMail.old existe sur certains profiles, à exclure également
REM tout comme le répertoire Mail, qui contient des mails récupérés en POP en général
REM On utilise le plus faible taux de compression pour éviter de prendre trop de temps
REM vu que ce script sera lancé à l'ouverture de session
%ZIP% a -t7z -mx1 "%DEST%\thunderbird1.7z" "%TBPROFILE%\*" -x!key3 -xr!"Mail\" -xr!"ImapMail.old\" -xr!"ImapMail_old\" -xr!"ImapMail\" -x!global-messages-db.sqlite -x!Cache -x!SOGoImageCache -x!startupCache -x!places.sqlite -x!urlclassifier3.sqlite -x!cookies.sqlite
REM Maintenant, on rajoute à l'archive les fichiers .dat contenus dans le répertoire ImapMail
REM Ces fichiers contiennent en particulier les filtres des messages
REM pas trouvé comment faire ça en une seule passe
%ZIP% a -t7z -mx1 -r "%DEST%\thunderbird1.7z" "%TBPROFILE%\*.dat"
REM Même chose pour Firefox maintenant
for /f %%a in ('dir /b "%APPDATA%\Mozilla\Firefox\Profiles\*.default"') do SET FFPROFILE=%APPDATA%\Mozilla\Firefox\Profiles\%%a
IF NOT EXIST "%FFPROFILE%" GOTO :EOF
IF EXIST "%DEST%\firefox10.7z" DEL /Q /F "%DEST%\firefox10.7z"
IF EXIST "%DEST%\firefox9.7z" REN "%DEST%\firefox9.7z" firefox10.7z
IF EXIST "%DEST%\firefox8.7z" REN "%DEST%\firefox8.7z" firefox9.7z
IF EXIST "%DEST%\firefox7.7z" REN "%DEST%\firefox7.7z" firefox8.7z
IF EXIST "%DEST%\firefox6.7z" REN "%DEST%\firefox6.7z" firefox7.7z
IF EXIST "%DEST%\firefox5.7z" REN "%DEST%\firefox5.7z" firefox6.7z
IF EXIST "%DEST%\firefox4.7z" REN "%DEST%\firefox4.7z" firefox5.7z
IF EXIST "%DEST%\firefox3.7z" REN "%DEST%\firefox3.7z" firefox4.7z
IF EXIST "%DEST%\firefox2.7z" REN "%DEST%\firefox2.7z" firefox3.7z
IF EXIST "%DEST%\firefox1.7z" REN "%DEST%\firefox1.7z" firefox2.7z
%ZIP% a -t7z -mx1 "%DEST%\firefox1.7z" "%FFPROFILE%\*" -x!key3 -x!Cache -x!OfflineCache -x!mozilla-media-cache -x!*.corrupt

@ -1,7 +1,6 @@
:: Script d'initialisation d'une station de travail
cd "%~dp0"
call conf.bat
call "%~dp0"conf.bat
net use \\%IPASSERELLE_IP%\wpkg
net use \\%IPASSERELLE_IP%\wpkglogs
cscript "\\%IPASSERELLE_IP%\wpkg\wpkg.js" /debug /install:wpkg /force /nonotify

@ -1,7 +1,6 @@
:: Script d'initialisation d'une station de travail
cd "%~dp0"
call conf.bat
call "%~dp0"conf.bat
net use \\%IPASSERELLE_IP%\wpkg
net use \\%IPASSERELLE_IP%\wpkglogs
cscript "\\%IPASSERELLE_IP%\wpkg\wpkg.js" /debug /synchronize /nonotify

@ -12,7 +12,7 @@
<profile id="admin" />
</host>
<host name="SERVER1 profile-id="default" />
<host name="SERVER1" profile-id="server" />
-->
<host name=".+" profile-id="workstation" />

@ -11,11 +11,23 @@
<package package-id="tightvnc" />
<package package-id="thunderbird" />
<!-- <package package-id="thunderbird-config" /> -->
<!-- <package package-id="lightning" /> -->
<!-- <package package-id="sogo-addons" /> -->
<!-- <package package-id="filelink-dl" /> -->
<!-- <package package-id="clicktodial" /> -->
<!-- <package package-id="firefox-config" /> -->
<package package-id="flash" />
<package package-id="pdfcreator" />
<package package-id="adobe_reader" />
<package package-id="adobe_reader_fonts" />
<package package-id="vlc" />
<!-- <package package-id="axcrypt" /> -->
<!-- <package package-id="libreoffice" /> -->
<!-- <package package-id="jce" /> -->
<!-- <package package-id="freemind" /> -->
<!-- <package package-id="xmind" /> -->
<!-- <package package-id="userprofile" /> -->
<!-- <package package-id="gajim" /> -->
</profile>
<!-- Le profile graphiste contient une compilation de logiciels pour
@ -25,6 +37,8 @@
<package package-id="gimp" />
<package package-id="inkscape" />
<package package-id="scribus" />
<package package-id="sketchup" />
<package package-id="kompozer" />
</profile>
<!-- profile d'administrateur, contient quelques outils utiles -->
@ -47,10 +61,25 @@
<package package-id="skype" />
</profile>
<!-- Outils pour un serveur -->
<profile id="server">
<depends profile-id="admin" />
<package package-id="zabbix_agent" />
</profile>
<!-- Pour les postes en spare, on peut tout deployer -->
<profile id="spares">
<depends profile-id="workstation" />
<package package-id="graphiste" />
<package package-id="iphone" />
<package package-id="skype" />
</profile>
<!-- profile par défaut appliqué à tous les postes -->
<profile id="default">
<depends profile-id="variables" />
<package package-id="wpkg" />
<package package-id="settings" />
<package package-id="logs" />
<package package-id="cacert" />
<package package-id="productkey" />
@ -61,6 +90,7 @@
<package package-id="sumatrapdf" />
<package package-id="7zip" />
<package package-id="fusioninventory" />
<package package-id="ultradefrag" />
<!-- patch le registre pour la jonction à un domaine NT 4
nécessaire uniquement pour les Windows 7 -->
<package package-id="sambawin7" os="6\.1\.\d{4}" />

@ -17,7 +17,7 @@ die "Time argument missing.\n" unless defined ($time);
package esmith;
use strict;
use esmith::AccountsDB;
use esmith::util;
BEGIN
@ -33,9 +33,8 @@ BEGIN
esmith::util::setRealToEffective ();
my %accounts;
tie %accounts, 'esmith::config', '/home/e-smith/db/accounts';
my $a = esmith::AccountsDB->open_ro() ||
die "Couldn't open AccountsDB\n";
# ------------------------------------------------
# Open and read in the template netlogon.bat file.
@ -84,7 +83,7 @@ foreach $line ( @infile )
{
if ( !$activelevels[ $level ] )
{
$activelevels[ $level ] = isInGroup($curUser, $group);
$activelevels[ $level ] = $a->is_user_in_group($curUser, $group);
}
}
@ -207,33 +206,3 @@ chmod ( 0744, "$netlogonFile" );
exit (0);
# --------------------------------------------------
# Subroutine to check if a given user is in a group:
# --------------------------------------------------
sub isInGroup($$)
{
my ($user, $group) = @_;
my $value = $accounts{$group};
if ( defined ($value) )
{
my ($type, %properties) = split (/\|/, $value);
if ($type eq 'group')
{
my @members = split (/,/, $properties {'Members'});
my $member;
# TODO: grep (/^$user$/, @members)
foreach $member ( @members )
{
if ( $member eq $user )
{
return 1;
}
}
}
}
return 0;
}

@ -61,7 +61,7 @@ sub save_change {
}
print LOGON $logon;
close LOGON;
$c->set_prop('smb', 'HomeDrive', $drive);
$c->set_prop('smb', 'LogonDrive', $drive);
unless ( system ("/sbin/e-smith/signal-event", "workgroup-update") == 0 ){
return $self->error('ERROR_OCCURED');;
}

@ -0,0 +1,84 @@
<?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;
}
$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;
}
?>
// Load Services.jsm, might be usefull
Components.utils.import("resource://gre/modules/Services.jsm");
// Disable auto updates
<?php echo $pref;?>("app.update.enabled", false);
<?php echo $pref;?>("app.update.auto", false);
// Extensions
<?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 $pref;?>("browser.rights.3.shown", true);
// Home page
<?php
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 $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 $pref;?>("browser.shell.checkDefaultBrowser", false);
// Block 3rd party cookies
<?php echo $pref;?>("network.cookie.cookieBehavior", 1);
<?php
// Include other conf fragment if they exist
if (is_array(glob("firefox.mod.*.php"))){
foreach (glob("firefox.mod.*.php") as $filename){
require($filename);
}
}
?>

@ -2,49 +2,99 @@
ini_set('log_errors', 1);
ini_set('display_errors', 0);
require('thunderbird.conf.php');
require('conf.php');
if(isset($_SERVER['QUERY_STRING']) && preg_match('/^.+@' . DOMAIN . '$/', $_SERVER['QUERY_STRING'])) {
$temp = explode('@', $_SERVER['QUERY_STRING']);
$uid = $temp[0];
//Connexion a l'annuaire LDAP
$link = @ldap_connect(LDAP_SERVER) or die ('connexion echouee');
// Bind to the LDAP server
$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 ('identification echouee');
// Recherche de l'utilisateur demandé
@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);
$configaccounts = 1;
if($user['count'] == 0) {
$result = ldap_search($link, USER_BASE, "mail=" . $_SERVER['QUERY_STRING']);
$user = ldap_get_entries($link, $result);
if ($user['count'] == 1){
// If we received an valid email address and not an uid
// considere TB as already configured
// so we don't need to generate accounts config
// only general settings will be sent
$configaccounts = 0;
}
else{
// user not found
header("HTTP/1.1 403 Forbidden");
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;
}
}
// Stop here if the user is not part of the whitelist groups
if (count($WHITELISTGROUPS) > 0){
$conf = 0;
foreach ($user[0]['posixmemberof'] as $group){
if (in_array($group, $WHITELISTGROUPS)){
$conf = 1;
break;
}
}
if ($conf != 1){
header("HTTP/1.1 403 Forbidden");
exit;
}
}
}
else {
// We've not received a valid email address
header("HTTP/1.1 403 Forbidden");
exit;
}
if ($configaccounts == 1){
?>
// Linux / UNIX ?
if(getenv("USER") != "") {
var path_sep = '/';
var path_profile = getenv("HOME");
}
// Windows ?
else {
var path_sep = '\\';
var path_profile = getenv("USERPROFILE");
}
// Compte local
<?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");
// 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");
// SMTP
<?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; ?>");
// 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; ?>");
// Compte par défaut
<?php echo PREF;?>("mail.accountmanager.defaultaccount", "account2");
// Default account is acocunt2 (the personal account)
<?php echo $pref;?>("mail.accountmanager.defaultaccount", "account2");
<?php
@ -55,65 +105,89 @@ $server = 2;
$accountlist = 'account1';
$identities = ''
?>
// Compte personnel
<?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; ?>");
// 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
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);
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");
defaultPref("mail.identity.id<?php echo $id; ?>.attach_signature", true);
defaultPref("mail.identity.id<?php echo $id; ?>.sig_file-rel", "[ProfD]../../../../../signature/email.html");
<?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 $pref;?>("mail.identity.id<?php echo $id; ?>.fcc_folder_pickup_mode", "1");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.fcc_folder", "imap://<?php echo $uid; ?>@<?php echo IMAP_SERVER; ?>/Sent");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.drafts_folder_pickup_mode", "1");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.draft_folder", "imap://<?php echo $uid; ?>@<?php echo IMAP_SERVER; ?>/Drafts");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.templ_folder_pickup_mode", "1");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.stationery_folder", "imap://<?php echo $uid; ?>@<?php echo IMAP_SERVER; ?>/Templates");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.reply_on_top", 1);
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.attach_signature", true);
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.sig_file", path_profile+path_sep+"signature"+path_sep+"email.html");
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.sig_on_fwd", true);
<?php echo $pref;?>("mail.identity.id<?php echo $id; ?>.sig_on_reply", true);
<?php
//$accountlist .= ',account' . $account;
$identities .= ',id' . $id;
$account++;
$id++;
}
?>
<?php echo PREF;?>("mail.account.account2.identities", "<?php echo $identities;?>");
<?php echo PREF;?>("mail.accountmanager.accounts", "account1,account2");
<?php echo $pref;?>("mail.account.account2.identities", "<?php echo $identities;?>");
<?php echo $pref;?>("mail.accountmanager.accounts", "account1,account2");
// Mise a jour
<?php echo PREF;?>("app.update.enabled", false);
<?php echo PREF;?>("app.update.auto", false);
// Extension
<?php echo PREF;?>("extensions.installDistroAddons", true);
<?php echo PREF;?>("extensions.enabledScopes", 13);
<?php echo PREF;?>("extensions.autoDisableScopes", 2);
<?php
// End if for account settings
}
?>
// Disable auto updates
<?php echo $pref;?>("app.update.enabled", false);
<?php echo $pref;?>("app.update.auto", false);
// Extensions
<?php echo $pref;?>("extensions.installDistroAddons", true);
<?php echo $pref;?>("extensions.enabledScopes", 13);
<?php echo $pref;?>("extensions.autoDisableScopes", 2);
// Spam
<?php echo PREF;?>("mail.adaptivefilters.junk_threshold", 500);
<?php echo $pref;?>("mail.adaptivefilters.junk_threshold", 500);
// Checks
defaultPref("mail.check_all_imap_folders_for_new", true);
// Checks IMAP folders
<?php echo $pref;?>("mail.check_all_imap_folders_for_new", true);
// Composition
defaultPref("mail.default_html_action", 3);
<?php echo $pref;?>("mail.default_html_action", 3);
// Pièces jointes
defaultPref("mail.content_disposition_type ", 1);
// Attachments
<?php echo $pref;?>("mail.content_disposition_type", 1);
// Expunge
defaultPref("mail.imap.expunge_option", 3);
defaultPref("mail.imap.expunge_threshold_number", 100);
<?php echo $pref;?>("mail.imap.expunge_option", 3);
<?php echo $pref;?>("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 $pref;?>("mail.enable_autocomplete", true);
// Hide useless messages
<?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
if (is_array(glob("thunderbird.mod.*.php"))){
foreach (glob("thunderbird.mod.*.php") as $filename){
require($filename);

Loading…
Cancel
Save