Location: PHPKode > projects > Web-Net-Admin > webnetadmin/consultuser_aff.php
<?
session_start();
include "utils2.php";
$log = test_logged();
if (!$log)
{
  die("Vous n'etes pas logguer");
}
require "sortir_variable_obl.php";
require "mysql/mysql.php";
echo "<p>";
echo "<font size=35>Consultation d'un utilisateur</font><p>";
echo "<form action='$_SERVER['PHP_SELF']' method='post'>";
echo "<br><br>";
echo "Veuillez inscrire un nom ";
echo "<input type=text name=voiruser><br><br><br>";
echo " ou choisissez-le dans la liste ci-dessous<br><br><br>";
$users = recup_user_insql($mysql_login, $mysql_pass, $serv_mysql);
$count = count($users);
echo "<select name=voiruser2>";
for ($i = 0; $i < $count; $i++)
{
  echo "<option value=$users[$i]>";
  echo $users[$i];
  echo "</option>";
}
echo "</select>";
echo "<br>";
echo "<br>";
echo "<input type=submit value=Voir!><br>";
echo "</form>";
if (!empty($HTTP_POST_VARS["voiruser2"]) || !empty($HTTP_POST_VARS["voiruser"]))
{
  $voir = $HTTP_POST_VARS["voiruser2"];
  if (!empty($HTTP_POST_VARS["voiruser"]))
    $voir= $HTTP_POST_VARS["voiruser"];
  $connexion = mysql_connect($serv_mysql, $mysql_login, $mysql_pass) or die('Connexion au serveur sql impossible<br>');
  mysql_select_db($name_base, $connexion) or die('Sélection de la base de donnée impossible<br>');
  $resultat = mysql_query("SELECT * FROM Utilisateurs", $connexion);
  while ($users = mysql_fetch_object($resultat))
    {
      if ($users->Login == $voir)
	{
	  if ($users->Fonction)
	    $fonction = $users->Fonction;
	  else
	    $fonction = "Non-définie";

	  $nc = $users->Nomcomplet;

	  if ($users->Localisation)
	    $localisation = $users->Localisation;
	  else
	    $localisation = "Non-définie";

	  if ($users->Tel)
	    $tel = $users->Tel;
	  else
	    $tel = "Non-défini";

	  if ($users->Fax)
	    $fax = $users->Fax;
	  else
	    $fax = "Non-défini";

	  if ($users->Ville)
	    $ville = $users->Ville;
	  else
	    $ville = "Non-définie";

	  $serv = $users->Serveur;
	  if ($users->Mail)
	    $mail = $users->Mail;
	  else
	    $mail = "Non-défini";
	  $uid = $users->Uid;
	  $gidnum = $users->Gid;
	  $gid = recup_nameofgrp_sql($gidnum, $serv_mysql, $mysql_login, $mysql_pass);
	  if ($users->Service)
	    $service = $users->Service;
	  else
	    $service = "Non-defini";
	  if ($users->Site)
	    $site = $users->Site;
	  else
	    $site = "Non-defini";
	  $pass = 1;
	  break;
	}
    }
  if ($pass)
    {
      echo "<p><p><p><font color=red size=5><b><u>$nc</u></b></font><p><p><p>";
      echo "<b>Fonction</b> : $fonction <p><p>";
      echo "<b>Service</b> : $service <p><p>";
      echo "<b>Localisation</b> : $localisation <p><p>";
      echo "<b>Tél</b> : $tel <p><p>";
      echo "<b>Fax</b> : $fax <p><p>";
      echo "<b>Ville</b> : $ville <p><p>";
      echo "<b>Serveur</b> : $serv <p><p>";
      echo "<b>Mail</b> : $mail <p><p>";
      echo "<b>Uid</b> : $uid <p><p>";
      echo "<b>Service</b> : $service <p><p>";
      echo "<b>Site</b> : $site <p><p>";
      echo "<b>Groupe Primaire</b> : $gid (gid = $gidnum)<p><p>";
    }
  else
    echo "<p><p>Pas d'utilisateur correspondant au nom de $voir<p>";
}
?>
Return current item: Web-Net-Admin