%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/sedl.alnetis.fr/public_html/test/
Upload File :
Create Path :
Current File : /home/alliance/domains/sedl.alnetis.fr/public_html/test/a-connexion.php

<?php
include_once("inc/config.php");
include_once("inc/functions.php");
include_once("inc/session.php");
include_once("inc/init.php");

if(isset($_POST['post']) && $_POST['post'] == 1)
{
	$db = new BaseOps;
	$erreur = $db->verif($_POST['email'], "L'adresse email", 2);
	if($erreur == "ok") $erreur = $db->verif($_POST['password'], "Le mot de passe");
	if($erreur == "ok")
	{
		$_POST['email'] = $db->inputText2Sql($_POST['email']);
		$_POST['password'] = $db->inputText2Sql($_POST['password']);

		$query = "SELECT * FROM `user` WHERE email = '".$_POST['email']."'";
		$data = $db->select_array($query);
		if ($data['password'] != md5("amicalesite".$_POST['password']))
		{
			$erreur = "Erreur de connexion : Vos identifiants sont incorrects";
			$err = true;
		}
		else {
			$actual_edition=$edition->getCurrentEdition("ins",$lang->getlangid());
			
			// remplissage de la session
			$_SESSION['id'] = $data['id'];
			$_SESSION['password'] = $data['password'];
			$_SESSION['type'] = $data['type'];
			if($data['type']==1){
				$_SESSION['section']=$data['section'];
			}
			$_SESSION['lang'] = $data['lang'];
			$_SESSION['logged'] = true;
			
			$_SESSION['edition_admin']=$actual_edition['id'];
			
			$yes = true;
			if($_SESSION['type']==1){
				header('Refresh: 5; URL= ../../admin/editer_section.php?id='.$_SESSION['section']); 
			}
			else{
				header('Refresh: 5; URL= .'); 
			}
		}
	}
	else {
		$err = true;
	}
}

//affichage du html
include("theme/html.php");
//affichage des metas
include("theme/meta.php");
echo "\n<title>".lang("Connexion")." - ".$info_titresite."</title>\n";
//affichage du header
if(estadmin()){
	include("theme/header_admin.php");
}
else if (estco()) {
	include("theme/header_redacteur.php");
}
else {
	include("theme/header_noconnect.php");
}
?>

<div class="text_admin">
<h2><?=lang("Connexion")?></h2>
<p><?=lang("connex2")?></p>
<?php
if(!isset($_POST['email'])){$_POST['email']="";}
if(!isset($_POST['password'])){$_POST['password']="";}
if(isset($err)) {
	echo "<p class=\"erreurbloc\">".$erreur."</p>";
}
if(isset($yes)) {
	echo "<p class=\"infobloc\">".lang("connexok")."</p>";
}
else {
?>
<form action="<?=$lang->getlang()?>/admin/connexion.php" method="post" class="form">
	<table>
		<tr>
			<td class="label"><?=lang("email")?> <span class="etoile">*</span></td>
			<td class="field"><input type="text" name="email" value="<?php echo $_POST['email']; ?>" /></td>
		</tr>
		<tr>
			<td class="label"><?=lang("passw")?> <span class="etoile">*</span></td>
			<td class="field"><input type="password" name="password" value="<?php echo $_POST['password']; ?>" /></td>
		</tr>
	</table>
	<div class="form_bouton">
		<input type="hidden" name="post" value="1" />
		<input type="submit" class="bouton" id="maj_bouton" value="<?=lang("Connexion")?>" />
	</div>
	<p><?=lang("passwoubli")?> <a href="<?=$lang->getlang()?>/admin/password.php"><?=lang("clic")?></a>.</p>
</form>
<?php } ?>
</div>

<?

//affichage du footer
include("theme/footer.php");

?>

Zerion Mini Shell 1.0