当前位置: 首页>>代码示例>>PHP>>正文


PHP people_get_variables函数代码示例

本文整理汇总了PHP中people_get_variables函数的典型用法代码示例。如果您正苦于以下问题:PHP people_get_variables函数的具体用法?PHP people_get_variables怎么用?PHP people_get_variables使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了people_get_variables函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: HTMLPurifier

	//configuration objet
 	include ("../lcs/includes/htmlpurifier/library/HTMLPurifier.auto.php");
 	$config = HTMLPurifier_Config::createDefault();
 	$purifier = new HTMLPurifier($config);
    //purification des variables
  	$pseudo=$purifier->purify($_POST['pseudo']);
  	$telephone=$purifier->purify($_POST['telephone']);
  	$mod_entry=$purifier->purify($_POST['mod_entry']);
}


  $login=$_SESSION['login'];
  $jeton_mod_user=md5($_SESSION['token'].htmlentities("/Annu/mod_user_entry.php"));

  // Recuperation des entrees de l'utilisateur a modifier
  $people_attr=people_get_variables ($login, false);
  $people_attr[0]["prenom"]=getprenom($people_attr[0]["fullname"],$people_attr[0]["nom"]);
  if (is_admin("Annu_is_admin",$login)=="Y") {
    // Redirection vers mod_user_entry.php
    header("Location:mod_user_entry.php?uid=$login&jeton=$jeton_mod_user");exit;
  } else {
    header_html();
    aff_trailer ("4");
    // Changement uniquement du pseudo pour l'utilisateur de �base�
      if ( (!$mod_entry) || ( $mod_entry && ( !$pseudo || !verifPseudo($pseudo) ) ) ) {
      ?>
      <form action="mod_entry.php" method="post">
        <table border="0" width="90%" align="center">
	  <tbody>
	    <tr>
	      <td width="30%" >Nom :</td>
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:mod_entry.php

示例2: admin

		$form .= "<select name='action' size=1>\n";
		$form .= "	<option value='settime'>Mettre &#224; l'heure le serveur</option>\n";
		$form .= "	<option value='halt'>Arr&#234;ter le serveur</option>\n";
		$form .= "	<option value='reboot'>Red&#233;marrer le serveur</option>\n";
		$form .= "	<option value='update'>Faire une mise a jour syst&#232;me</option>\n";
		$form .= "	<option value='synchro_mdp'>Synchro mot de passe admin (mode sans &#233;chec)</option>\n";
		$form .= "</select>\n";
        $form.='<input name="jeton" type="hidden"  value="'.md5($_SESSION['token'].htmlentities($_SERVER['PHP_SELF'])).'" />';
		$form.="<input type=\"submit\" value=\"Valider\">\n";
		$form.="</form>\n";
		echo $form;
	} else {
		// Traitement de l'action.
		echo "<h3>Traitement de l'action $action sur le serveur LCS</h3>\n";
		$Subject="[LCS T&#224;che d'administration] $action\n";
		list($user,$groups)=people_get_variables("admin", true);
		$to = $user["email"];
		$From = "root@$domain";
		$Subject ="\nCR d'action sur serveur LCS\n";
		$Body = $Subject;
		$Body.= "L'action $action \n";
		$Body.= $commandes."\n";
		// Execution de l'action sur le serveur
		if ( $action == "synchro_mdp" ) {
				$pass = urldecode( xoft_decode($_COOKIE['LCSuser'],$key_priv) );
				# Verify decode pass
				if ( user_valid_passwd ( "admin", $pass ) ) {
					# reencode temporarily pass with openssl
					$cryptpass = exec ("echo ". escapeshellarg($pass) ." | openssl aes-256-cbc -a -salt -pass pass:$key_priv");
					exec ("/usr/bin/sudo /usr/share/lcs/scripts/action.sh 'synchro_mdp' '$cryptpass'" , $AllOutput, $ReturnValue);
				}	else $ReturnValue="1";
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:action.php

示例3: authenticate_lcs

	private function authenticate_lcs() {
		/*
		include LCS_PAGE_AUTH_INC_PHP;
		include LCS_PAGE_LDAP_INC_PHP;
		# LCS a besoin de quelques variables extérieures...
		# L'initialisation ci-dessous n'est pas très propre, il faudra
		# reprendre ça...
		*/
		global $login;

		$DBAUTH = $GLOBALS['DBAUTH'];
		$HTTP_COOKIE_VARS = $GLOBALS['HTTP_COOKIE_VARS'];
		$authlink = $GLOBALS['authlink'];
		$dbHost = $GLOBALS['dbHost'];
		$dbUser = $GLOBALS['dbUser'];
		$dbPass = $GLOBALS['dbPass'];
		$dbDb = $GLOBALS['dbDb'];

		if ($login!="") {
			list($user, $groups)=people_get_variables($login, false);
			#TODO: Utiliser les infos des lignes ci-dessous pour mettre à jour
			# les informations de l'utilisateur dans la base.
			$lcs_tab_login["nom"] = $user["nom"];
			$lcs_tab_login["email"] = $user["email"];
			$long = mb_strlen($user["fullname"]) - mb_strlen($user["nom"]);
			$lcs_tab_login["fullname"] = mb_substr($user["fullname"], 0, $long) ;

			// A ce stade, l'utilisateur est authentifié
			// Etablir à nouveau la connexion à la base
			if (isset($GLOBALS['db_nopersist']) && !$GLOBALS['db_nopersist'])
				$db_c = ($GLOBALS["mysqli"] = mysqli_connect($dbHost,  $dbUser,  $dbPass));
			else
				$db_c = ($GLOBALS["mysqli"] = mysqli_connect($dbHost,  $dbUser,  $dbPass));

			if (!$db_c || !((bool)mysqli_query($GLOBALS["mysqli"], "USE $dbDb"))) {
				echo "\n<p>Erreur : Echec de la connexion à la base de données";
				exit;
			}
			$this->login = $login;
			$this->current_auth_mode = "sso";
			return true;
			exit;
		} else {
			// L'utilisateur n'a pas été identifié'
			header("Location:".LCS_PAGE_AUTHENTIF);
			exit;
		}
	}
开发者ID:rhertzog,项目名称:lcs,代码行数:48,代码来源:Session.class.php

示例4: header

        }
    }
    if (isset($_SESSION['saclasse'])) {
        header("location: ./scripts/cahier_text_eleve.php");
        exit;
    } else {
        header("location: ./scripts/accessfilter.php");
        exit;
    }
} elseif (isset($_GET['prof'])) {
    //validation du lien
    unset($_SESSION['aliasprof']);
    unset($_SESSION['proffull']);
    if (validkey($_GET['prof'], $_GET['limit'], $_GET['key']) == "OK" && $_GET['limit'] > time()) {
        $_SESSION['aliasprof'] = $_GET['prof'];
        list($us_er, $groups) = people_get_variables($_GET['prof'], false);
        $_SESSION['proffull'] = $us_er["fullname"];
        $_SESSION['RT'] = rand();
        header("location: ./scripts/cahier_texte_prof_ro.php");
        exit;
    } elseif (validkey($_GET['prof'], $_GET['limit'], $_GET['key']) != "OK") {
        $err = "pas";
        header("location: ./scripts/error.php?error=" . $err . "");
        exit;
    } elseif ($_GET['limit'] < time()) {
        $err = "plus";
        header("location: ./scripts/error.php?error=" . $err . "");
        exit;
    }
} else {
    header("location: ./scripts/accessfilter.php");
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:index.php

示例5: infosUser

/**
*  infosUser() :
*@type : function
*@param : $login (login user)
*@param : $idpers (idpers user)
*@return : Object  (infos utilisateur)
*/
function infosUser($login, $pwchg)
{
    if ($login != "") {
        // les infos ldap
        list($user, $groups) = people_get_variables($login, true);
        $_usr = $user;
        $_usr["login"] = isset($login) ? $login : 'default';
        //le login du user
        $_usr["idpers"] = "x";
        // idpers on s'en fou
        $_usr["pwchg"] = $pwchg ? "N" : "Y";
        // password modifié ?
        $_usr["jeton"] = "&jeton=" . md5($_SESSION['token'] . htmlentities("/Annu/group.php"));
        //test listes de diffusion
        //@boulet@ la je ne comprends pas tout
        exec("/bin/grep \"#<listediffusionldap>\" /etc/postfix/mailing_list.cf", $AllOutPut, $ReturnValueShareName);
        $listediff = 0;
        if (count($AllOutPut) >= 1) {
            $listediff = 1;
        }
        // fin test listes de diffusion
        // infos de connexion
        // a passer en chaine de langue l
        // revoir aussi le message de changement de mot de passe a deplacer
        // et aussi changer le message d'invite dans lcs-web
        //section supprimee par mrfi
        // les groupes
        if (count($groups)) {
            $dirIcn = "../data/";
            $co = $ma = $eq = $di = $cl = 0;
            $tbl_gp = array("Administratifs", "Profs", "Eleves");
            $ptrn = array('Classe', 'Cours', 'Equipe', 'Matiere');
            for ($loop = 0; $loop < count($groups); $loop++) {
                $gex = explode('_', $groups[$loop]["cn"]);
                $g = preg_replace('/ /', '', $gex[0]);
                // si on est admin
                if ($groups[$loop]["cn"] == "admins") {
                    // on passe Admin en "faux" groupe principal
                    $_usr['grps']['gp'] = 'Admins';
                    // et le reste dans Autres
                    $_usr['grps']['Autres'][$loop] = $groups[$loop]["cn"];
                } else {
                    if (in_array($groups[$loop]["cn"], $tbl_gp)) {
                        $_usr['grps']['gp'] = preg_replace('/ /', '', $gex[0]);
                    } else {
                        if (in_array($g, $ptrn)) {
                            $_usr['grps'][$g][] = preg_replace('/$g/', ' ', $groups[$loop]["cn"]);
                        } else {
                            $_usr['grps']['Autres'][] = $groups[$loop]["cn"];
                        }
                    }
                }
                // Teste si n&#233;cessit&#233; d'affichage menu Ouverture/Fermeture Bdd et espace web perso des Eleves
                // A confirmer .. is't ok, misterfi ?
                if ($groups[$loop]["cn"] == "Eleves") {
                    $ToggleAff = 1;
                }
            }
        } else {
            $_usr['grps']['gp'] = 'Attention! Vous n\'appartenez à aucun groupe';
        }
    } else {
        $_usr['idpers'] = "x";
    }
    return $_usr;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:73,代码来源:desktop_settings.php

示例6: count

	// Supprime un droit
	if ( $action == "DelRights" ) {
      		// Suppression des droits dans l'annuaire
      		echo "<h3>".gettext("Suppression des droits pour")." <u>$uid</u></h3>";
      		echo "<p>".gettext("Vous avez s&#233;lectionn&#233; ") ."". count($delrights)." droit(s)<br />\n";
      		for ($loop=0; $loop < count($delrights); $loop++) {
        		$right=$delrights[$loop];
        		echo gettext("Suppression du droit")." <u>$right</u> ".gettext("pour le groupe")." $uid<br />";
        		$cDn = "cn=$uid,$groupsRdn,$ldap_base_dn";
        		$pDn = "cn=$right,$rightsRdn,$ldap_base_dn";
        		exec ("$scriptsbinpath/groupDelEntry.pl ". escapeshellarg($cDn) ." ". escapeshellarg($pDn));
        		echo "<br />";
      		}
    	}

    	list($user, $groups)=people_get_variables($uid, true);
    	// Affichage du nom et de la description de l'utilisateur
    	echo "<h3>".gettext("D&#233;l&#233;gation de droits &#224; ")."" ." (<u>$uid</u>)</h3>\n";
    	echo gettext("S&#233;lectionnez les droits &#224; supprimer (liste de gauche) ou &#224; ajouter (liste de droite) ");
    	echo gettext("et validez &#224; l'aide du bouton correspondant.")."<br /><br />\n";
    	// Lecture des droits disponibles
    	$userDn="cn=$uid,$groupsRdn,$ldap_base_dn";
    	$list_possible_rights=search_machines("(!(member=$userDn))","rights");
    	$list_current_rights=search_machines("(member=$userDn)","rights");
    	?>

	<form method="post" action="../Annu/add_group_right.php">
  	<input TYPE="hidden" VALUE="<?php echo $uid;?>" NAME="cn">
  	<input TYPE="hidden" NAME="action">
  	<table BORDER=1 CELLPADDING=3 CELLSPACING=1 RULES=COLS><tr>
  	<th align=center><?php echo gettext("Droits actuels "); ?>
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:add_group_right.php

示例7: count

<meta name="author" content="Philippe LECLERC -TICE CAEN" />
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<link href="../style/style.css" rel="stylesheet" type="text/css" />
	<link  href="../style/navlist-prof.css" rel="stylesheet" type="text/css" />
	<link  href="../style/navlist-eleve.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
<link href="../style/style-ie.css"  rel="stylesheet" type="text/css"/>
<![endif]-->
</head>
<body>
<?php 
//recherche des groupes cours
$ind = count($classe);
include "/var/www/lcs/includes/headerauth.inc.php";
include "/var/www/Annu/includes/ldap.inc.php";
list($user, $groups) = people_get_variables($_SESSION['login'], true);
if (count($groups)) {
    for ($loop = 0; $loop < count($groups); $loop++) {
        if (mb_ereg("^Cours", $groups[$loop]["cn"])) {
            $classe[$ind] = $groups[$loop]["cn"];
            $ind++;
        }
    }
}
//edt cdt
$filename = "../json_files/" . $_SESSION['login'] . ".json";
//si clic sur Personnaliser le cahier de textes
if (is_file($filename)) {
    $evts = json_decode(file_get_contents($filename));
    $tab = array();
    foreach ($evts as $id => $ev) {
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:config_ctxt.php

示例8: people_get_variables

				<td>
			</tr>
			<tr>
				<td colspan="3">
					<br />
					<b><u>Changer le propri&eacute;taire</u> :</b><!-- Set Owner:-->
					<select name="newowner">
						<option value="">Ne rien modifier</option><!-- Don't change-->
						<option value=""></option>
						<?php
						if ($users = $this->LoadUsers())
						{
							foreach($users as $user)
							{
								//ajout des noms et prénoms à partir de la fonction LCS people_get_variables()
								list($uti, $groups) = people_get_variables($user["name"],false);
								echo "<option value=\"",htmlentities($user["name"]),"\">",$uti["fullname"],"</option>\n";
							}
						}
						?>
					</select>
				<td>
			</tr>
			</table>
			<br /><br />
				<center>
					<input type="submit" value="Enregistrer" style="width: 120px" accesskey="s"><!-- Store ACLs-->
					<input type="button" value="Annuler" onclick="history.back();" style="width: 120px"><!-- Cancel -->
				</center>
		</form>
开发者ID:rhertzog,项目名称:lcs,代码行数:30,代码来源:lcs_acls.php

示例9: createGroups

	function createGroups($grname)
	{
	if (($grname=="Equipe") || ($grname=="Classe")) {
	//Liste des équipes
  	$grname = $grname._;
	$groupes = search_uids ("(cn=$grname*)","half");
        for ( $x=0; $x<count($groupes); $x++)
           {
	   $groupe=$groupes[$x]["cat"]._.$groupes[$x]["group"];
	   $login=$groupes[$x]["uid"];
	   if (! $login) echo "<br /><b>ATTENTION</b> un login est vide : cela arrive notamment quand vous avez un membre dans le groupe $groupe qui ne correspond pas à un utilisateur valide dans la branche PEOPLE de LDAP. Mais ceci n'a pas empêché la bonne réalisation de l'opération. <br />";
	   	elseif ($this->UserInGroup($groupe, $user = $login))
	   	 	echo "$login déjà associé <br />";
			else $this->Query("INSERT INTO ".$this->config["table_prefix"]."groups (grname,grmember) values('$groupe','$login')");
	  }
	  echo "<br /><b>La création des groupes ".substr($grname,0,strlen($grname)-1)."s"." a été réalisée</b><br />";
	}
	else {
 	   $users=search_uids ("cn=$grname","full");
 	   //Création effective
 	   for ($x=0;$x<count($users);$x++)
 		{
  		$uid=$users[$x]["uid"];
  		list($user,$groups)=people_get_variables($uid, false);
  		$login=$user["uid"];
  		$mail=$user["email"];
  		//Insertion de l'utilisateur
		 if (! $login){}
		 	elseif ($this -> loadUser($login))
 				echo "<br /> $login existe déjà dans la base de données <br />";
	 			else $this->Query("INSERT INTO ".$this->config["table_prefix"]."users (name,email) values('$login','$mail')");
  		//Association avec le groupe
	 if (! $login) echo "<br /><b>ATTENTION</b> un login est vide : cela arrive notamment quand vous avez un membre dans le groupe $grname qui ne correspond pas à un utilisateur valide dans la branche PEOPLE de LDAP. Mais ceci n'a pas empêché la bonne réalisation de l'opération.<br />";
  			elseif ($this->UserInGroup($grname, $user = $login))
         			echo "$login déjà associé <br>";
         			else $this->Query("INSERT INTO ".$this->config["table_prefix"]."groups (grname,grmember) values('$grname','$login')");
 		}
	    echo "<br /><b>La création du groupe $grname et des utilisateurs correspondants a été réalisée</b><br />";	
             }
	}
开发者ID:rhertzog,项目名称:lcs,代码行数:40,代码来源:wakka_lcs.php

示例10: lcsUserInfos

function lcsUserInfos($login, $f = "json")
{
    list($user, $groups) = people_get_variables($login, true);
    $ar = array("fullname" => $user["fullname"], "description" => $user["description"], "group" => '', "groups" => array());
    $jsSt = "{\"data\": {\"nom\": \"" . $user["fullname"] . "\",\"description\": \"" . $user["description"] . "\"";
    $htEn = "</ul>\n";
    $jsEn = "}}}";
    $xmSt = "<response>\n\t<fullname>" . $user["fullname"] . "</fullname>\n";
    if ($user["description"]) {
        $lst = "<p>" . $user["description"] . "</p>";
    }
    if (count($groups)) {
        switch ($f) {
            case "arra":
                $fEn = '';
                break;
            case "html":
                $fSt = "<ul>\n\t<li class=\"fullname\"><strong>Nom : </strong>" . $user["fullname"] . "</li>\n" . "\t<li class=\"description\"><strong>Description : </strong>" . $user["description"] . "</li>\n";
                $fEn = "</ul>";
                $fGpSt = "<li class=\"group\"><strong>Groupe principal : </strong>";
                $fClSt = "<li class=\"classe\"><strong>Classe : <strong>";
                $fGsSt = "\n<li class=\"";
                $fGsMi = "\">";
                $fPrefXTiSt = "<li class=\"groups\"><strong>";
                $fPrefXTiEn = " : </strong><ul><li>";
                $fSufXTi = "</ul>";
                $fPrefX = "</li>";
                $fSufX = '';
                $fClEn = $fGpEn = $fGsEn = "</li>";
                break;
            case "json":
                $fSt = "{\"data\": {\"nom\": \"" . $user["fullname"] . "\",\"description\": \"" . $user["description"] . "\"";
                $fEn = "}}}";
                $fGpSt = ", \"Groupe principal\" : \"";
                $fClSt = ", \"Classe\" : \"";
                $fGsSt = "\"";
                $fGsMi = "\":\"";
                $fPrefXTiSt = ",\"";
                $fPrefXTiEn = "\": {";
                $fSufXTi = "}";
                $fPrefX = ",";
                $fSufX = '';
                $fClEn = $fGpEn = $fGsEn = "\"";
                break;
            case "xml":
                $fSt = "<response>\n\t<fullname>" . $user["fullname"] . "</fullname>\n" . "\t<description>" . $user["description"] . "</description>\n";
                $fEn = "</response>";
                $fGpSt = "<group>";
                $fClSt = "<classe>";
                $fGsSt = "\n< class=\"";
                $fGsMi = "\">";
                $fPrefXTiSt = "<li class=\"groups\"><strong>";
                $fPrefXTiEn = " : </strong><ul><li>";
                $fSufXTi = "</titiul>";
                $fPrefX = "</toto>";
                $fSufX = '';
                $fGsEn = "</toto>";
                $fClEn = "</classe>";
                $fGpEn = "</group>";
                break;
            default:
                $fSt = array();
                $fEn = '';
        }
        $rGroups = lcsListGroups($groups, $fGpSt, $fGpEn, $fClSt, $fSufXTi, $fSufX, $fPrefXTiSt, $fPrefXTiEn, $fPrefX, $fGsSt, $fGsMi, $fGsEn);
        $rRes = $fSt . $rGroups . $fEn;
        //	return htmlspecialchars($rRes, ENT_QUOTES);
        return $rRes;
    }
}
开发者ID:rhertzog,项目名称:lcs,代码行数:70,代码来源:functions.inc.php

示例11: get_users_in_my_groups

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;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:99,代码来源:user-ldap.php

示例12: decripte_uid

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;
}
开发者ID:rhertzog,项目名称:lcs,代码行数:25,代码来源:functions2.inc.php

示例13: mysqli_query

                     }
                     echo "; ";
                 }
             }
             echo '</li>';
             echo "<li>Retards : ";
             //recherche des retardataires//
             $rq = "SELECT uideleve FROM absences WHERE date='{$datsql}' AND " . $valcren . "='R' AND classe='{$valcla}' ORDER BY id_abs ASC";
             // lancer la requete
             $result = mysqli_query($GLOBALS["___mysqli_ston"], $rq) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
             $nb = mysqli_num_rows($result);
             if ($nb == 0) {
                 echo "aucun";
             } else {
                 while ($enrg = mysqli_fetch_array($result, MYSQLI_NUM)) {
                     list($user, $groups) = people_get_variables($enrg[0], false);
                     echo $user["fullname"] . "; ";
                 }
             }
             echo '</li>';
             echo "</ul></li>";
         }
         //fin each class
         echo "</ul>";
     }
 }
 //fin each creneau
 if ($aucun == "true") {
     echo "Pas de donn&eacute;es pour le(s) cr&eacute;neau(x) s&eacute;lectionn&eacute;(s) !<br />";
 }
 echo '<div > <h5> N\'apparaissent que les classes pour lesquelles l\'appel a &eacute;t&eacute; fait !</h5></div>';
