[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/ -> firefox-profile.php (source)

   1  <?php
   2  
   3  
   4  /**
   5     
   6     * Page du menu  
   7     * @Version $Id: firefox-profile.php 8578 2015-03-15 17:29:47Z plouf $ 
   8     
   9     * @Projet LCS / SambaEdu 
  10     
  11     * @auteurs 
  12  
  13     * @Licence Distribue selon les termes de la licence GPL
  14     
  15     * @note 
  16     
  17     */
  18  
  19     /**
  20  
  21     * @Repertoire: /
  22     * file: fireox-profile.php
  23     */
  24  
  25  
  26  include  "ldap.inc.php";
  27          
  28  // Ajout traitement HTMLPurifier
  29  require_once  ("traitement_data.inc.php");  
  30          
  31          $computername=isset($_GET['computername']) ? $_GET['computername'] : "";
  32          $username=isset($_GET['username']) ? $_GET['username'] : "";
  33          $userdomain=isset($_GET['userdomain']) ? $_GET['userdomain'] : "";
  34  
  35      $PathProfileJs = "/var/se3/unattended/install/packages/firefox/firefox-profile.js";
  36      $PathProfileSe3Js = "/var/se3/unattended/install/packages/firefox/firefox-profile-se3.js";
  37      $filename = basename ($PathProfileJs);
  38      if (file_exists($PathProfileSe3Js) ) {
  39          $DateFichier = gmdate("D, d M Y H:i:s T", filemtime("$PathProfileSe3Js"));
  40      } else {
  41          $DateFichier = gmdate("D, d M Y H:i:s T", filemtime("$PathProfileJs"));
  42      }
  43      header("Content-type: application/x-javascript");
  44      header("Last-Modified: $DateFichier");
  45      header("Expires: " . gmdate("D, d M Y H:i:s T", time() + 5));
  46      header("Pragma: no-cache");
  47      header("Cache-Control: max-age=5, s-maxage=5, no-cache, must-revalidate");
  48      header("Content-Disposition: inline; filename=$filename");
  49      echo "//BEGIN CE prefs\r\n";
  50      echo "\r\n";
  51      echo "try {\r\n";
  52      if ( isset($computername) ) {
  53          echo "  computername = '$computername';\r\n";
  54          $parc = search_parcs ($computername);
  55          $nParc = count( $parc);
  56          echo "  parcs = ',";
  57          for ($i=0; $i<$nParc; $i++) {
  58              echo $parc[$i]["cn"] . "," ;
  59          }
  60          echo "';\r\n";
  61      }
  62      if ( isset($username) ) {
  63          echo "  username = '$username';\r\n";
  64          $filtre = "(|(memberUid=".$username.")(member=uid=".$username.",".$dn['people']."))";
  65          $userGroups = search_groups ( $filtre );
  66          $nGroups = count( $userGroups);
  67          echo "  userGroups = ',";
  68          for ($i=0; $i<$nGroups; $i++) {
  69              echo $userGroups[$i]["cn"] . "," ;
  70          }
  71          echo "';\r\n";
  72      }
  73      if ( isset($userdomain) ) {
  74          echo "  userdomain = '$userdomain';\r\n";
  75      }
  76      echo "} catch(e) {\r\n";
  77      echo "  displayError('firefox-profile.php', e);\r\n";
  78      echo "}\r\n";
  79      echo "\r\n";
  80      readfile("$PathProfileJs");
  81      if (file_exists($PathProfileSe3Js) && isset($computername) && isset($username)  && isset($userdomain) ) {
  82          // Ajout du parametrage defini par l'interface web du se3
  83          readfile("$PathProfileSe3Js");
  84      }
  85  ?>


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1