After reading comment 8 From Gokhan Topalhan , I did made it work on linux :-)
I don't know what is the vendor.cfg file ? where it should be and how to tell
mozilla to read it, so I kept playing with all.js as follows:
First id didn't worked, mozilla just vanished ... then a strace showed:
open("/usr/lib/mozilla-1.4/components/compreg.dat.tmp",
O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = -1 EACCES (Permission denied)
so i temporarely did:
$ chmod 777 /usr/lib/mozilla-1.4/components/
!? don't know what this pb is about ??
And now it works just fine :-). All of this begin to be a bit of "magic" or
"black box" but it finally do what I want, centralize a lockpref file on a web
server :-) . I'll update my doc
(http://www.int-evry.fr/mci/user/procacci/netscape/en/mozilla-autoconfig-en.html)
as soon as I clarify all this . Any comment on the purpose of the vendor.cfg
file, where it should be, how to call it ? Is my use of all.js wrong ?
After reading comment 8 From Gokhan Topalhan , I did made it work on linux :-)
I don't know what is the vendor.cfg file ? where it should be and how to tell
mozilla to read it, so I kept playing with all.js as follows:
Create the autoamdin. global_ config_ url file
$ cat mci-mozilla- web-tux. js "general. config. vendor" , "mci-mozilla- web-tux" ); "autoadmin. global_ config_ url","http:// corbeau. int-evry. fr/cgi- bin/mci- mozilla- glob-prefs- tux.cgi"); "autoadmin. append_ emailaddr" ,true);
lockPref(
lockPref(
lockPref(
Encode it:
$ ./moz-byteshift.pl -s 13 < mci-mozilla- web-tux. js > mci-mozilla- web-tux. cfg
move cfg file to mozilla-home:
$ cp mci-mozilla- web-tux. cfg /usr/lib/ mozilla- 1.4/
Add the 2 following lines to all.js
$ tail -2 /usr/lib/ mozilla- 1.4/defaults/ pref/all. js config. filename" , "mci-mozilla- web-tux. cfg"); config. vendor" , "mci-mozilla- web-tux" );
pref("general.
pref("general.
and here's my perl cgi script on the web server:
$ cat /var/www/ cgi-bin/ mci-mozilla- glob-prefs- tux.cgi
#!/usr/bin/perl -w
print ("Content-type: application/ x-javascript- config\ n\n"); "MOZILLA_ DEBUG") ; "mail.server. server1. name", mail ); "mail.identity. id1.fullName" , cn); "mail.identity. id1.useremail" , mail);
$page = <<"EOP";
try {
var env_user = getenv("USER");
var env_home = getenv("HOME");
var env_mozdebug= getenv(
function processLDAPValues (values) {
var uid = getLDAPValue ( values , "uid" );
var cn = getLDAPValue ( values , "cn" );
var mail = getLDAPValue ( values , "mail" );
lockPref(
lockPref(
lockPref(
if (env_mozdebug) {
displayError( "debug mozilla.cfg v2.8", "mail:" + mail + "uid:" + uid +
"cn" + cn + "user:" + env_user );
}
} "browser. startup. homepage" , "http:// www.int- evry.fr/ mci/user/"); "browser. startup. homepage_ override" , true); "general. config. vendor" , "mci-mozilla- web-tux" ); "startup. homepage_ override_ url", "http:// www.int- evry.fr/ mci/user/"); "browser. cache.disk. capacity" , 0); "network. cookie. cookieBehavior" , 0); "network. proxy.autoconfi g_url", www.int- evry.fr/ local/config. proxy"); "network. proxy.type" , 2);
//BROWSER
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
"http://
lockPref(
//Account "mail.account. account1. identities" , "id1"); "mail.account. account1. server" , "server1"); "mail.account. account2. server" , "server2"); "mail.account. account3. server" , "server3"); "mail.accountma nager.accounts" , "account1, account2, account3" ); "mail.accountma nager.defaultac count", "account1");
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
//imap "mail.server. server1. hostname" , "imap-int. int-evry. fr"); "mail.server. server1. type", "imap"); "mail.server. server1. login_at_ startup" , true); "mail.identity. id1.draft_ folder" , "imap://" + env_user + int.int- evry.fr/ Drafts" ); "mail.identity. id1.drafts_ folder_ picker_ mode", "0"); "mail.identity. id1.fcc_ folder" , "imap://" + env_user + int.int- evry.fr/ Sent"); "mail.identity. id1.fcc_ folder_ picker_ mode", "0"); "mail.identity. id1.stationery_ folder" , "imap://" + env_user + int.int- evry.fr/ Templates" ); "mail.identity. id1.tmpl_ folder_ picker_ mode", "0"); "mail.identity. id1.valid" , true); "mail.identity. id1.overrideGlo bal_Pref" , true); "mail.server. server1. download_ on_biff" , true); "mail.server. server1. login_at_ startup" , true); "mail.server. server1. userName" , env_user ); "mail.server. server1. delete_ model", 0);
lockPref(
lockPref(
lockPref(
lockPref(
"@imap-
lockPref(
lockPref(
"@imap-
lockPref(
lockPref(
"@imap-
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
//SMTP "mail.identity. id1.smtpServer" , "smtp1"); "mail.smtpserve r.smtp1. auth_method" , 0); "mail.smtpserve rs", "smtp1"); "mail.smtpserve rs", "smtp1"); "mail.smtp. defaultserver" , "smtp1"); "mail.smtpserve r.smtp1. hostname" , "smtp-int. int-evry. fr"); "mail.identity. id1.organizatio n", "INT Evry France"); "mail.startup. enabledMailChec kOnce", true); "mail.ui. folderpane. version" , 3); "mailnews. ui.threadpane. version" , 2);
lockPref(
defaultPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
//LDAP config "mail.identity. id1.directorySe rver", "ldap_2. servers. ldapint" ); "ldap_2. prefs_migrated" , true); "ldap_2. servers. history. filename" , "history.mab"); "ldap_2. servers. history. replication. lastChangeNumbe r", 0); "ldap_2. servers. ldapint. auth.savePasswo rd", true); "ldap_2. servers. ldapint. description" , "ldap-int"); "ldap_2. servers. ldapint. filename" , "abook-1.mab"); "ldap_2. servers. ldapint. position" , 3); "ldap_2. servers. ldapint. uri", /ldap1. int-evry. fr:389/ ou=people, dc=int- evry,dc= fr??sub" ); "ldap_2. servers. pab.filename" , "abook.mab"); "ldap_2. servers. pab.replication .lastChangeNumb er", 0);
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
"ldap:/
lockPref(
lockPref(
//News config "mail.server. server3. hostname" , "news.int- evry.fr" ); "mail.server. server3. max_cached_ connections" , 2); "mail.server. server3. name", "news.int- evry.fr" ); "mail.server. server3. type", "nntp"); "mail.server. server3. userName" , env_user );
lockPref(
lockPref(
lockPref(
lockPref(
lockPref(
//Call to ldap to get user's attribute . dc=int- evry,dc= fr", "uid=" +env_user
getLDAPAttributes ( "localhost", "ou=people,
, "uid,cn,mail" );
} catch(e) { "lockedPref" , e);
displayError(
}
EOP
print $page;
First id didn't worked, mozilla just vanished ... then a strace showed: usr/lib/ mozilla- 1.4/components/ compreg. dat.tmp" , O_CREAT| O_TRUNC| O_LARGEFILE, 0666) = -1 EACCES (Permission denied)
open("/
O_WRONLY|
so i temporarely did: mozilla- 1.4/components/
$ chmod 777 /usr/lib/
!? don't know what this pb is about ??
And now it works just fine :-). All of this begin to be a bit of "magic" or www.int- evry.fr/ mci/user/ procacci/ netscape/ en/mozilla- autoconfig- en.html)
"black box" but it finally do what I want, centralize a lockpref file on a web
server :-) . I'll update my doc
(http://
as soon as I clarify all this . Any comment on the purpose of the vendor.cfg
file, where it should be, how to call it ? Is my use of all.js wrong ?
I still need to test on windows though ...