From 3fd3ad460330082ad9fea71e67f4df0e12e6a8d0 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 24 Oct 2015 10:57:16 +0200 Subject: [PATCH] =?UTF-8?q?Script=20de=20cr=C3=A9ation=20d'utilisateurs=20?= =?UTF-8?q?+=20ajout=20=C3=A0=20un=20groupe=20(pour=20les=20tests)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- groups.php | 157 ------ manager/database.php | 33 +- manager/groups.php | 19 +- manager/user.php | 6 +- page/groups.php | 7 +- src/userlistSample.json | 800 +++++++++++++++++++++++++++--- xdoc/generateur_100_etudiants.php | 94 ++++ xdoc/json_generator | 17 + 8 files changed, 885 insertions(+), 248 deletions(-) delete mode 100755 groups.php create mode 100644 xdoc/generateur_100_etudiants.php create mode 100644 xdoc/json_generator diff --git a/groups.php b/groups.php deleted file mode 100755 index a8dfc59..0000000 --- a/groups.php +++ /dev/null @@ -1,157 +0,0 @@ - 1 && strlen($_POST['password']) > 1; // d'au moins 2 caractères - -// $_SESSION['username'] = null; - -// si on a soumis le formulaire -if( $LOGIN_postNotEmpty ){ - $userlist = file_get_contents('src/userlist.json'); - $userlistObj = json_decode($userlist); - - if( $userlistObj != null ){ // si format non corrompu - - if( isset($userlistObj->{$_POST['username']}) ) // si non d'utilisateur connu - if( $userlistObj->{$_POST['username']}->password == $_POST['password'] ) // si mot de passe ok - $_SESSION['username'] = $_POST['username']; - } -} - -if( !(isset($_SESSION['username']) && is_string($_SESSION['username']) && strlen($_SESSION['username']) > 1) ) - $_SESSION['username'] = null; - - - -/* VARIABLES DES NOTIFICATIONS */ -$memberNotifNum = 10; -$messageNotifNum = 0; -$notifNotifNum = 5; - - - -?> - - - - - - Système d'Information du Département - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
- - - -
- - -
-
Contenu de la section #HOME
-
Contenu de la section #GROUPES
- -
- - - - -
- - -
-
"; - echo "
"; - echo ""; - echo ""; - echo ""; - echo "  Identifiants incorrects."; - echo ""; - echo "
"; - - }else{ // si chargement normal de la page - - echo "
"; - echo "
"; - echo ""; - echo ""; - echo ""; - echo " "; - echo ""; - echo "
"; - } - ?> - - - - - - - - - - \ No newline at end of file diff --git a/manager/database.php b/manager/database.php index 992518a..ab6a704 100755 --- a/manager/database.php +++ b/manager/database.php @@ -20,6 +20,12 @@ class DataBase{ $this->pdo = new PDO('mysql:host='.$host.';dbname='.$dbname, $username, $password); } + + /* retourne une instance de la classe */ + public static function getInstance(){ + return new DataBase("localhost", "sid", "php", "Qt358nUdyeTxLDM8"); + } + /*********************************************/ /*** création d'un utilisateur dans la bdd ***/ /*********************************************/ @@ -36,12 +42,12 @@ class DataBase{ $req = $this->pdo->prepare("INSERT INTO `utilisateurs`(`id_utilisateur`, `pseudo`, `prenom`, `nom`, `email`, `password`, `droits`) VALUES(default, :pseudo, :prenom, :nom, :email, :password, :droits)"); $req->execute(array( - ':pseudo' => mysql_escape_string($username), - ':prenom' => mysql_escape_string($prenom ), - ':nom' => mysql_escape_string($nom ), - ':email' => mysql_escape_string($email ), - ':password' => mysql_escape_string($password), - ':droits' => mysql_escape_string($droits ) + ':pseudo' => $username, + ':prenom' => $prenom , + ':nom' => $nom , + ':email' => $email , + ':password' => $password, + ':droits' => $droits )); $added = (int) $this->pdo->lastInsertId(); @@ -69,7 +75,7 @@ class DataBase{ $req = $this->pdo->prepare("INSERT INTO `groupes`(`id_groupe`, `nom`) VALUES(default, :nom)"); $req->execute(array( - ':nom' => mysql_escape_string($nom) + ':nom' => $nom )); // echo var_dump( $this->pdo->errorInfo() ).'
'; @@ -100,6 +106,8 @@ class DataBase{ else return 'unknown_user'; + echo '[1]'; + // on cherche un groupe avec ce nom $getGroupeUID = $this->pdo->prepare("SELECT `id_groupe` FROM `groupes` WHERE `nom` = :nom"); @@ -113,6 +121,9 @@ class DataBase{ else return 'unknown_group'; + + echo '[2]'; + // si on a l'UID utilisateur & l'UID groupe => on créé l'association $asso = $this->pdo->prepare("INSERT INTO `association_utilisateur_groupe`(`id_utilisateur`, `id_groupe`) VALUES( (SELECT `id_utilisateur` FROM `utilisateurs` WHERE `id_utilisateur` = :utilisateur), (SELECT `id_groupe` FROM `groupes` WHERE `id_groupe` = :groupe) )"); $asso->execute(array( @@ -120,6 +131,9 @@ class DataBase{ ':groupe' => $groupeUID )); + + echo '[3]'; + return 'success'; } @@ -147,7 +161,7 @@ class DataBase{ "WHERE `u`.`id_utilisateur` = `asso`.`id_utilisateur` ". "AND `g`.`id_groupe` = `asso`.`id_groupe` ". "AND `g`.`nom` = :groupe ". - "ORDER BY `u`.`pseudo` "); + "ORDER BY `u`.`prenom`, `u`.`nom`"); $asso->execute(array( ':groupe' => $groupe )); @@ -194,7 +208,4 @@ class DataBase{ } - -$db = new DataBase("localhost", "sid", "php", "Qt358nUdyeTxLDM8"); - ?> \ No newline at end of file diff --git a/manager/groups.php b/manager/groups.php index 736812f..9193c0d 100755 --- a/manager/groups.php +++ b/manager/groups.php @@ -27,8 +27,6 @@ - - /* [1] ROUTAGE DE NIVEAU 1 ============================================================*/ function groups_switch_level_1($request, $answer){ @@ -45,8 +43,8 @@ $nomCheck = $nEmptyParam && preg_match('/^[a-z -]{1,50}$/i', $request->nom); // nom bon format if( $nomCheck ){ // si tout les paramètres sont bons - require('database.php'); - $answer->request = $db->creerGroupe($request->nom); + require_once __ROOT__.'/manager/database.php'; + $answer->request = DataBase::getInstance()->creerGroupe($request->nom); }else $answer->request = 'param_error'; break; @@ -62,8 +60,8 @@ $groupeCheck = $utilisateurCheck && preg_match('/^[a-z -]{1,50}$/i', $request->groupe); // groupe (nom) bon format if( $groupeCheck ){ // si tout les paramètres sont bons - require('database.php'); - $answer->request = $db->ajouterUtilisateurGroupe($request->utilisateur, $request->groupe); + require_once __ROOT__.'/manager/database.php'; + $answer->request = DataBase::getInstance()->ajouterUtilisateurGroupe($request->utilisateur, $request->groupe); }else $answer->request = 'param_error'; break; @@ -78,9 +76,8 @@ $groupeCheck = $nEmptyParam && preg_match('/^[a-z -]{1,50}$/i', $request->groupe); // groupe (nom) bon format if( $groupeCheck ){ // si tout les paramètres sont bons - require('database.php'); - - $userlist = $db->listeUtilisateurGroupe($request->groupe); + require_once __ROOT__.'/manager/database.php'; + $userlist = DataBase::getInstance()->listeUtilisateurGroupe($request->groupe); if( is_array($userlist) ){ // si on a récupéré la liste des utilisateurs $answer->userlist = $userlist; @@ -97,9 +94,9 @@ /* retourne les utilisateurs de tous les groupe */ /************************************************/ case 'grouplist': - require('database.php'); + require_once __ROOT__.'/manager/database.php'; - $grouplist = $db->listeEtudiantsTousGroupes(); + $grouplist = DataBase::getInstance()->listeEtudiantsTousGroupes(); if( is_array($grouplist) ){ // si on a récupéré la liste des utilisateurs $answer->grouplist = $grouplist; diff --git a/manager/user.php b/manager/user.php index bf7b837..dac8252 100755 --- a/manager/user.php +++ b/manager/user.php @@ -1,4 +1,4 @@ -droits, ['student', 'teacher', 'master', 'admin'])); // droits bon format if( $droitsCheck ){ // si tout les paramètres sont bons - require('database.php'); - $answer->request = $db->creerUtilisateur($request->username, $request->prenom, $request->nom, $request->email, $request->password, $request->droits); + require_once __ROOT__.'/manager/database.php'; + $answer->request = DataBase::getInstance()->creerUtilisateur($request->username, $request->prenom, $request->nom, $request->email, $request->password, $request->droits); }else $answer->request = 'param_error'; break; diff --git a/page/groups.php b/page/groups.php index e01a495..3d25cde 100755 --- a/page/groups.php +++ b/page/groups.php @@ -41,12 +41,6 @@ require_once __ROOT__.'/manager/security.php'; session_init(); echo ''; echo ''; echo 'Groupe '.$group->nom.''; - echo ''; - echo 'Pseudo'; - echo 'Prénom'; - echo 'Nom'; - echo 'email'; - echo 'droits'; echo ''; echo ''; @@ -57,6 +51,7 @@ require_once __ROOT__.'/manager/security.php'; session_init(); foreach($group->userlist as $user){ echo ''; foreach($user as $key=>$value) + if( $key == 'prenom' || $key == 'nom' ) echo ''.$value.''; echo ''; } diff --git a/src/userlistSample.json b/src/userlistSample.json index 5287259..9e60c26 100755 --- a/src/userlistSample.json +++ b/src/userlistSample.json @@ -1,122 +1,802 @@ [ { - "name": "Dickson William", - "sexe": "male" + "pseudo": "ydw1981a", + "prenom": "Glenda", + "nom": "WILKINSON", + "email": "glenda.wilkinson@etu.iut-tlse3.fr", + "password": "c95fca15-628e-4977-8a92-6dc1be76d15a", + "droits": "student" }, { - "name": "Ortega Levy", - "sexe": "male" + "pseudo": "ihf1991a", + "prenom": "Robinson", + "nom": "MCGEE", + "email": "robinson.mcgee@etu.iut-tlse3.fr", + "password": "4350c63d-3b73-4c79-b56f-5cba092a37a6", + "droits": "student" }, { - "name": "Stark Barrera", - "sexe": "male" + "pseudo": "mma1990a", + "prenom": "Williamson", + "nom": "HATFIELD", + "email": "williamson.hatfield@etu.iut-tlse3.fr", + "password": "60872c3f-6511-4dbc-9bbf-17cf7be9f517", + "droits": "student" }, { - "name": "Daugherty Rodriquez", - "sexe": "male" + "pseudo": "lme1952a", + "prenom": "Hollie", + "nom": "GILLIAM", + "email": "hollie.gilliam@etu.iut-tlse3.fr", + "password": "195d3eb8-0bd1-4996-85ee-f83c46288028", + "droits": "student" }, { - "name": "Shepard Conway", - "sexe": "male" + "pseudo": "imf1922a", + "prenom": "Hawkins", + "nom": "PATTERSON", + "email": "hawkins.patterson@etu.iut-tlse3.fr", + "password": "7352c517-b8a1-4949-93e5-45ce6a70cca4", + "droits": "student" }, { - "name": "Irene Knapp", - "sexe": "female" + "pseudo": "gyy1983a", + "prenom": "Merrill", + "nom": "WALTER", + "email": "merrill.walter@etu.iut-tlse3.fr", + "password": "f47bd592-cfe8-4c62-b029-a258f8738b90", + "droits": "student" }, { - "name": "Frank Mckee", - "sexe": "male" + "pseudo": "otm1902a", + "prenom": "Woods", + "nom": "DEJESUS", + "email": "woods.dejesus@etu.iut-tlse3.fr", + "password": "e7799a36-d363-43fb-a72d-b218fb65d277", + "droits": "student" }, { - "name": "Tammy Pearson", - "sexe": "female" + "pseudo": "tnx1949a", + "prenom": "Dejesus", + "nom": "WALTON", + "email": "dejesus.walton@etu.iut-tlse3.fr", + "password": "ea7fb3b1-cd41-4945-8984-b2a43cd782f2", + "droits": "student" }, { - "name": "Sherrie Dawson", - "sexe": "female" + "pseudo": "sjl1937a", + "prenom": "English", + "nom": "POPE", + "email": "english.pope@etu.iut-tlse3.fr", + "password": "007a511b-058f-4921-aa0b-04eb6d4d5a5f", + "droits": "student" }, { - "name": "Guadalupe Richmond", - "sexe": "female" + "pseudo": "anj1991a", + "prenom": "Katie", + "nom": "GUTIERREZ", + "email": "katie.gutierrez@etu.iut-tlse3.fr", + "password": "c6a4e96b-3ba8-4a9a-bff6-955b6e14d689", + "droits": "student" }, { - "name": "Juarez Winters", - "sexe": "male" + "pseudo": "xdh1989a", + "prenom": "Rasmussen", + "nom": "PAGE", + "email": "rasmussen.page@etu.iut-tlse3.fr", + "password": "f04c06bd-6c24-44b8-9c16-80514f0df1ad", + "droits": "student" }, { - "name": "Wendi Ashley", - "sexe": "female" + "pseudo": "agl1956a", + "prenom": "Cruz", + "nom": "HOWE", + "email": "cruz.howe@etu.iut-tlse3.fr", + "password": "4028d5c1-6cfa-4224-82c9-588906a2d136", + "droits": "student" }, { - "name": "Turner Romero", - "sexe": "male" + "pseudo": "mhu1946a", + "prenom": "Edna", + "nom": "GREEN", + "email": "edna.green@etu.iut-tlse3.fr", + "password": "10aea3aa-4ec2-4b2b-9c92-f671d3d38f7f", + "droits": "student" }, { - "name": "England Cooper", - "sexe": "male" + "pseudo": "cvv1936a", + "prenom": "Kayla", + "nom": "CANTRELL", + "email": "kayla.cantrell@etu.iut-tlse3.fr", + "password": "948a9aa9-f1d5-41d9-9697-045a82bf7a3e", + "droits": "student" }, { - "name": "Merle Frye", - "sexe": "female" + "pseudo": "mzh1955a", + "prenom": "Leblanc", + "nom": "WHEELER", + "email": "leblanc.wheeler@etu.iut-tlse3.fr", + "password": "57757114-b1c4-4b66-9d5d-0c0ab076ec3d", + "droits": "student" }, { - "name": "Lindsay Ferguson", - "sexe": "female" + "pseudo": "pdi1904a", + "prenom": "Brady", + "nom": "ASHLEY", + "email": "brady.ashley@etu.iut-tlse3.fr", + "password": "62313578-4af5-453f-bb14-970c0dcd8842", + "droits": "student" }, { - "name": "Graham Carver", - "sexe": "male" + "pseudo": "cuk1947a", + "prenom": "Baxter", + "nom": "HERRERA", + "email": "baxter.herrera@etu.iut-tlse3.fr", + "password": "77db6fc0-b39a-4ee5-b0b7-be23e7dd28f6", + "droits": "student" }, { - "name": "Aline Green", - "sexe": "female" + "pseudo": "non1968a", + "prenom": "Foster", + "nom": "TILLMAN", + "email": "foster.tillman@etu.iut-tlse3.fr", + "password": "8c44e474-49a5-4135-b19a-865f449a768b", + "droits": "student" }, { - "name": "Lorna Clayton", - "sexe": "female" + "pseudo": "hmn1970a", + "prenom": "Levy", + "nom": "ARMSTRONG", + "email": "levy.armstrong@etu.iut-tlse3.fr", + "password": "ed432400-b0f9-42fb-aabb-d24a10147a94", + "droits": "student" }, { - "name": "Riley Hines", - "sexe": "male" + "pseudo": "hth1975a", + "prenom": "Pruitt", + "nom": "FERGUSON", + "email": "pruitt.ferguson@etu.iut-tlse3.fr", + "password": "eaf1645b-5eb3-40ed-9c7f-1d41cda82386", + "droits": "student" }, { - "name": "Wiggins Cain", - "sexe": "male" + "pseudo": "liw1940a", + "prenom": "Middleton", + "nom": "WATERS", + "email": "middleton.waters@etu.iut-tlse3.fr", + "password": "0f6f7e0a-9ecf-4ee8-b8b0-95dcbe57e94e", + "droits": "student" }, { - "name": "Compton Stevenson", - "sexe": "male" + "pseudo": "dtg1946a", + "prenom": "Ruiz", + "nom": "WILKERSON", + "email": "ruiz.wilkerson@etu.iut-tlse3.fr", + "password": "afc6fc1d-8695-4b5f-8f34-2ea17fdf85ae", + "droits": "student" }, { - "name": "Polly Byrd", - "sexe": "female" + "pseudo": "oxz1985a", + "prenom": "Paul", + "nom": "GROSS", + "email": "paul.gross@etu.iut-tlse3.fr", + "password": "c56b772c-a472-469a-8aec-fc26773826f2", + "droits": "student" }, { - "name": "Kasey Tate", - "sexe": "female" + "pseudo": "ono1984a", + "prenom": "Kitty", + "nom": "SANFORD", + "email": "kitty.sanford@etu.iut-tlse3.fr", + "password": "925f58ce-794b-4318-aa1f-51a03ca2bc4f", + "droits": "student" }, { - "name": "Benson Rocha", - "sexe": "male" + "pseudo": "auy1966a", + "prenom": "Bobbi", + "nom": "PRATT", + "email": "bobbi.pratt@etu.iut-tlse3.fr", + "password": "55b7b267-e7bc-4742-a0c2-71e910913c84", + "droits": "student" }, { - "name": "Rose Reeves", - "sexe": "female" + "pseudo": "dui1946a", + "prenom": "Burns", + "nom": "COMPTON", + "email": "burns.compton@etu.iut-tlse3.fr", + "password": "ccba19e5-a67e-458a-bcdb-d5565b3952a2", + "droits": "student" }, { - "name": "Lizzie Rose", - "sexe": "female" + "pseudo": "cyw1979a", + "prenom": "Zamora", + "nom": "RIDDLE", + "email": "zamora.riddle@etu.iut-tlse3.fr", + "password": "40160f4f-5fea-4648-b2d0-239db6d927b7", + "droits": "student" }, { - "name": "Rebecca Garcia", - "sexe": "female" + "pseudo": "pfv1965a", + "prenom": "Francine", + "nom": "COMBS", + "email": "francine.combs@etu.iut-tlse3.fr", + "password": "235ef6a4-02e2-4d50-b519-93b14fb1306a", + "droits": "student" }, { - "name": "York Crawford", - "sexe": "male" + "pseudo": "oqz1937a", + "prenom": "Morse", + "nom": "MICHAEL", + "email": "morse.michael@etu.iut-tlse3.fr", + "password": "8ec716fd-2479-4d1a-b436-c29ded017ad1", + "droits": "student" }, { - "name": "Harrison Jimenez", - "sexe": "male" + "pseudo": "aft1950a", + "prenom": "Rachel", + "nom": "DAVENPORT", + "email": "rachel.davenport@etu.iut-tlse3.fr", + "password": "8f0bf05c-acf6-4992-82c9-47aaa79c279b", + "droits": "student" + }, + { + "pseudo": "bae1943a", + "prenom": "Shaw", + "nom": "GOFF", + "email": "shaw.goff@etu.iut-tlse3.fr", + "password": "a3c8e161-da01-4eb2-b4bb-75bd6632d8a8", + "droits": "student" + }, + { + "pseudo": "kul1903a", + "prenom": "Magdalena", + "nom": "SIMON", + "email": "magdalena.simon@etu.iut-tlse3.fr", + "password": "d47aa9ea-2458-4954-9b3d-38a92fc95352", + "droits": "student" + }, + { + "pseudo": "rmj1965a", + "prenom": "Bridges", + "nom": "ROSALES", + "email": "bridges.rosales@etu.iut-tlse3.fr", + "password": "fc5c6d48-2296-48fd-b3f0-49f22c2af78e", + "droits": "student" + }, + { + "pseudo": "yyt1926a", + "prenom": "Bryant", + "nom": "CHANEY", + "email": "bryant.chaney@etu.iut-tlse3.fr", + "password": "a0a8c49b-13b5-42fd-b643-44e2aaf8cd65", + "droits": "student" + }, + { + "pseudo": "ktz1997a", + "prenom": "Mcgowan", + "nom": "COHEN", + "email": "mcgowan.cohen@etu.iut-tlse3.fr", + "password": "20ed35e7-a5b8-4ebd-8a7e-506f99ae20ac", + "droits": "student" + }, + { + "pseudo": "hku1995a", + "prenom": "Roslyn", + "nom": "MURPHY", + "email": "roslyn.murphy@etu.iut-tlse3.fr", + "password": "ff26b118-0c7e-428c-9a63-c31891366a1a", + "droits": "student" + }, + { + "pseudo": "zgy1948a", + "prenom": "Emily", + "nom": "ALVARADO", + "email": "emily.alvarado@etu.iut-tlse3.fr", + "password": "dc42abea-f17a-4172-bebe-33d25d0ebe8e", + "droits": "student" + }, + { + "pseudo": "vau1957a", + "prenom": "Kathy", + "nom": "STOUT", + "email": "kathy.stout@etu.iut-tlse3.fr", + "password": "75eb8158-e324-4f05-9176-db7c2cdb6cb0", + "droits": "student" + }, + { + "pseudo": "hsx1927a", + "prenom": "Irene", + "nom": "MONROE", + "email": "irene.monroe@etu.iut-tlse3.fr", + "password": "25db4cbf-0afc-4343-9909-4ffd96443b7a", + "droits": "student" + }, + { + "pseudo": "eca1977a", + "prenom": "Hope", + "nom": "WILSON", + "email": "hope.wilson@etu.iut-tlse3.fr", + "password": "f7623f39-c177-46f5-ad02-9a52e14ded1c", + "droits": "student" + }, + { + "pseudo": "wpa1966a", + "prenom": "Collier", + "nom": "ENGLISH", + "email": "collier.english@etu.iut-tlse3.fr", + "password": "e6e23a50-17d4-42ca-804c-d6331143d441", + "droits": "student" + }, + { + "pseudo": "qoe1974a", + "prenom": "Raquel", + "nom": "CUNNINGHAM", + "email": "raquel.cunningham@etu.iut-tlse3.fr", + "password": "bd420e39-5b69-4950-9638-eff22f293a00", + "droits": "student" + }, + { + "pseudo": "tkz1955a", + "prenom": "Nora", + "nom": "BREWER", + "email": "nora.brewer@etu.iut-tlse3.fr", + "password": "f19df613-1e90-432a-86fe-da18f629eaf2", + "droits": "student" + }, + { + "pseudo": "wnx1995a", + "prenom": "Lorraine", + "nom": "PADILLA", + "email": "lorraine.padilla@etu.iut-tlse3.fr", + "password": "c28316db-3b09-4749-8e4b-6127a4501fa8", + "droits": "student" + }, + { + "pseudo": "sft1994a", + "prenom": "Norris", + "nom": "BROCK", + "email": "norris.brock@etu.iut-tlse3.fr", + "password": "25f8ea48-770b-4f83-97d8-62dc9d85bf03", + "droits": "student" + }, + { + "pseudo": "vgb1979a", + "prenom": "Baird", + "nom": "FORD", + "email": "baird.ford@etu.iut-tlse3.fr", + "password": "4824985e-f5a3-4713-8c58-4c2256dd3e62", + "droits": "student" + }, + { + "pseudo": "wbt1993a", + "prenom": "Goodman", + "nom": "PAUL", + "email": "goodman.paul@etu.iut-tlse3.fr", + "password": "e005d13a-4bbe-4d23-9078-dcba9c59d9b6", + "droits": "student" + }, + { + "pseudo": "xtb1903a", + "prenom": "Kelly", + "nom": "FLYNN", + "email": "kelly.flynn@etu.iut-tlse3.fr", + "password": "22094e3b-af6d-4da3-bcde-b2c2c8ac5049", + "droits": "student" + }, + { + "pseudo": "msj1985a", + "prenom": "Ball", + "nom": "AVILA", + "email": "ball.avila@etu.iut-tlse3.fr", + "password": "b3106552-2158-4bc2-9fe8-84ea110e6d8d", + "droits": "student" + }, + { + "pseudo": "wvn1982a", + "prenom": "Sears", + "nom": "WELCH", + "email": "sears.welch@etu.iut-tlse3.fr", + "password": "8ce7381c-082f-4a2b-8d6d-0627977f14e6", + "droits": "student" + }, + { + "pseudo": "psg1965a", + "prenom": "Knapp", + "nom": "STEPHENS", + "email": "knapp.stephens@etu.iut-tlse3.fr", + "password": "f0123274-da67-47ec-8d2d-9a386f8f4303", + "droits": "student" + }, + { + "pseudo": "hpa1908a", + "prenom": "Jacklyn", + "nom": "BYRD", + "email": "jacklyn.byrd@etu.iut-tlse3.fr", + "password": "7f13f262-2785-4888-a1b2-2995254103c5", + "droits": "student" + }, + { + "pseudo": "maq1980a", + "prenom": "Cook", + "nom": "DUNN", + "email": "cook.dunn@etu.iut-tlse3.fr", + "password": "7d379650-7511-4c4c-896b-328c3d4549d8", + "droits": "student" + }, + { + "pseudo": "agq1929a", + "prenom": "Althea", + "nom": "POOLE", + "email": "althea.poole@etu.iut-tlse3.fr", + "password": "3713d843-72a0-482a-aaab-bd2764eb4df4", + "droits": "student" + }, + { + "pseudo": "gwe1975a", + "prenom": "Helen", + "nom": "HICKS", + "email": "helen.hicks@etu.iut-tlse3.fr", + "password": "d17c1b03-487a-4078-8670-16c89b97af7b", + "droits": "student" + }, + { + "pseudo": "gdb1939a", + "prenom": "Kate", + "nom": "NOEL", + "email": "kate.noel@etu.iut-tlse3.fr", + "password": "18f9fd7c-0192-4e65-a1d8-4dca7edac32e", + "droits": "student" + }, + { + "pseudo": "jrc1974a", + "prenom": "Pierce", + "nom": "CHURCH", + "email": "pierce.church@etu.iut-tlse3.fr", + "password": "82a37551-a563-4981-85ea-15fe50832fb1", + "droits": "student" + }, + { + "pseudo": "jfa1965a", + "prenom": "Lolita", + "nom": "FARRELL", + "email": "lolita.farrell@etu.iut-tlse3.fr", + "password": "bf1b2d0e-02a2-4c78-bf1b-2c7c36964d19", + "droits": "student" + }, + { + "pseudo": "buz1982a", + "prenom": "Kemp", + "nom": "JACOBS", + "email": "kemp.jacobs@etu.iut-tlse3.fr", + "password": "a7a14ee0-ae59-4442-a231-e7663575123c", + "droits": "student" + }, + { + "pseudo": "mhr1952a", + "prenom": "Socorro", + "nom": "BLAIR", + "email": "socorro.blair@etu.iut-tlse3.fr", + "password": "c4b4de9e-ce49-46d3-bd55-4d3be9447598", + "droits": "student" + }, + { + "pseudo": "pos1958a", + "prenom": "Juliana", + "nom": "FULLER", + "email": "juliana.fuller@etu.iut-tlse3.fr", + "password": "4b66d175-d740-41c5-a5d1-663a0840c728", + "droits": "student" + }, + { + "pseudo": "xdi1926a", + "prenom": "Ferrell", + "nom": "SALAS", + "email": "ferrell.salas@etu.iut-tlse3.fr", + "password": "61d323c5-e517-44fd-b9fa-fd145e2b2d62", + "droits": "student" + }, + { + "pseudo": "awl1901a", + "prenom": "Clare", + "nom": "ROLLINS", + "email": "clare.rollins@etu.iut-tlse3.fr", + "password": "be1afdea-248c-4b5b-b55d-6ba6bff09439", + "droits": "student" + }, + { + "pseudo": "uix1942a", + "prenom": "Kristen", + "nom": "GIBSON", + "email": "kristen.gibson@etu.iut-tlse3.fr", + "password": "2ed013f8-b881-4c76-a6e9-70f2716ddb42", + "droits": "student" + }, + { + "pseudo": "ngz1932a", + "prenom": "Faye", + "nom": "PAYNE", + "email": "faye.payne@etu.iut-tlse3.fr", + "password": "a78506a7-0b4e-4542-92ea-0585539eed14", + "droits": "student" + }, + { + "pseudo": "kpf1942a", + "prenom": "Strickland", + "nom": "ROACH", + "email": "strickland.roach@etu.iut-tlse3.fr", + "password": "d687a554-7e2e-4bd9-9858-12e4661a2959", + "droits": "student" + }, + { + "pseudo": "aiv1989a", + "prenom": "Concetta", + "nom": "ROBLES", + "email": "concetta.robles@etu.iut-tlse3.fr", + "password": "c45dda76-735b-4e05-b99d-10194403d323", + "droits": "student" + }, + { + "pseudo": "sjw1936a", + "prenom": "Cross", + "nom": "MEYERS", + "email": "cross.meyers@etu.iut-tlse3.fr", + "password": "f21bf5f1-918f-4b56-b9a0-861a4067505a", + "droits": "student" + }, + { + "pseudo": "fei1944a", + "prenom": "Esperanza", + "nom": "TERRELL", + "email": "esperanza.terrell@etu.iut-tlse3.fr", + "password": "8e011d85-ca8c-43bd-8706-21c099243a0c", + "droits": "student" + }, + { + "pseudo": "zge1937a", + "prenom": "Ella", + "nom": "GARZA", + "email": "ella.garza@etu.iut-tlse3.fr", + "password": "e68937a7-b587-453d-9aa9-bc7cc9aafb6f", + "droits": "student" + }, + { + "pseudo": "rpl1936a", + "prenom": "Tamera", + "nom": "MOSES", + "email": "tamera.moses@etu.iut-tlse3.fr", + "password": "92ba2ace-8d63-4cae-bcf1-f8c36d4a6368", + "droits": "student" + }, + { + "pseudo": "hrv1902a", + "prenom": "Irwin", + "nom": "HOUSTON", + "email": "irwin.houston@etu.iut-tlse3.fr", + "password": "4352ca7f-0391-43bf-8f2b-8df1337c46e8", + "droits": "student" + }, + { + "pseudo": "djo1928a", + "prenom": "Vaughn", + "nom": "DURHAM", + "email": "vaughn.durham@etu.iut-tlse3.fr", + "password": "bfe74f7f-936c-4e09-b348-d03f6cf8131b", + "droits": "student" + }, + { + "pseudo": "scm1996a", + "prenom": "Dotson", + "nom": "SANDOVAL", + "email": "dotson.sandoval@etu.iut-tlse3.fr", + "password": "5c5d2861-e968-4fdd-a975-20210f1d06a4", + "droits": "student" + }, + { + "pseudo": "ylq1926a", + "prenom": "Stein", + "nom": "SILVA", + "email": "stein.silva@etu.iut-tlse3.fr", + "password": "23dc5c90-4b08-4ea6-bf43-eb60d7ec7414", + "droits": "student" + }, + { + "pseudo": "eme1913a", + "prenom": "Booth", + "nom": "HENRY", + "email": "booth.henry@etu.iut-tlse3.fr", + "password": "1391a307-4181-46f3-8f52-424255ed3d84", + "droits": "student" + }, + { + "pseudo": "otv1930a", + "prenom": "Odonnell", + "nom": "BEASLEY", + "email": "odonnell.beasley@etu.iut-tlse3.fr", + "password": "8e079e14-d637-482c-9937-38d4d67c337d", + "droits": "student" + }, + { + "pseudo": "cda1951a", + "prenom": "Mcpherson", + "nom": "ANTHONY", + "email": "mcpherson.anthony@etu.iut-tlse3.fr", + "password": "27f6c12c-8aba-40a1-b918-5e1802dd0e57", + "droits": "student" + }, + { + "pseudo": "eee1933a", + "prenom": "Stacey", + "nom": "LITTLE", + "email": "stacey.little@etu.iut-tlse3.fr", + "password": "9c6fdab4-5cc4-4e8b-a28f-860c4a3c0a54", + "droits": "student" + }, + { + "pseudo": "kfx1995a", + "prenom": "Mitzi", + "nom": "SCHROEDER", + "email": "mitzi.schroeder@etu.iut-tlse3.fr", + "password": "2d6e7b0a-3c90-485e-a603-0b1a8748ce03", + "droits": "student" + }, + { + "pseudo": "jgd1966a", + "prenom": "Janelle", + "nom": "BURKS", + "email": "janelle.burks@etu.iut-tlse3.fr", + "password": "cbbf96b9-25fc-458c-b3ac-ff74fcf15afb", + "droits": "student" + }, + { + "pseudo": "rwg1909a", + "prenom": "Kelly", + "nom": "WALLACE", + "email": "kelly.wallace@etu.iut-tlse3.fr", + "password": "7ca32e62-b150-4135-a7d8-5eb72b9a2e8b", + "droits": "student" + }, + { + "pseudo": "ngw1997a", + "prenom": "Booker", + "nom": "LOPEZ", + "email": "booker.lopez@etu.iut-tlse3.fr", + "password": "866900e1-90eb-4a3b-9c48-6ef948483d52", + "droits": "student" + }, + { + "pseudo": "obg1973a", + "prenom": "Lynch", + "nom": "CHANDLER", + "email": "lynch.chandler@etu.iut-tlse3.fr", + "password": "9eb70aff-5b1b-4363-85cc-ecfa505dbd55", + "droits": "student" + }, + { + "pseudo": "hzg1935a", + "prenom": "Clarice", + "nom": "ORTEGA", + "email": "clarice.ortega@etu.iut-tlse3.fr", + "password": "ed5dbd13-a27b-4419-8045-4378c56df2bd", + "droits": "student" + }, + { + "pseudo": "iyh1918a", + "prenom": "Tucker", + "nom": "TRAN", + "email": "tucker.tran@etu.iut-tlse3.fr", + "password": "a8cdb727-0da8-4137-9c36-aaba530dc798", + "droits": "student" + }, + { + "pseudo": "tdc1978a", + "prenom": "Bird", + "nom": "TRAVIS", + "email": "bird.travis@etu.iut-tlse3.fr", + "password": "c8850d9a-a8cd-46ba-9771-2aeac5abe8c5", + "droits": "student" + }, + { + "pseudo": "swd1951a", + "prenom": "Jenny", + "nom": "GRAHAM", + "email": "jenny.graham@etu.iut-tlse3.fr", + "password": "167b942a-5d6c-40d7-b787-190aa19ebf71", + "droits": "student" + }, + { + "pseudo": "vdj1905a", + "prenom": "Dean", + "nom": "ESPINOZA", + "email": "dean.espinoza@etu.iut-tlse3.fr", + "password": "97b5fb5d-81c7-4d98-9a50-4bb356c53329", + "droits": "student" + }, + { + "pseudo": "bit1985a", + "prenom": "Rosalind", + "nom": "FISHER", + "email": "rosalind.fisher@etu.iut-tlse3.fr", + "password": "a457fdbc-a30c-4d38-8c2b-5595bd56eda2", + "droits": "student" + }, + { + "pseudo": "iah1936a", + "prenom": "Franklin", + "nom": "SLATER", + "email": "franklin.slater@etu.iut-tlse3.fr", + "password": "981c0270-fcfd-4e6f-9445-82ef2a703651", + "droits": "student" + }, + { + "pseudo": "ypt1989a", + "prenom": "Simon", + "nom": "MORALES", + "email": "simon.morales@etu.iut-tlse3.fr", + "password": "426aa049-96d7-4c24-9ef6-6021f373e47f", + "droits": "student" + }, + { + "pseudo": "ljc1902a", + "prenom": "Lisa", + "nom": "CLEMENTS", + "email": "lisa.clements@etu.iut-tlse3.fr", + "password": "815f43eb-9e1d-4392-ab3f-23be4cd15a7f", + "droits": "student" + }, + { + "pseudo": "hcc1997a", + "prenom": "Madeline", + "nom": "MARKS", + "email": "madeline.marks@etu.iut-tlse3.fr", + "password": "5d4e3567-32f7-4c94-b807-a02627d434c1", + "droits": "student" + }, + { + "pseudo": "bky1924a", + "prenom": "Gena", + "nom": "ENGLAND", + "email": "gena.england@etu.iut-tlse3.fr", + "password": "85a84b58-2809-41ec-9feb-975fe1c8d158", + "droits": "student" + }, + { + "pseudo": "vul1953a", + "prenom": "Robyn", + "nom": "BATES", + "email": "robyn.bates@etu.iut-tlse3.fr", + "password": "8817dcef-cd68-45b7-843e-394dd93d8c73", + "droits": "student" + }, + { + "pseudo": "ssr1906a", + "prenom": "Howell", + "nom": "FAULKNER", + "email": "howell.faulkner@etu.iut-tlse3.fr", + "password": "be683631-8f66-484f-b324-9a1494a35d5e", + "droits": "student" + }, + { + "pseudo": "yjh1944a", + "prenom": "Thompson", + "nom": "SOLIS", + "email": "thompson.solis@etu.iut-tlse3.fr", + "password": "9774f86d-42a7-4617-9227-ccd3f6d33f01", + "droits": "student" + }, + { + "pseudo": "ste1994a", + "prenom": "Allison", + "nom": "CALLAHAN", + "email": "allison.callahan@etu.iut-tlse3.fr", + "password": "836461f5-f10d-47ff-9158-bb0b143a62f3", + "droits": "student" + }, + { + "pseudo": "ypo1964a", + "prenom": "Marylou", + "nom": "HOPKINS", + "email": "marylou.hopkins@etu.iut-tlse3.fr", + "password": "932b8588-b836-4872-bc7f-778194e7b859", + "droits": "student" } ] \ No newline at end of file diff --git a/xdoc/generateur_100_etudiants.php b/xdoc/generateur_100_etudiants.php new file mode 100644 index 0000000..b0539c6 --- /dev/null +++ b/xdoc/generateur_100_etudiants.php @@ -0,0 +1,94 @@ +level_1 = 'create'; + + $request2 = new stdClass(); + $request2->level_1 = 'add'; + + + foreach($user as $k=>$v) + switch($k){ + case 'pseudo': $request1->username = $v; break; + case 'prenom': $request1->prenom = $v; break; + case 'nom': $request1->nom = $v; break; + case 'email': $request1->email = $v; break; + case 'password': $request1->password = sha1($v); break; + case 'droits': $request1->droits = $v; break; + } + + user_switch_level_1($request1, $answer1); + + echo $request1->username; + + if( $answer1->request == 'success' ){ + + /* AJOUT A UN GROUPE */ + $request2->utilisateur = $request1->username; // utilisateur.username + $request2->groupe = chr(rand(65,70)); // groupe entre A - F + + groups_switch_level_1($request2, $answer2); + echo 'yeah'; + + if( $answer2->request == 'success' ) + echo '['.$request2->groupe.']
'; + else + echo '[ERROR_2: '.$answer2->request.']
'; + + }else + echo ' [ERROR_1: '.$answer1->request.']
'; + +} + + + + + +// user_switch_level_1($request, $answer); + + + +// echo var_dump( $answer ); + +// echo '






It works !'; + + + + + +/*** AJOUT D'UN UTILISATEUR À UN GROUPE ***/ + +// + +// $request = new stdClass(); +// $answer = new stdClass(); + +// $request->level_1 = 'add'; +// $request->utilisateur = 'fvg1856a'; // utilisateur.username +// $request->groupe = 'A'; // groupe.nom + + +// groups_switch_level_1($request, $answer); + +// echo var_dump( $answer ); + +// echo "






It works !"; + + +?> \ No newline at end of file diff --git a/xdoc/json_generator b/xdoc/json_generator new file mode 100644 index 0000000..8d7751e --- /dev/null +++ b/xdoc/json_generator @@ -0,0 +1,17 @@ +/*************************/ +/* GENERER 100 étudiants */ +/*************************/ + +[ + '{{repeat(100)}}', + { + pseudo: function(tags){ + return String.fromCharCode(tags.integer(97,122)) + String.fromCharCode(tags.integer(97,122)) + String.fromCharCode(tags.integer(97,122)) + tags.integer(1900,1999) + 'a'; + }, + prenom: function(tags){ return tags.firstName(); }, + nom: function(tags){ return tags.surname().toUpperCase(); }, + email: function(){ return (this.prenom +'.'+ this.nom +'@etu.iut-tlse3.fr').toLowerCase(); }, + password: '{{guid()}}', + droits: 'student' + } +] \ No newline at end of file