Thanks Jan

I've updated my doc pointing to the online byteshifter...



Jan Steffen wrote:
Jan Steffen schrieb:

Wouldn't it be possible to have a litte online Byte-shifter?
So everybody could convert a personal mozilla.js to mozilla.cfg with some copy&paste.


Replying to myself.
Just found what is asked for
http://www.alain.knaff.lu/howto/MozillaCustomization/cgi/byteshf.cgi
Nice and useful site BTW

Jan

Title: Mozilla Autoconfig




Mozilla Autoconfig

About Mozilla Autoconfig
Mozilla Autoconfig allows an administrator to configure default Mozilla preferences either from a central file, by getting parameters from a central directory (LDAP), or both. This document shows how to configure mozilla to use autoconfig, how to set default parameters and how to read settings from a central LDAP server.
Autoconfig Overview
Mozilla autoconfig basically just gets a set of preferences either from LDAP or from a configuration file and sets these as part of starting Mozilla. You are able to set the preferences as default (so the user can overwrite them), or locked down (stopping users from changing them). You need to change update your installation of Mozilla to reference the configuration file. You also need to create the configuration file and then encrypt it using the moz-byteshift.pl script (which requires perl). You also need an LDAP server if you are going to be getting user preferences from LDAP.
What you need to get started

To get started you'll need:

1. Download the moz-byteshift.pl script from http://www.mozilla.org/blah/moz-byteshift.pl or from http://www.alain.knaff.lu/~aknaff/howto/MozillaCustomization/cgi/byteshf.cgi

2. Ensure you have a machine with a working copy of perl on it.

NB: Steps 1 & 2 can be skipped if you use the online byte-shifter found at http://www.alain.knaff.lu/howto/MozillaCustomization/cgi/byteshf.cgi

3. A machine with Mozilla installed (preferably Mozilla 1.8b2 or later) – see fixing earlier versions of Mozilla and bug

4. I've done all my testing using a Windows version of Mozilla - there is no reason why it should not work under another OS

Creating a basic configuration file
Create your configuration file – lets call it mozilla.js (or your companyname.js) using a text editor and put in the preferences that you want and then save it.

# Mozilla User Preferences

pref("browser.cache.disk.parent_directory", "c:\temp");
pref("startup.homepage_override_url", "http://www.mozilla.org/docs/end-user/");
pref("general.skins.selectedSkin", "modern/1.0");
pref("general.startup.mail", false);
pref("general.startup.browser", true);

For Mozilla to your configuration file it must be byte-shifted using the moz-byteshift.pl script

perl moz-byteshift.pl -s 13 < mozilla.js > mozilla.cfg

Deploying your configuration file and testing
Edit the all.js file :(the default location is c:\program files\mozilla.org\mozilla\defaults\pref\all.js) to include the following two lines at the end

pref("general.config.filename","mozilla.cfg");
pref("general.config.vendor","mozilla");

Copy your mozilla.cfg file into the mozilla directory (c:\program files\mozilla.org\mozilla)

Using LDAP

This is not much more complicated.  In the example I'm getting per-user preferences from LDAP.  I therefore need to know who the user is before I can search for them.  This is done by reading the environment variable (who the user has logged into their workstation as) and then running an ldap query

use the following example to create your mozilla.js file and the follow the steps as above

# Mozilla User Preferences

// First find out the user details from local
// environment variables

var env_user = getenv("USERNAME");
var company_ldapfilter = "uid=" + env_user;
var company_ldapserver = "ldapserver.company.co.nz";
var company_ldapbase="ou=people,o=company";

// Then get more user details from ldap
// and set user-specific settings


var ldap_values = getLDAPAttributes ( company_ldapserver, company_ldapbase, company_ldapfilter , "uid,cn,mail,mailhost" );

function processLDAPValues (ldap_values) {

var ldap_uid = getLDAPValue ( ldap_values , "uid" );
var ldap_cn = getLDAPValue ( ldap_values , "cn" );
var ldap_mail = getLDAPValue ( ldap_values , "mail" );


pref("mail.server.server1.name", ldap_mail );
pref("mail.identity.fullName", ldap_cn);
pref("mail.identity.useremail", ldap_mail);
pref("mail.identity.reply_to", ldap_mail);
pref("mail.identity.id1.fullName", ldap_cn);
pref("mail.identity.id1.useremail", ldap_mail);
pref("mail.identity.id1.reply_to", ldap_mail);
pref("mail.server.server1.userName", ldap_uid);
pref("general.startup.mail", true);
pref("general.startup.browser", true);
pref("mail.account.account1.identities", "id1");
pref("mail.account.account1.server", "server1");
pref("mail.accountmanager.accounts", "account1");
pref("mail.accountmanager.defaultaccount", "account1");
pref("mail.identity.organization", "Company Ltd");
pref("mail.identity.id1.smtpServer", "smtp1");
pref("mail.identity.id1.valid", true);
pref("mail.identity.id1.organization", "Company Ltd");
pref("mail.root.imap-rel", "[ProfD]ImapMail");
pref("mail.root.none-rel", "[ProfD]Mail");
pref("mail.server.server1.download_on_biff", true);
pref("mail.server.server1.hostname", "server.company.co.nz");
pref("mail.server.server1.isSecure", true);
pref("mail.server.server1.login_at_startup", true);
pref("mail.server.server1.max_cached_connections", 5);
pref("mail.server.server1.name", "[EMAIL PROTECTED]");
pref("mail.server.server1.type", "imap");
pref("mail.smtp.defaultserver", "smtp1");
pref("mail.smtpserver.smtp1.auth_method", 1);
pref("mail.smtpserver.smtp1.hostname", "smtp.company.co.nz");
pref("mail.smtpserver.smtp1.port", 25);
pref("mail.smtpserver.smtp1.try_ssl", 1);
pref("mail.smtpserver.smtp1.username", "");
pref("mail.smtpservers", "smtp1");
pref("mail.startup.enabledMailCheckOnce", true);

}

<Autoconfig setup>  <Last updated: August 04, 2004 Simon Annear>

Reply via email to