Récupérer la page d'accueil depuis LDAP, et contourne le réglage par défaut

tags/0.2.15
Daniel Berteaud 12 years ago
parent 8618a4bc34
commit 217195fd3e
  1. 15
      root/usr/share/mozilla-mcd/firefox.php

@ -29,6 +29,10 @@ if(isset($_SERVER['QUERY_STRING']) && preg_match('/^.+@' . DOMAIN . '$/', $_SERV
break; break;
} }
} }
$url = HOME_URL;
if (preg_match('/^https?:\/\//', $user[0]['labeleduri'][0]))
$url = $user[0]['labeleduri'][0];
} }
else { else {
exit; exit;
@ -49,13 +53,14 @@ else {
// Home page // Home page
<?php <?php
if ($pref == 'lockPref'){ if ($pref == 'defaultPref'){
// Bug somewhere: defaultPref doesn't set the home page // startup.homepage is a complex setting.
// only lockPref works // see http://mike.kaply.com/2012/08/29/setting-the-default-firefox-homepage-with-autoconfig/
echo 'lockPref("browser.startup.homepage", "'.HOME_URL.'");'."\n"; $url = 'data:text/plain,browser.startup.homepage='.$url;
echo 'lockPref("browser.startup.page", 1);'."\n";
} }
?> ?>
<?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_override_url", "");
<?php echo $pref;?>("startup.homepage_welcome_url", ""); <?php echo $pref;?>("startup.homepage_welcome_url", "");

Loading…
Cancel
Save