コード例 #1
0
ファイル: affichageleve.php プロジェクト: rhertzog/lcs
}
elseif (!verifDescription($description)) {
    echo "<div class=error_msg>".gettext("Le champ description comporte des caract&#233;res interdits !")."</div><br>\n";
    exit();
}
elseif (!verifIntituleGrp($intitule)) {
    echo "<div class=error_msg>".gettext("Le champ intitul&#233; ne doit pas commencer ou se terminer par l'expresssion : Classe, Equipe ou Matiere !")."</div><br>\n";
    exit();
}
elseif ( $filter=="") {
    echo "<div class=error_msg>".gettext("Vous devez s&#233;lectionner au moins un groupe!")."</div><br>\n";
    exit();
}

// Verification de l'existance du groupe
$groups=search_groups("(cn=$cn)");
if (count($groups)) {
echo "<div class='error_msg'>".gettext("Attention le groupe <font color='#0080ff'>$cn</font> est d&#233;ja pr&#233;sent dans la base, veuillez choisir un autre nom !")."</div><BR>\n";
exit();
}
else {

// Ajout du groupe

$intitule = enleveaccents($intitule);

exec ("$scriptsbinpath/groupAdd.pl '1' ". escapeshellarg($cn) ." ". escapeshellarg($description),$AllOutPut,$ReturnValue);
if ($ReturnValue == "0") {
echo "<div class=error_msg>".gettext("Le groupe <font color='#0080ff'>$cn</font> a &#233;t&#233; ajout&#233; avec succ&#232;s.")."</div><br>\n";
	}
else {echo "<div class=error_msg>".gettext("Echec, le groupe <font color='#0080ff'>$cn</font> n'a pas &#233;t&#233; cr&#233;&#233; !")."\n";
コード例 #2
0
ファイル: group.php プロジェクト: rhertzog/lcs
  include "../lcs/includes/headerauth.inc.php";
  include "includes/ldap.inc.php";
  include "includes/ihm.inc.php";

  if (count($_GET)>0) {
  	//configuration objet
 	include ("../lcs/includes/htmlpurifier/library/HTMLPurifier.auto.php");
 	$config = HTMLPurifier_Config::createDefault();
 	$purifier = new HTMLPurifier($config);
    //purification des variables
 	$filter=filter_var($purifier->purify($_GET['filter']),FILTER_SANITIZE_STRING);
  }
  header_html();
  aff_trailer ("3");
  #$TimeStamp_0=microtime();
  $group=search_groups("cn=".$filter);
  $uids = search_uids ("(cn=".$filter.")", "half");
  $people = search_people_groups ($uids,"(sn=*)","cat");
  #$TimeStamp_1=microtime();
  #############
  # DEBUG     #
  #############
  #echo "<u>debug</u> :Temps de recherche = ".duree($TimeStamp_0,$TimeStamp_1)."&nbsp;s<BR><BR>";
  #############
  # Fin DEBUG #
  #############
  if (count($people)) {
    // affichage des resultats
    // Nettoyage des _ dans l'intitule du groupe
    $intitule =  strtr($filter,"_"," ");
    echo "<U>Groupe</U> : $intitule <font size=\"-2\">".$group[0]["description"]."</font><BR>\n";
コード例 #3
0
ファイル: mod_group_descrip.php プロジェクト: rhertzog/lcs
 	include ("../lcs/includes/htmlpurifier/library/HTMLPurifier.auto.php");
 	$config = HTMLPurifier_Config::createDefault();
 	$purifier = new HTMLPurifier($config);
    //purification des variables
    if (isset($_POST['cn']))  $cn=$purifier->purify($_POST['cn']);
    elseif (isset($_GET['cn'])) $cn=$purifier->purify($_GET['cn']);
            if (count($_POST)>0 ) {
            $description=$purifier->purify($_POST['description']);
            $mod_descrip=$purifier->purify($_POST['mod_descrip']);
            }
}

  header_html();
  aff_trailer ("3");
  if (is_admin("Annu_is_admin",$login)=="Y") {
    $group=search_groups("cn=".$cn);
    if (
         (!isset($mod_descrip)) ||  ( isset($mod_descrip) && (!isset($description) || !verifDescription($description)) )
       ) {
      echo "Modification de la description du groupe : <b>".$group[0]["cn"]."</b>\n";
      ?>
      <form action="mod_group_descrip.php" method="post">
        <table border="0" width="90%" align="center">
          <tbody>
	    <tr>
	      <td>Description :</td>
	      <td width="73%" colspan="2"><input type="text" name="description" value="<?php echo $group[0]["description"] ?>" size="60"></td>
	      <td></td>
	    </tr>
	      <td align="left">
                 <input name="jeton" type="hidden"  value="<?php echo md5($_SESSION['token'].htmlentities($_SERVER['PHP_SELF'])); ?>" />
コード例 #4
0
ファイル: init_users_lcs.php プロジェクト: rhertzog/lcs
                }
            }
            del_user_in_classe($idp_partis[$loop]);
        }
    } else {
        echo '<script type="text/javascript" language="JavaScript">
				 document.getElementById("cr3").innerHTML = "  aucun prof supprim&#233;" ;
				 </script>';
    }
    /*=====================================================================
    affectations aux classes
     =====================================================================*/
    $mess = "";
    $filtre = "Classe*";
    //recherche des groupes
    $groups = search_groups('cn=' . $filtre);
    $groups[count($groups)]["cn"] = "Profs";
    $cpt = 0;
    $cpt2 = 0;
    $cpt3 = 0;
    if (count($groups)) {
        for ($loup = 0; $loup < count($groups); $loup++) {
            $grp = $groups[$loup]["cn"];
            $db = @mysql_connect($dbHost, $dbLogin, $dbPass, false, CLIENT_FOUND_ROWS) or die('<center>' . 'WARNING ! SYSTEM UNABLE TO CONNECT TO THE DATABASE SERVER.' . '</center>');
            //recuperation de l'id du groupe
            $Sql = "SELECT id FROM cl_class WHERE name='{$grp}'";
            $res = @mysql_query($Sql) or die(mysql_error());
            $tst = mysql_fetch_array($res, MYSQL_NUM);
            if (mysql_num_rows($res) > 0) {
                $id_grp = $tst[0];
            }
コード例 #5
0
ファイル: details.php プロジェクト: psyray/mmc
<script>
'use strict';

angular.module('mmc.samba.perms', [])

.controller('permsCtrl', function($scope) {
    $scope.perms = <?php 
echo json_encode($perms);
?>
;
    var users = <?php 
echo json_encode(get_users_detailed($error, 'objectClass=sambaSamAccount', 0, 200000));
?>
;
    var groups = <?php 
echo json_encode(search_groups('*'));
?>
;
    // build a list of entities (users, groups)
    $scope.entities = groups.map(function(arr) {
        return {name: '@' + arr[0], label: arr[0]}
    });
    $scope.entities = $scope.entities.concat(users[1].map(function(obj) {
        var name = function() {
            if (obj.givenName && obj.sn && (obj.givenName != obj.sn))
                return obj.givenName + " " + obj.sn;
            else
                return obj.uid;
        };
        return {name: obj.uid, label: name()}
    }));
コード例 #6
0
require "../../../includes/config.inc.php";
require "../../../includes/i18n.inc.php";
require "../../../modules/base/includes/edit.inc.php";
require "../../../includes/acl.inc.php";
require "../../../includes/session.inc.php";
//require("../../../includes/CheckBoxGroup.php");
require "../../../modules/base/includes/users.inc.php";
require "../../../modules/base/includes/groups.inc.php";
$value = $_POST["value"];
if (isset($_GET["uid"]) and $_GET["uid"]) {
    $uid = $_GET["uid"];
} else {
    $uid = false;
    $primary = "";
}
$groups = search_groups($value);
if ($uid) {
    $primary = getUserPrimaryGroup($uid);
}
print '<ul>';
foreach ($groups as $items) {
    if ($items[0] != $primary) {
        ?>
 <li><?php 
        echo $items[0];
        ?>
<span class="informal"><br><?php 
        echo $items[1];
        ?>
</span></li>
    <?php 
コード例 #7
0
ファイル: publicFunc.php プロジェクト: pulse-project/pulse
/**
 * Form on user edit page
 * @param $FH FormHandler of the page
 * @param $mode add or edit mode
 */
function _base_baseEdit($FH, $mode)
{
    $uid = $FH->getArrayOrPostValue("uid");
    $f = new DivForModule(_("User attributes"), "#F4F4F4");
    $f->push(new Table());
    if ($mode == "add") {
        $loginTpl = new InputTpl("uid", '/^[a-zA-Z0-9][A-Za-z0-9_.\\-]*$/');
    } else {
        $loginTpl = new HiddenTpl("uid");
    }
    $f->add(new TrFormElement(_("Login") . "*", $loginTpl), array("value" => $uid));
    /*if($mode == "edit") {
          $lastlog = get_last_log_user($uid);
          if ($lastlog[0] != 0) {
          	$f->add(
          	    new LinkTrFormElement(_("Last action"), new HiddenTpl("lastaction")),
                  array("value" => urlStr("base/users/loguser", array("user" => $uid)), "name" => $lastlog[1][0]["date"])
              );
          }
      }*/
    $f->add(new TrFormElement(_("Password") . "*", new PasswordTpl("pass")), array("value" => ""));
    $f->add(new TrFormElement(_("Confirm password") . "*", new PasswordTpl("confpass")), array("value" => ""));
    $f->add(new TrFormElement(_("Photo"), new ImageTpl("jpegPhoto")), array("value" => $FH->getArrayOrPostValue("jpegPhoto"), "action" => $mode));
    $f->add(new TrFormElement(_("Last name") . "*", new InputTpl("sn")), array("value" => $FH->getArrayOrPostValue("sn")));
    $f->add(new TrFormElement(_("First name") . "*", new InputTpl("givenName")), array("value" => $FH->getArrayOrPostValue("givenName")));
    $f->add(new TrFormElement(_("Title") . "*", new InputTpl("title")), array("value" => $FH->getArrayOrPostValue("title")));
    $f->add(new TrFormElement(_("Email address"), new MailInputTpl("mail")), array("value" => $FH->getArrayOrPostValue("mail")));
    $f->pop();
    $phoneregexp = "/^[a-zA-Z0-9(/ +\\-]*\$/";
    $tn = new MultipleInputTpl("telephoneNumber", _("Telephone number"));
    $tn->setRegexp($phoneregexp);
    $f->add(new FormElement(_("Telephone number"), $tn), $FH->getArrayOrPostValue("telephoneNumber", "array"));
    $f->push(new Table());
    $f->add(new TrFormElement(_("Mobile number"), new InputTpl("mobile", $phoneregexp)), array("value" => $FH->getArrayOrPostValue("mobile")));
    $f->add(new TrFormElement(_("Fax number"), new InputTpl("facsimileTelephoneNumber", $phoneregexp)), array("value" => $FH->getArrayOrPostValue("facsimileTelephoneNumber")));
    $f->add(new TrFormElement(_("Home phone number"), new InputTpl("homePhone", $phoneregexp)), array("value" => $FH->getArrayOrPostValue("homePhone")));
    $languages = new SelectItem("preferredLanguage");
    $labels = array(_("Choose language")) + array_values(getLanguages());
    $values = array("") + array_keys(getLanguages());
    $languages->setElements($labels);
    $languages->setElementsVal($values);
    $f->add(new TrFormElement(_("Preferred language"), $languages), array("value" => $FH->getArrayOrPostValue("preferredLanguage")));
    $checked = "checked";
    if ($FH->getArrayOrPostValue("loginShell") != '/bin/false') {
        $checked = "";
    }
    $f->add(new TrFormElement(_("Disable user's shell"), new CheckboxTpl("isBaseDesactive"), array("tooltip" => _("A disabled user can't log in any UNIX services.<br/>\n                                  His login shell command is replaced by /bin/false"))), array("value" => $checked));
    /* Primary group */
    $groupsTpl = new SelectItem("primary");
    $all_groups = search_groups();
    $groups = array();
    foreach ($all_groups as $key => $infos) {
        $groups[] = $infos[0];
    }
    $groupsTpl->setElements($groups);
    if ($mode == "add") {
        $primary = getUserDefaultPrimaryGroup();
    } else {
        if ($mode == "edit") {
            /* In case of error, display the POST values */
            if ($FH->isUpdated("primary")) {
                $primary = $FH->getValue("primary");
            } else {
                $primary = getUserPrimaryGroup($uid);
                /* If the group is not an LDAP group */
                if (!in_array($primary, $groups)) {
                    $primaryGroups = $groups;
                    $primaryGroups[] = $primary;
                    $groupsTpl->setElements($primaryGroups);
                }
            }
        }
    }
    $f->add(new TrFormElement(_("Primary group"), $groupsTpl), array("value" => $primary));
    /* Secondary groups */
    $groupsTpl = new MembersTpl("secondary");
    $groupsTpl->setTitle(_("User's groups"), _("All groups"));
    // get the user's groups
    /* In case of error, display the POST values */
    if ($FH->getPostValue("secondary")) {
        $user_groups = $FH->getPostValue("secondary");
    } else {
        if ($mode == 'edit') {
            $user_groups = getUserSecondaryGroups($uid);
        } else {
            $user_groups = array();
        }
    }
    $member = array();
    foreach ($user_groups as $group) {
        $member[$group] = $group;
    }
    // get all groups
    $available = array();
    foreach ($groups as $group) {
        if (!in_array($group, $member)) {
            $available[$group] = $group;
        }
    }
    $f->add(new TrFormElement(_("Secondary groups"), $groupsTpl), array("member" => $member, "available" => $available));
    $f->pop();
    $f->push(new DivExpertMode());
    $f->push(new Table());
    $f->add(new TrFormElement(_("Home directory"), new InputTpl("homeDirectory")), array("value" => $FH->getArrayOrPostValue("homeDirectory")));
    if ($mode == "add") {
        $f->add(new TrFormElement(_("Create home directory on filesystem"), new CheckboxTpl("createHomeDir")), array("value" => "checked"));
        $f->add(new TrFormElement(_("Force to use the home directory if it exists"), new CheckboxTpl("ownHomeDir"), array("tooltip" => _("Warning: an existing directory may belong to another user !"))), array("value" => ""));
    }
    $f->add(new TrFormElement(_("Login shell"), new InputTpl("loginShell")), array("value" => $FH->getArrayOrPostValue("loginShell")));
    $f->add(new TrFormElement(_("Common name"), new InputTpl("cn"), array("tooltip" => _("This field is used by some LDAP clients (for example Thunderbird address book) to display user entries."))), array("value" => $FH->getArrayOrPostValue("cn")));
    $f->add(new TrFormElement(_("Preferred name to be used"), new InputTpl("displayName"), array("tooltip" => _("This field is used by SAMBA (and other LDAP clients) to display user name."))), array("value" => $FH->getArrayOrPostValue("displayName")));
    if ($mode == "edit") {
        $f->add(new TrFormElement(_("UID"), new HiddenTpl("uidNumber")), array("value" => $FH->getArrayOrPostValue("uidNumber")));
        $f->add(new TrFormElement(_("GID"), new HiddenTpl("gidNumber")), array("value" => $FH->getArrayOrPostValue("gidNumber")));
    }
    $f->pop();
    $f->pop();
    return $f;
}
コード例 #8
0
ファイル: grouplist.php プロジェクト: rhertzog/lcs
include "includes/ldap.inc.php";
include "includes/ihm.inc.php";

header_html();

if (count($_GET)>0) {
	//configuration objet
 	include ("../lcs/includes/htmlpurifier/library/HTMLPurifier.auto.php");
 	$config = HTMLPurifier_Config::createDefault();
 	$purifier = new HTMLPurifier($config);
    //purification des variables
  	$filter=$purifier->purify($_GET['filter']);
}

if ((is_admin("Annu_is_admin",$login)=="Y") || (is_admin("sovajon_is_admin",$login)=="Y")) {
	$group=search_groups ("(cn=".$filter.")");
	$uids = search_uids ("(cn=".$filter.")", "half");
	$people = search_people_groups ($uids,"(sn=*)","cat");
	if (count($people)) {
		// affichage des resultats
		// Nettoyage des _ dans l'intitule du groupe
		$intitule =  strtr($filter,"_"," ");
		echo "<h1><u>".gettext("Groupe")."</u> : $intitule <font size=\"-2\">".$group[0]["description"]."</font></h1>\n";
		echo gettext("Il y a ").count($people).gettext(" membre");
		if ( count($people) >1 ) echo "s";
		echo gettext(" dans ce groupe")."<br />\n";
		echo "<table border=1><tr><td align=Center>Nom</td><td align=Center>login</td><td align=Center>".gettext("Date naiss")."</td></tr>\n";
		for ($loop=0; $loop < count($people); $loop++) {
			echo "<tr><td>\n";
			if (($people[$loop]["cat"] == "Equipe") or ($people[$loop]["prof"]==1)) {
				echo "<img src=\"images/gender_teacher.gif\" alt=\"Professeur\" width=18 height=18 hspace=1 border=0>\n";
コード例 #9
0
ファイル: flux_rss.php プロジェクト: rhertzog/lcs
                    //nom du prof
                    $mat[$loop] = $enrg[1];
                    //matiere
                    $numero[$loop] = $enrg[2];
                    //numero de l'onglet
                    $pref[$loop] = $enrg[3];
                    // prefixe
                    $loop++;
                }
            }
        }
    }
} else {
    //recherche des onglets "Cours" de la classe
    if (!mb_ereg("^Classe", $ch)) {
        $grp_cl = search_groups("cn=Classe_*" . $ch);
        $grp_cl = $grp_cl[0]["cn"];
    } else {
        $grp_cl = $ch;
    }
    $uids = search_uids("(cn=" . $grp_cl . ")", "half");
    $liste_cours = array();
    $i = 0;
    for ($loup = 0; $loup < count($uids); $loup++) {
        $logun = $uids[$loup]["uid"];
        if (is_eleve($logun)) {
            $groops = people_get_cours($logun);
            if (count($groops)) {
                for ($n = 0; $n < count($groops); $n++) {
                    if (!in_array($groops[$n]["cn"], $liste_cours)) {
                        $liste_cours[$i] = $groops[$n]["cn"];
コード例 #10
0
ファイル: fichier_classes.php プロジェクト: rhertzog/lcs
        $i++;
        fputs($fichier, "\$cren_off[{$i}]=\"S5\";\n");
        $i++;
    } elseif (in_array("S5", $crenoff)) {
        fputs($fichier, "\$cren_off[{$i}]=\"S5\";\n");
    }
    fputs($fichier, " ?>\n");
    fclose($fichier);
    exec("/usr/bin/sudo /usr/share/lcs/scripts/chaccess_cdt.sh NoWritable creneau");
}
/******************
* test de la coherence *
*******************/
if (isset($_POST['test'])) {
    //recherche des groupes classes
    $groups = search_groups('cn=classe*');
    //Pour chaque classe, recherche d'une occurence unique dans l'annuaire
    include "../Includes/data.inc.php";
    //initialisation des variables
    $index = 0;
    $error = array();
    //recherche d'occurence pour chaque classe
    for ($n = 0; $n < count($classe); $n++) {
        $occ = 0;
        for ($loop = 0; $loop < count($groups); $loop++) {
            if (mb_ereg("(_{$classe[$n]})\$", $groups[$loop]["cn"]) || $classe[$n] == $groups[$loop]["cn"]) {
                $occ++;
            }
        }
        //si le nb d'occurence est <> de 1, -->probl�me
        if ($occ != 1) {
コード例 #11
0
ファイル: user-ldap.php プロジェクト: rhertzog/lcs
function get_users_in_my_groups()
{
    global $ldap_server, $ldap_port, $dn, $login, $DEBUG, $MsgD;
    $count = 0;
    $i = 0;
    $group_principal = "NUL_group";
    // Recherche des groupes d'appartenance de l'utilisateur $login
    list($user, $groups) = people_get_variables($login, true);
    ### DEBUG
    if ($DEBUG) {
        for ($loop = 0; $loop < count($groups); $loop++) {
            echo "{$MsgD} liste des groupes : " . $groups[$loop]["cn"] . "<br>";
        }
    }
    // Recherche du groupe principal et des groupes secondaires de l'utilisateur
    for ($loop = 0; $loop < count($groups); $loop++) {
        if ($groups[$loop]["cn"] == "Administratifs") {
            $group_principal = "Administratifs";
        } elseif ($groups[$loop]["cn"] == "Profs") {
            $group_principal = "Profs";
        } elseif ($groups[$loop]["cn"] == "Eleves") {
            $group_principal = "Eleves";
        } elseif (!ereg("Administratifs", $groups[$loop]["cn"]) && !ereg("Profs", $groups[$loop]["cn"]) && !ereg("Eleves", $groups[$loop]["cn"]) && !ereg("Cours", $groups[$loop]["cn"]) && !ereg("Matiere", $groups[$loop]["cn"])) {
            $groups_secondaires[$i] = $groups[$loop]["cn"];
            $i++;
            if (ereg("Classe", $groups[$loop]["cn"])) {
                $groups_secondaires[$i] = ereg_replace("Classe_", "Equipe_", $groups[$loop]["cn"]);
                $i++;
            }
            if (ereg("Equipe", $groups[$loop]["cn"])) {
                $groups_secondaires[$i] = ereg_replace("Equipe_", "Classe_", $groups[$loop]["cn"]);
                $i++;
            }
        }
    }
    ### DEBUG
    if ($DEBUG) {
        echo "{$MsgD} group_principal : {$group_principal}<br>";
        echo "{$MsgD} nbr groupes secondaires : " . count($groups_secondaires) . "<br>";
        for ($loop = 0; $loop < count($groups_secondaires); $loop++) {
            echo "{$MsgD} groups_secondaires : " . $groups_secondaires[$loop] . "<br>";
        }
    }
    if ($group_principal != "NUL_group") {
        // Recherche des uids des membres de ses groupes secondaires
        //echo $group_principal;exit;
        //modif
        $index = 0;
        if ($group_principal == "Administratifs" || $group_principal == "Profs") {
            $uids[$loop] = search_uids("(cn=Administratifs)", "half");
            $users_in_my_groups[$index] = search_people_groups($uids[$loop], "(sn=*)", "group");
            $index++;
            $uids[$loop] = search_uids("(cn=Profs)", "half");
            $users_in_my_groups[$index] = search_people_groups($uids[$loop], "(sn=*)", "group");
            $index++;
            //ajout de Equipes pour les administratisfs
            if ($group_principal == "Administratifs") {
                $groups_equipes = search_groups("cn=Equipe*");
                if (count($groups_equipes) != 0) {
                    for ($loop = 0; $loop < count($groups_equipes); $loop++) {
                        $uids[$loop] = search_uids("(cn=" . $groups_equipes[$loop]['cn'] . ")", "half");
                        $users_in_my_groups[$index] = search_people_groups($uids[$loop], "(sn=*)", "group");
                        $index++;
                    }
                }
            }
        }
        if (count($groups_secondaires) != 0) {
            for ($loop = 0; $loop < count($groups_secondaires); $loop++) {
                $uids[$loop] = search_uids("(cn=" . $groups_secondaires[$loop] . ")", "half");
                $users_in_my_groups[$index] = search_people_groups($uids[$loop], "(sn=*)", "group");
                $index++;
            }
        }
    } elseif ($group_principal == "Eleves" && count($groups_secondaires) == 0 || $group_principal == "NUL_group") {
        // Aaaaaaaaargh ! L'utilisateur est dans aucun groupe secondaire ou principal...
        // On retourne uniquement son fullname et celui d'admin
        if ($DEBUG) {
            echo "{$MsgD} Cas d'1 user ne possŽdant pas de groupes secondaires<br>";
        }
        $uids[0]["uid"] = "admin";
        $uids[1]["uid"] = $login;
        $users_in_my_groups[0] = search_people_groups($uids, "(sn=*)", "group");
    }
    // Transfert dans le tableau $ret
    for ($loop0 = 0; $loop0 < count($users_in_my_groups); $loop0++) {
        for ($loop = 0; $loop < count($users_in_my_groups[$loop0]); $loop++) {
            $ret[$count++] = array("cal_login" => $users_in_my_groups[$loop0][$loop]["uid"], "cal_fullname" => $users_in_my_groups[$loop0][$loop]["fullname"], "cal_group" => $users_in_my_groups[$loop0][$loop]["group"], "cal_cat" => $users_in_my_groups[$loop0][$loop]["cat"]);
        }
    }
    ### DEBUG
    if ($DEBUG) {
        for ($loop = 0; $loop < count($ret); $loop++) {
            echo "{$MsgD} : " . $ret[$loop]["cal_login"] . " " . $ret[$loop]["cal_fullname"] . " " . $ret[$loop]["cal_group"] . " " . $ret[$loop]["cal_cat"] . "<br>";
        }
    }
    ### FIN DEBUG
    return $ret;
}
コード例 #12
0
ファイル: ldap.inc.php プロジェクト: rhertzog/lcs
function tstclass($prof,$eleve)
{
  $filtre= "(&(memberUid=$prof)(memberUid=$eleve))";
  $grcomm=search_groups($filtre);
  $tstclass=0;
  if (count($grcomm)>0) {
        $i=0;
        while (($i< count($grcomm)) and ($tstclass==0)) {
                if (mb_ereg("Cours",$grcomm[$i]["cn"],$matche))
                        $tstclass=1;
                $i++;
        }
  }
  return $tstclass;
}
コード例 #13
0
ファイル: functions2.inc.php プロジェクト: rhertzog/lcs
function decripte_uid($uid_cripte, $saclasse)
{
    $uid_decrypte = array();
    $groups = search_groups('cn=classe*');
    if (count($groups)) {
        for ($loup = 0; $loup < count($groups); $loup++) {
            if (mb_ereg("(_{$saclasse})\$", $groups[$loup]["cn"]) || $saclasse == $groups[$loup]["cn"]) {
                $full_classe = $groups[$loup]["cn"];
                break;
            }
        }
    }
    $membres = search_uids("(cn=" . $full_classe . ")", "half");
    for ($iteration = 0; $iteration <= count($membres); $iteration++) {
        $uidgugus = $membres[$iteration]["uid"];
        if (substr(md5($uidgugus), 2, 5) . substr(md5($uidgugus), -5, 5) == $uid_cripte) {
            $uid_decrypte[0] = $membres[$iteration]["uid"];
            list($user, $groups) = people_get_variables($uidgugus, true);
            $uid_decrypte[1] = getprenom($user['fullname'], $user['nom']);
            $uid_decrypte[2] = $saclasse;
            break;
        }
    }
    return $uid_decrypte;
}
コード例 #14
0
ファイル: edit_share.php プロジェクト: sebastiendu/mmc
        $members[$member['user']['type'] . "##" . $member['user']['login']] = $member['user']['login'];
        $listOfMembers[$member['user']['login']] = $member;
    }
    if (!$members) {
        $members = array();
    }
    if (!$listOfMembers) {
        $listOfMembers = array();
    }
    list($count, $users) = get_users_detailed($error, '', 0, 10000);
    $listOfUsers = array();
    foreach ($users as $u) {
        $listOfUsers[$u['uid']] = array('user' => array('login' => $u['uid'], 'type' => 0));
    }
    $listOfUsers['root'] = array('user' => array('login' => 'root', 'type' => 0));
    $groups = search_groups('');
    foreach ($groups as $u) {
        $listOfUsers[$u[0]] = array('user' => array('login' => $u[0], 'type' => 1));
    }
    $nonmemb = array();
    foreach ($listOfUsers as $user) {
        $nonmemb[$user['user']['type'] . "##" . $user['user']['login']] = $user['user']['login'];
    }
}
ksort($members);
reset($members);
ksort($nonmemb);
$diff = array_diff_assoc($nonmemb, $members);
natcasesort($diff);
drawGroupShare($nonmemb, $members, $listOfMembers, $diff, $group->id, htmlspecialchars($name));
?>
コード例 #15
0
ファイル: ajaxFilter.php プロジェクト: sebastiendu/mmc
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/base/includes/groups.inc.php";
$filter = $_GET["filter"];
$groups = search_groups($filter);
$groupcount = count($groups);
$arrGroup = array();
$arrComment = array();
for ($idx = 0; $idx < count($groups); $idx++) {
    $arrGroup[] = $groups[$idx][0];
    $arrComment[] = $groups[$idx][1];
    $arrNb[] = '<span style="font-weight: normal;">(' . $groups[$idx][2] . ')</span>';
}
$n = new ListInfos($arrGroup, _("Groups"));
$n->setCssClass("groupName");
$n->addExtraInfo($arrComment, _("Comments"));
$n->setAdditionalInfo($arrNb);
$n->setNavBar(new AjaxNavBar($groupcount, $filter));
$n->addActionItem(new ActionItem(_("Edit members"), "members", "display", "group"));
$n->addActionItem(new ActionItem(_("Edit group"), "edit", "edit", "group"));
コード例 #16
0
ファイル: add_sous-group.php プロジェクト: rhertzog/lcs
include "includes/ihm.inc.php";

header_html();
aff_trailer ("8");
$cn=$description=$filter="";
if (is_admin("Annu_is_admin",$login)=="Y") {
echo "<form action=\"affichageleve.php\" method=\"post\">";
echo "<table border=\"0\">";
echo "<TR><TD><B>Nouveau groupe :</B></TD></TR>";
echo "<TR><TD>Intitul&#233; :</TD><td><input type=\"text\" name=\"cn\" value=\"$cn\" size=\"20\"></TD></TR>";
echo "<TR><TD>Description :</TD><td><input type=\"text\" name=\"description\" value=\"$description\" size=\"40\"></TD></TR>";
echo "</table><BR>";
echo "<B>S&#233;lectionner le(s) groupe(s) dans le(s)quel(s) se situent les personnes a mettre dans le groupe ci-dessus : </B><BR><BR>";

// Etablissement des listes des groupes disponibles
$list_groups=search_groups("(&(cn=*) $filter )");
// Etablissement des sous listes de groupes :
$j =0; $k =0; $m = 0;
for ($loop=0; $loop < count ($list_groups) ; $loop++) {
    // Classe
    if ( mb_ereg ("Classe_", $list_groups[$loop]["cn"]) ) {
	$classe[$j]["cn"] = $list_groups[$loop]["cn"];
	$classe[$j]["description"] = $list_groups[$loop]["description"];
	$j++;}
    // Equipe
    elseif ( mb_ereg ("Equipe_", $list_groups[$loop]["cn"]) ) {
	$equipe[$k]["cn"] = $list_groups[$loop]["cn"];
	$equipe[$k]["description"] = $list_groups[$loop]["description"];
	$k++;}
    // Autres
    elseif (!mb_ereg ("^Eleves", $list_groups[$loop]["cn"]) &&
コード例 #17
0
ファイル: bilan.php プロジェクト: rhertzog/lcs
    $nom = $_GET['fn'];
}
if (isset($_POST['nomeleve'])) {
    $nom = $_POST['nomeleve'];
}
if (isset($_GET['cl']) || isset($_POST["klas"])) {
    if (isset($_GET['cl'])) {
        $nom = $_GET['cl'];
    }
    if (isset($_POST["klas"])) {
        $nom = $_POST["klas"];
    }
    $filtre = "cn=" . $nom;
    $grp_cl = search_groups($filtre);
    if (count($grp_cl[0]) == 0) {
        $grp_cl = search_groups("cn=Classe_*" . $nom);
    }
    $uids = search_uids("(cn=" . $grp_cl[0]["cn"] . ")", "half");
    $users = search_people_groups($uids, "(sn=*)", "cat");
}
function affiche_abs($potache)
{
    global $dtajadebut, $dtajafin;
    //$potache=$_POST["eleve"];
    $horaire = array("M1", "M2", "M3", "M4", "M5", "S1", "S2", "S3", "S4", "S5");
    $nbabs = 0;
    $nbrtd = 0;
    foreach ($horaire as $cle => $val) {
        $rq4 = "SELECT count(*) FROM absences WHERE uidprof='{$_SESSION['login']}'  AND  {$val}='A'  AND uideleve='{$potache}' AND date >='{$dtajadebut}' AND date<='{$dtajafin}' ";
        $result4 = mysqli_query($dbc, $rq4) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
        while ($nb = mysqli_fetch_array($result4, MYSQLI_NUM)) {
コード例 #18
0
ファイル: planning.php プロジェクト: rhertzog/lcs
 if ($nb == 1 && $action == 1245) {
     if (!mb_ereg("^Cours", $cla_supp)) {
         $rq = "DELETE  FROM devoir WHERE id_ds='{$cible}' and login='******' LIMIT 1";
     } else {
         $rq = "DELETE  FROM devoir WHERE  login='******' and date='{$dat_supp}' and matiere='{$mat_supp}' and creneau='{$cren_supp}' and\n            sujet='{$suj_supp}' and durée= '{$dur_supp}'";
     }
     $result2 = @mysqli_query($GLOBALS["___mysqli_ston"], $rq) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
     //envoi d'un mail
     if ($_SESSION['liste'] == 1) {
         //recherche du groupe classe dans l'annuaire
         $classe_dest = "";
         $classe_courte = explode('_', $_GET['klasse']);
         $classe_dest = $classe_courte[count($classe_courte) - 1];
         //include "$BASEDIR/lcs/includes/headerauth.inc.php";
         //include "$BASEDIR/Annu/includes/ldap.inc.php";
         $grp_cl = search_groups("cn=Classe_*" . $classe_dest);
         $dest = $grp_cl[0]["cn"];
         is_null($___mysqli_res = mysqli_close($GLOBALS["___mysqli_ston"])) ? false : $___mysqli_res;
         include "../Includes/config.inc.php";
         //mise en forme de la date du devoir
         if ($_SESSION['version'] == ">=432") {
             setlocale(LC_TIME, "french");
         } else {
             setlocale("LC_TIME", "french");
         }
         $dat_new = strToTime($dat_supp);
         //destinataire
         $mailTo = $grp_cl[0]["cn"];
         //Le sujet
         $mailSubject = "Devoir supprimé";
         //Le  message