<?php error_reporting('none'); require_once 'orchestra/loginManager.class.php'; $loginManager = new loginManager(); // jamais ça doit arriver en login manager, DEMO PURPOSE ONLY comme on dit $periods = $loginManager->getAllPeriod(); $rtn = array('state' => true, 'periods' => array()); foreach ($periods as $value) { array_push($rtn['periods'], array('id' => $value[0], 'name' => $value[1], 'date_begin' => '2012-12-12 00:00:00', 'date_end' => '2012-12-12 00:00:00', 'can_edit' => true, 'can_del' => (bool) rand(0, 1), 'disable_edit_name' => true, 'disable_edit_date_begin' => true, 'disable_edit_date_end' => false)); } echo json_encode($rtn);
<?php error_reporting('none'); require_once "orchestra/loginManager.class.php"; define('ARGUMENT_ERROR', 'ARGUMENT_ERROR'); // TODO virer ça autre part $loginManagerB = new loginManager('BADMIN'); $loginManagerF = new loginManager('FADMIN'); switch ($_POST['action']) { case 'add': // connexion if (!isset($_POST['login']) or !isset($_POST['password'])) { $rtn = array('state' => false, 'error' => ARGUMENT_ERROR); break; } $rtn = $loginManagerB->login($_POST['login'], $_POST['password']); if ($rtn['state'] == false) { break; } $rtn = $loginManagerF->login($_POST['login'], $_POST['password']); break; case 'deco': $loginManagerB->disconnect(); $loginManagerF->disconnect(); $rtn = array('state' => true); break; default: $rtn = array('state' => false, 'error' => ARGUMENT_ERROR); } if ($rtn['state'] == false && !isset($rtn['error'])) { $rtn['error'] = $loginManager->getError();
<?php require_once "include/Page.class.php"; require_once "include/tools.php"; // DEBUT du contenu specifique require_once "orchestra/loginManager.class.php"; $loginManager = new loginManager(); $page = new Page("Connexion"); $page->topMenu(); $sideMenu = array(array("Groupes", array(array("Ajouter un nouveau groupe", "?action=add")))); $page->sideMenu($sideMenu); if (isset($_POST["submit"])) { if (isset($_POST['login']) and isset($_POST['pwd'])) { $retourLogin = $loginManager->login($_POST['login'], $_POST['pwd']); //si OK if ($retourLogin == 1) { $page->showInfo("Te voila connecte !"); } else { //le hic, c'est qu'on n'a pas d'erreur format incorrect dans la BDD if ($retourLogin == 0) { $page->showError("Le code PIN, c'est en chiffres !"); } else { $page->showError($loginManager->getErrorDetail($retourLogin)); } showFormulaire(); } } } else { showFormulaire(); } /*