[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/annu/ -> groups_list.php (source)

   1  <?php
   2  
   3  
   4     /**
   5     
   6     * Affiche les groupes a partir de l'annuaires
   7     * @Version $Id: groups_list.php 6176 2011-02-27 23:00:23Z dbo $ 
   8     
   9     * @Projet LCS / SambaEdu 
  10     
  11     * @auteurs jLCF jean-luc.chretien@tice.ac-caen.fr
  12     * @auteurs oluve olivier.le_monnier@crdp.ac-caen.fr
  13     * @auteurs wawa  olivier.lecluse@crdp.ac-caen.fr
  14     * @auteurs Equipe Tice academie de Caen
  15  
  16     * @Licence Distribue selon les termes de la licence GPL
  17     
  18     * @note 
  19     */
  20  
  21     /**
  22  
  23     * @Repertoire: annu
  24     * file: groups_list.php
  25     */
  26  
  27  
  28  
  29  
  30  include  "entete.inc.php";
  31  include  "ldap.inc.php";
  32  include  "ihm.inc.php";
  33  
  34  require_once  ("lang.inc.php");
  35  bindtextdomain('se3-annu',"/var/www/se3/locale");
  36  textdomain ('se3-annu');
  37  
  38  
  39  $group=$_POST['group'];
  40  $priority_group=$_POST['priority_group'];
  41  
  42  echo "<h1>".gettext("Annuaire")."</h1>\n";
  43  $_SESSION["pageaide"]="Annuaire";
  44  
  45  if ((ldap_get_right("Annu_is_admin",$login)=="Y") || (ldap_get_right("Annu_can_read",$login)=="Y") || (ldap_get_right("se3_is_admin",$login)=="Y")) {
  46  
  47      aff_trailer ("3");
  48  
  49      if (!$group) {
  50          $filter = "(cn=*)";
  51      } else {
  52          if ($priority_group == "contient") {
  53                    $filter = "(cn=*$group*)";
  54              } elseif ($priority_group == "commence") {
  55                    $filter = "(|(cn=Classe_$group*)(cn=Cours_$group*)(cn=Equipe_$group*)(cn=Matiere_$group*)(cn=$group*))";
  56              } else {
  57                    // $priority_group == "finit"
  58                    $filter = "(|(cn=Classe_*$group)(cn=Cours_*$group)(cn=Equipe_*$group)(cn=Matiere_*$group)(cn=*$group))";
  59              }
  60      }
  61  
  62      // Remplacement *** ou ** par *
  63      $filter=preg_replace("/\*\*\*/","*",$filter);
  64      $filter=preg_replace("/\*\*/","*",$filter);
  65      
  66      #$TimeStamp_0=microtime();
  67      $groups=search_groups($filter);
  68      #$TimeStamp_1=microtime();
  69        #############
  70        # DEBUG     #
  71        #############
  72        #echo "<u>debug</u> :Temps de recherche = ".duree($TimeStamp_0,$TimeStamp_1)."&nbsp;s<BR>";
  73        #############
  74        # Fin DEBUG #
  75        #############
  76      // affichage de la liste des groupes trouves
  77      if (count($groups)) {
  78          if (count($groups)==1) {
  79          echo "<p><STRONG>".count($groups)."</STRONG>".gettext(" groupe r&#233;pond &#224; ces crit&#232;res de recherche")."</p>\n";
  80          } else {
  81                echo "<p><STRONG>".count($groups)."</STRONG>".gettext(" groupes r&#233;pondent &#224; ces crit&#232;res de recherche")."</p>\n";
  82          }
  83          echo "<UL>\n";
  84          for ($loop=0; $loop < count($groups); $loop++) {
  85                echo "<LI><A href=\"group.php?filter=".$groups[$loop]["cn"]."\">";
  86                if ($groups[$loop]["type"]=="posixGroup")
  87                   echo "<STRONG>".$groups[$loop]["cn"]."</STRONG>";
  88                else
  89                  echo $groups[$loop]["cn"];
  90                    echo "</A>&nbsp;&nbsp;&nbsp;<font size=\"-2\">".$groups[$loop]["description"]."</font></LI>\n";
  91              }
  92              echo "</UL>\n";
  93      } else {
  94              echo "<STRONG>".gettext("Pas de r&#233;sultats")."</STRONG> ".gettext("correspondant aux crit&#232;res s&#233;lectionn&#233;s.")."<BR>";
  95      }
  96    
  97  } 
  98      
  99  
 100  include ("pdp.inc.php");
 101  ?>


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