#!/bin/sh
# Start script for GOsa to be started via mozilla

# Check for presence of gosa profile
if [ ! -d $HOME/.mozilla/gosa ]; then
	mozilla -CreateProfile gosa
	config=`echo $HOME/.mozilla/gosa/*/`

	cat << EOF > $config/prefs.js
# Mozilla User Preferences

/* Do not edit this file.
 *
 * If you make changes to this file while the browser is running,
 * the changes will be overwritten when the browser exits.
 *
 * To make a manual change to preferences, you can visit the URL about:config
 * For more information, see http://www.mozilla.org/unix/customizing.html#prefs
 */

user_pref("browser.search.defaultengine", "engine:///usr/lib/mozilla/searchplugins/google.src");
user_pref("browser.startup.homepage", "http://vserver-02/gosa/index.php");
user_pref("browser.startup.homepage_override.mstone", "rv:1.6");
user_pref("browser.toolbars.showbutton.bookmarks", false);
user_pref("browser.toolbars.showbutton.home", false);
user_pref("browser.toolbars.showbutton.print", false);
user_pref("browser.toolbars.showbutton.search", false);
user_pref("intl.accept_languages", "de");
user_pref("intl.charsetmenu.browser.cache", "ISO-8859-1");
user_pref("plugin.soname.list", "libXt.so:libXext.so");
user_pref("signon.SignonFileName", "84795799.s");
user_pref("wallet.SchemaValueFileName", "84795819.w");
user_pref("security.warn_submit_insecure", false);
EOF

	cat << EOF > $config/84795799.s
#2c
http://vserver-02
.
EOF

	cat << EOF > $config/localstore.rdf