开发者ID:rhertzog,项目名称:lcs,代码行数:31,代码来源:bilancpe2.php

示例14: exec_creer_zones_groupes_lcs_dist

function exec_creer_zones_groupes_lcs_dist(){
	// si pas autorise : message d'erreur
	if (!autoriser('voir', 'peupler_zones_lcs')) {
		include_spip('inc/minipres');
		echo minipres();
		exit;
	}
	// pipeline d'initialisation
	pipeline('exec_init', array('args'=>array('exec'=>'peupler_zones_lcs'),'data'=>''));
	// entetes
	$commencer_page = charger_fonction('commencer_page', 'inc');
	// titre, partie, sous_partie (pour le menu)
	echo $commencer_page(_T('tispipskelet:titre_peupler_zones_lcs'), "editer", "editer");
	
	// titre
	echo "<br /><br /><br />\n"; // outch ! aie aie aie ! au secours !
	$ze_logo='<img src="'._DIR_PLUGIN_TISPIPSKELET.'/img_pack/logo_biduls_acces-restreint_120.png" style="width:96px;vertical-align:middle;">';
	echo gros_titre(_T('tispipskelet:Cr&eacute;ation des zones d&rsquo;acc&egrave;s restreint issues des groupes de l&rsquo;annuaire LCS'), $ze_logo, false);
	
	// colonne gauche
	echo debut_gauche('', true);
	
	echo debut_boite_info(true);
	echo propre(_T('tispipskelet:info_creer_zones_groupes_ldap'));	
	echo fin_boite_info(true);
	echo pipeline('affiche_gauche', array('args'=>array('exec'=>'peupler_zones_lcs'),'data'=>''));
	
	// colonne droite
	echo creer_colonne_droite('', true);
	echo pipeline('affiche_droite', array('args'=>array('exec'=>'peupler_zones_lcs'),'data'=>''));
		if (autoriser('webmestre')) {
		$res= icone_horizontale(_L('Acc&egrave;s restreint'), generer_url_ecrire("acces_restreint"), "../"._DIR_PLUGIN_TISPIPSKELET."/img_pack/logo_acces_restreint_48.png", "",false);
		echo bloc_des_raccourcis($res);
	}

	// centre
	echo debut_droite('', true);
	// contenu
 
include ("/var/www/lcs/includes/config.inc.php");
include ("/var/www/Annu/includes/ldap.inc.php");
$authlink=mysql_connect("$HOSTAUTH", "$USERAUTH", "$PASSAUTH");

list($user, $groups)=people_get_variables($login, true);
include ("/var/www/lcs/includes/functions.inc.php");
function my_people_get_variables ($serveur,$port,$Dn)
{
  $ldap_server=$serveur;
  $ldap_port=$port;
  $dn=$Dn;
  global $error;
  $error="";
  // LDAP attribute
 
  $ldap_group_attr = array (
    "cn",
    "memberuid",
    "description",  // Description du groupe
  );

  $ds = @ldap_connect ( $ldap_server, $ldap_port );
  if ( $ds ) {
    $r = @ldap_bind ( $ds ); // Bind anonyme
    if ($r) {
       
        // Recherche des groupes d'appartenance dans la branche Groups
        
        $filter = "(&(objectclass=posixGroup))";
        $result = @ldap_list ( $ds, $dn["groups"], $filter, $ldap_group_attr );
        if ($result) {
          $info = @ldap_get_entries ( $ds, $result );
          if ( $info["count"]) {
            for ($loop=0; $loop<$info["count"];$loop++) {
              //if ($info[$loop]["member"][0] == "") $typegr="posixGroup"; else $typegr="groupOfNames";
              $typegr="posixGroup";
              $ret_group[$loop] = array (
                "cn"           => $info[$loop]["cn"][0],
                //"owner"        => $info[$loop]["owner"][0],
                "description"  => utf8_decode($info[$loop]["description"][0]),
                "type" => $typegr
              );
            }
            usort($ret_group, "cmp_cn");
          }
          @ldap_free_result ( $result );
       }
       // Fin recherche des groupes
    } else {
      $error = "Echec du bind anonyme";
    }
    @ldap_close ( $ds );
  } else {
    $error = "Erreur de connection au serveur LDAP";
  }
 return array( $ret_group);
}

// Recherche des groupes d'appartenance de l'utilisateur $login
  	list($groups)=my_people_get_variables($ldap_server,$ldap_port,$dn);
	$i=0;
//.........这里部分代码省略.........
开发者ID:rhertzog,项目名称:lcs,代码行数:101,代码来源:creer_zones_groupes_lcs.php

示例15: mysqli_connect

 $liste_nouveaux = "";
 $liste_pb_insertion = "";
 $liste_update = "";
 $liste_pb_update = "";
 // Etablir à nouveau la connexion à la base
 if (empty($db_nopersist)) {
     $db_c = mysqli_connect('p:' . $dbHost, $dbUser, $dbPass);
 } else {
     $db_c = mysqli_connect($dbHost, $dbUser, $dbPass);
 }
 if (!$db_c || !mysqli_select_db($db_c, $dbDb)) {
     echo "\n<p>\n" . get_vocab('failed_connect_db') . "\n";
 }
 for ($loop = 0; $loop < $total_user; $loop++) {
     $user_login = $users[$loop]["uid"];
     list($user, $groups) = people_get_variables($user_login, true);
     $user_nom = $user["nom"];
     $user_fullname = $user["fullname"];
     $user_email = $user["email"];
     $long = strlen($user_fullname) - strlen($user_nom);
     $user_prenom = substr($user_fullname, 0, $long);
     if (is_eleve($user_login)) {
         $user_statut = $statut_eleve;
     } else {
         $user_statut = $statut_non_eleve;
     }
     $groupe = "";
     for ($loop2 = 0; $loop2 < count($groups); $loop2++) {
         if ($groups[$loop2]["cn"] == "Profs" || $groups[$loop2]["cn"] == "Administratifs" || $groups[$loop2]["cn"] == "Eleves") {
             $groupe .= $groups[$loop2]["cn"] . ", ";
         }
开发者ID:Sirlefou1,项目名称:GRR2,代码行数:31,代码来源:admin_user.php


注:本文中的people_get_variables函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。