2007-12-12 08:36:32 -06:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Automatically set browser preferences</title>
|
2011-08-05 07:58:02 -05:00
|
|
|
<style type="text/css">
|
|
|
|
body {
|
|
|
|
font-family:"Liberation Sans",Arial,Sans;
|
|
|
|
font-size:11px;
|
|
|
|
}
|
|
|
|
.textblock {
|
|
|
|
text-align: left;
|
|
|
|
margin-top: 1.0em;
|
|
|
|
font-size: 1.1em;
|
|
|
|
}
|
|
|
|
a {
|
|
|
|
color: #1D85D5;
|
|
|
|
font-weight: normal;
|
|
|
|
text-decoration: none;
|
|
|
|
text-transform: none;
|
|
|
|
}
|
|
|
|
</style>
|
2007-12-12 08:36:32 -06:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<form action="undefined" method="get">
|
2011-08-16 13:58:19 -05:00
|
|
|
<input id="button" type=button onclick="setPreferences()" name="prefs" value="Configure Firefox">
|
|
|
|
<div id="success" class="textblock" style="display: none;">
|
2011-08-05 07:58:02 -05:00
|
|
|
<p>Browser configured.</p>
|
|
|
|
<p>
|
|
|
|
<a href="/ipa/ui" id="redirect_link" target="_top">Click here to return to the Web UI.</a>
|
|
|
|
</p>
|
|
|
|
</div>
|
2007-12-12 08:36:32 -06:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2011-02-17 10:51:03 -06:00
|
|
|
function setPreferences() {
|
2012-05-25 08:55:13 -05:00
|
|
|
var privilege, setIntPref, setCharPref, setBoolPref;
|
|
|
|
|
2011-02-17 10:51:03 -06:00
|
|
|
if (typeof navigator.preference == 'undefined') {
|
|
|
|
// From Firefox 4 and SeaMonkey 2.1, navigator.preference intefrace is dropped
|
|
|
|
// Use new Gecko2 Services.jsm JavaScript code module instead.
|
2012-05-25 08:55:13 -05:00
|
|
|
privilege = 'UniversalXPConnect';
|
2011-02-17 10:51:03 -06:00
|
|
|
netscape.security.PrivilegeManager.enablePrivilege(privilege);
|
|
|
|
Components.utils.import("resource://gre/modules/Services.jsm");
|
2012-05-25 08:55:13 -05:00
|
|
|
|
|
|
|
setIntPref = function(par, val) {Services.prefs.setIntPref(par, val)};
|
|
|
|
setCharPref = function(par, val) {Services.prefs.setCharPref(par, val)};
|
|
|
|
setBoolPref = function(par, val) {Services.prefs.setBoolPref(par, val)};
|
2011-02-17 10:51:03 -06:00
|
|
|
} else {
|
2012-05-25 08:55:13 -05:00
|
|
|
privilege = 'UniversalPreferencesWrite';
|
2011-02-17 10:51:03 -06:00
|
|
|
netscape.security.PrivilegeManager.enablePrivilege(privilege);
|
2012-05-25 08:55:13 -05:00
|
|
|
setCharPref = function(par, val) {navigator.preference(par, val)};
|
|
|
|
setBoolPref = setCharPref; // same function for bool and char and int
|
|
|
|
setIntPref = setCharPref;
|
2011-02-17 10:51:03 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
2007-12-12 08:36:32 -06:00
|
|
|
try {
|
2012-05-25 08:55:13 -05:00
|
|
|
setIntPref('network.http.sendRefererHeader', 2);
|
|
|
|
setBoolPref('network.negotiate-auth.using-native-gsslib', true);
|
|
|
|
setCharPref('network.negotiate-auth.trusted-uris', '.$DOMAIN');
|
|
|
|
setBoolPref('network.negotiate-auth.allow-proxies', true);
|
2007-12-12 08:36:32 -06:00
|
|
|
} catch (e) {
|
2011-02-17 10:51:03 -06:00
|
|
|
alert("Unable to store preferences: " + e);
|
|
|
|
return;
|
2007-12-12 08:36:32 -06:00
|
|
|
}
|
2011-02-17 10:51:03 -06:00
|
|
|
|
|
|
|
netscape.security.PrivilegeManager.disablePrivilege(privilege);
|
|
|
|
|
|
|
|
alert("Successfully configured Firefox for single sign-on.");
|
2011-08-05 07:58:02 -05:00
|
|
|
|
|
|
|
var redirect_link = document.getElementById('redirect_link');
|
|
|
|
redirect_link.href = "https://" + location.hostname + location.port + "/ipa/ui";
|
|
|
|
|
2011-08-16 13:58:19 -05:00
|
|
|
var button = document.getElementById('button');
|
|
|
|
button.style['display'] = "none";
|
|
|
|
|
2011-08-05 07:58:02 -05:00
|
|
|
var successDiv = document.getElementById('success');
|
|
|
|
successDiv.style['display'] = "block";
|
2007-12-12 08:36:32 -06:00
|
|
|
} catch (e) {
|
2011-02-17 10:51:03 -06:00
|
|
|
alert("Unable to apply recommended settings.\n\n" +
|
|
|
|
"Click on the Certificate Authority link and select trust for all, " +
|
|
|
|
"then reload this page and try again.\n\nThe error returned was: " + e);
|
2007-12-12 08:36:32 -06:00
|
|
|
return;
|
2011-02-17 10:51:03 -06:00
|
|
|
}
|
2007-12-12 08:36:32 -06:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|