<?xml version="1.0"?>
<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <RDF:Description about="chrome://messenger/content/messenger.xul#sizeCol"
                   hidden="true" />
  <RDF:Description about="chrome://navigator/content/navigator.xul#cmd_viewnavbar"
                   checked="false" />
  <RDF:Description about="chrome://messenger/content/messenger.xul#threadOutliner"
                   height="94" />
  <RDF:Description about="chrome://messenger/content/mail3PaneWindowVertLayout.xul#sizeCol"
                   hidden="true" />
  <RDF:Description about="chrome://navigator/content/navigator.xul#sidebar-splitter"
                   hidden="true" />
  <RDF:Description about="chrome://messenger/content/mail3PaneWindowVertLayout.xul#totalCol"
                   hidden="true" />
  <RDF:Description about="chrome://navigator/content/navigator.xul#cmd_viewtaskbar"
                   checked="false" />
  <RDF:Description about="chrome://navigator/content/navigator.xul#status-bar"
                   hidden="true" />
  <RDF:Description about="chrome://navigator/content/navigator.xul#sidebar-panels"
                   last-selected-panel="urn:sidebar:panel:bookmarks" />
  <RDF:Description about="chrome://navigator/content/navigator.xul#nav-bar"
                   hidden="true" />
  <RDF:Description about="chrome://messenger/content/mail3PaneWindowVertLayout.xul#threadOutliner"
                   height="94" />
  <RDF:Description about="chrome://messenger/content/mail3PaneWindowVertLayout.xul">
    <NC:persist resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul#threadOutliner"/>
    <NC:persist resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul#statusCol"/>
    <NC:persist resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul#sizeCol"/>
    <NC:persist resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul#unreadCol"/>
    <NC:persist resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul#totalCol"/>
    <NC:persist resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul#OrderReceivedColumn"/>
    <NC:persist resource="chrome://messenger/content/mail3PaneWindowVertLayout.xul#flaggedCol"/>
  </RDF:Description>
  <RDF:Description about="chrome://messenger/content/messenger.xul#totalCol"
                   hidden="true" />
  <RDF:Description about="chrome://messenger/content/messenger.xul">
    <NC:persist resource="chrome://messenger/content/messenger.xul#statusCol"/>
    <NC:persist resource="chrome://messenger/content/messenger.xul#sizeCol"/>
    <NC:persist resource="chrome://messenger/content/messenger.xul#unreadCol"/>
    <NC:persist resource="chrome://messenger/content/messenger.xul#totalCol"/>
    <NC:persist resource="chrome://messenger/content/messenger.xul#OrderReceivedColumn"/>
    <NC:persist resource="chrome://messenger/content/messenger.xul#flaggedCol"/>
    <NC:persist resource="chrome://messenger/content/messenger.xul#messengerWindow"/>
    <NC:persist resource="chrome://messenger/content/messenger.xul#threadOutliner"/>
  </RDF:Description>
  <RDF:Description about="chrome://messenger/content/messenger.xul#flaggedCol"
                   hidden="true" />
  <RDF:Description about="chrome://messenger/content/messenger.xul#messengerWindow"
                   screenX="4"
                   screenY="4"
                   width="800"
                   height="565" />
  <RDF:Description about="chrome://messenger/content/mail3PaneWindowVertLayout.xul#unreadCol"
                   hidden="true" />
  <RDF:Description about="chrome://messenger/content/mail3PaneWindowVertLayout.xul#statusCol"
                   hidden="true" />
  <RDF:Description about="chrome://navigator/content/navigator.xul#PersonalToolbar"
                   hidden="true" />
  <RDF:Description about="chrome://messenger/content/messenger.xul#statusCol"
                   hidden="true" />
  <RDF:Description about="chrome://navigator/content/navigator.xul#sidebar-box"
                   hidden="true" />
  <RDF:Description about="chrome://messenger/content/messenger.xul#unreadCol"
                   hidden="true" />
  <RDF:Description about="chrome://messenger/content/mail3PaneWindowVertLayout.xul#OrderReceivedColumn"
                   hidden="true" />
  <RDF:Description about="chrome://messenger/content/mail3PaneWindowVertLayout.xul#flaggedCol"
                   hidden="true" />
  <RDF:Description about="chrome://navigator/content/navigator.xul#main-window"
                   screenX="0"
                   screenY="0"
                   sizemode="normal"
                   width="1010"
                   height="787" />
  <RDF:Description about="chrome://messenger/content/addressbook/addressbook.xul">
    <NC:persist resource="chrome://messenger/content/addressbook/addressbook.xul#abResultsOutliner"/>
  </RDF:Description>
  <RDF:Description about="chrome://messenger/content/messenger.xul#OrderReceivedColumn"
                   hidden="true" />
  <RDF:Description about="chrome://navigator/content/navigator.xul">
    <NC:persist resource="chrome://navigator/content/navigator.xul#sidebar-panels"/>
    <NC:persist resource="chrome://navigator/content/navigator.xul#sidebar-box"/>
    <NC:persist resource="chrome://navigator/content/navigator.xul#sidebar-splitter"/>
    <NC:persist resource="chrome://navigator/content/navigator.xul#main-window"/>
    <NC:persist resource="chrome://navigator/content/navigator.xul#nav-bar"/>
    <NC:persist resource="chrome://navigator/content/navigator.xul#cmd_viewnavbar"/>
    <NC:persist resource="chrome://navigator/content/navigator.xul#PersonalToolbar"/>
    <NC:persist resource="chrome://navigator/content/navigator.xul#cmd_viewpersonaltoolbar"/>
    <NC:persist resource="chrome://navigator/content/navigator.xul#status-bar"/>
    <NC:persist resource="chrome://navigator/content/navigator.xul#cmd_viewtaskbar"/>
  </RDF:Description>
  <RDF:Description about="chrome://messenger/content/addressbook/addressbook.xul#abResultsOutliner"
                   height="94" />
  <RDF:Description about="chrome://navigator/content/navigator.xul#cmd_viewpersonaltoolbar"
                   checked="false" />
</RDF:RDF>
EOF
fi


# Start mozilla with GOsa profile
mozilla -P gosa

