static function page_protect($url_redirection='../src/login.php') { if(!CLogin::est_logue()) { CFunction::redirection($url_redirection); } else if(!CTableUser::is_admin($_SESSION['idmbr'])) { if(!in_array(basename($_SERVER['SCRIPT_NAME']), array('categorie.php', 'article.php', 'page.php', 'fichier.php', 'dossier.php', 'login.php', 'index.php', 'menu_semaine.php', 'image_menu.php'))) { CFunction::redirection('../src/index.php'); } } }
<link href="../css/menu.css" rel="stylesheet" type="text/css" /> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> </head> <body> <?php /*------------------------------------------------------ IMPORTATIONS --------------------------------------------------------*/ ?> <!-- InstanceBeginEditable name="php" --> <?php /*--------------------------------------------------------------------- PROTECTION : permet de proteger la page avec session ----------------------------------------------------------------------*/ CLogin::page_protect(); /*-------------------------------------------------------------------- INITIALISATIONS ----------------------------------------------------------------------*/ $a = 0; $order = 'rang'; $etat = 0; $id = 0; $rang = 0; $idreda = $_SESSION['idmbr']; $url_dest = SS_ADMIN_TO_USERFILE . '/userfiles/image/diaporama'; $idlecteur = 'all'; $error_type = 0; $msginfo = ''; $image = '';
$tart= new CTableArticle(array('nom'=>CFunction::addslashes($nom), 'etat'=>$etat, 'idcat'=>$idcat)); $tart->insert(); $msginfo = "sous-menu bien ajouté"; $a = 0; break; case 5 : // Modifier 1 if(!empty($_GET['id'])) $id = $_GET['id']; $tart= new CTableArticle(array('id'=>$id)); $art = $tart->select_row(); $nom = $art ['nom']; $etat = $art ['etat']; $idcat = $art ['idcat']; $idreda = CBdd::select_one("SELECT idreda FROM article_cat WHERE id = ".$id, 'idreda'); if(!CLogin::protect_action($idreda)) { $a = 0; $msginfo = 'Action non autorisée'; } break; case 55 : // Modifier 2 if(!empty($_POST['id'])) $id = $_POST['id']; if(!empty($_POST['nom'])) $nom = trim($_POST['nom']); if(!empty($_POST['etat'])) $etat = $_POST['etat']; if(!empty($_POST['idcat'])) $idcat = $_POST['idcat']; if ($nom=="") { $error_type = 1; $error_signe['nom'] = "*";
<?php session_start(); require_once 'include/login.inc.php'; require_once 'include/core.inc.php'; if (isset($_POST['submit'])) { $username = $_POST['username']; $password = $_POST['password']; if ($username != "" and $password != "") { $login = new CLogin($username, $password); if ($login->getUser()) { if ($login->isAuthentiated()) { $_SESSION['user'] = $login->getUser(); header('refresh:0;admin.php'); exit; } else { popup("Sorry", "{$username},your password is incorrect!"); } } else { popup('Sorry', 'Your username is incorrect!'); } } else { popup('Sorry', "Username or password can't be empty!", 'warning'); } } ?> <html> <head> <title>Google Students Club</title> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<?php session_start(); require_once 'include/login.inc.php'; require_once 'include/table.inc.php'; require_once 'include/feedback.inc.php'; if (isset($_SESSION['user'])) { $login = new CLogin($_SESSION['user']['username'], $_SESSION['user']['password']); if (!$login->isAuthentiated()) { header('refresh:0;index.php'); } else { $user = $_SESSION['user']; } } else { header('refresh:0;index.php'); } ?> <html> <head> <title>Feedback</title> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <!--CSS--> <link href="css/bootstrap.min.css" type="text/css" rel="stylesheet"/> <link href="css/jquery.dialog.css" type="text/css" rel="stylesheet"/> <link href="css/jquery.dataTables.min.css" type="text/css" rel="stylesheet"/> <link href="css/dataTables.bootstrap.min.css" type="text/css" rel="stylesheet"/> <link href="css/feedback.css" type="text/css" rel="stylesheet"/>
<div id="mainwrap"> <div id="header"><?php include("../nav/header.php"); ?></div> <div id="top"><?php include("../nav/menu_h.php"); ?></div> <div id="filet"> <div id="zonetitre"> <div id="signe"></div> <div id="titre"><!-- InstanceBeginEditable name="titre" -->Login<!-- InstanceEndEditable --></div> </div> </div> <div id="contentarea"> <div id="left"><?php include("../nav/menu_g.php"); ?></div> <div id="center"> <div id="page"><!-- InstanceBeginEditable name="page" --><!-- InstanceEndEditable --></div> <div id="over"><!-- InstanceBeginEditable name="over" --><?php echo $errmsg_lg ?><!-- InstanceEndEditable --></div> <div id="main"><!-- InstanceBeginEditable name="main" --> <?php if(!CLogin::est_logue()) { ?> <div id="login"> <form action="" method="post" id="form_lg"> <p> <label>Saisir le login </label> <input name="login_lg" type="text" <?php echo $login_lg ?> /></p> <p> <label>Mot de passe</label> <input name="passe_lg" type="password" <?php echo $passe_lg ?> /></p> <p> <input name="submit_lg" type="submit" value="Ouvrir session >>"/> </p> </form> </div> <?php } ?> <!-- InstanceEndEditable --></div>
<div id="menu_h"> <ul> <li> <?php echo CLogin::show_user(); ?> </li> </ul> </div>