113 lines
4.4 KiB
PHP
113 lines
4.4 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
// Inclusion des librairie
|
|
require_once ('../lib/aeos.lib.php');
|
|
require_once ('../lib/config.lib.php');
|
|
require_once ('../lib/var.lib.php');
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<title><?php echo AEOS_NAME; ?></title>
|
|
<meta name="description" content="<?php echo AEOS_DESC; ?>" />
|
|
<link rel="stylesheet" type="text/css" media="screen" href="../themes/system/styles.css" />
|
|
<link rel="stylesheet" type="text/css" media="screen" href="../themes/system/css/fontello.css" />
|
|
<script type="text/javascript" src="pell/pell.min.js"></script>
|
|
<link rel="icon" type="image/png" href="../themes/<?php echo AEOS_THEME; ?>/images/favicon_aeos.ico" />
|
|
<?php echo checkFiles(AEOS_MODULE.'/'.AEOS_THEME, 0, $subdir)["Data"]; ?>
|
|
</head>
|
|
<?php if(!isset($_SESSION['_LOGIN'])){ ?>
|
|
<body>
|
|
<div id="Administration">
|
|
<h1>
|
|
<img src="../themes/system/images/aeos_logo_A_blanc.png" alt=" <?php echo $lang["login_SecurePanel"]; ?>" />
|
|
</h1>
|
|
<?php
|
|
switch(@$_['o'])
|
|
{
|
|
case 'lostPassword':
|
|
if (isset($_['email']))
|
|
{
|
|
// User exists ? Email matches ?
|
|
if(isset($config['configuration']['users'][$_['login']]) && strtolower($config['configuration']['users'][$_['login']]['email']['#text']) == strtolower($_['email']))
|
|
{
|
|
$generatedPassword = generateEasyPassword(12);
|
|
$generatedPassword = password_hash($generatedPassword,PASSWORD_DEFAULT);
|
|
sendMail(AEOS_NAME, $config['configuration']['users'][$_['login']]['email']['#text'], $lang['mail_passwordBack'], $lang['mail_newPassword']." ".$generatedPassword);
|
|
ecriture_xml('../data/config.xml', array('configuration/users/'.$_['login'].'/password'=>$generatedPassword));
|
|
?><div class='notification valide'><p><i class="icon-emo-happy"></i> <?php echo $lang['mailSentToYou']; ?></p></div><?php
|
|
}
|
|
else { ?><div class='notification error'><p><i class="icon-emo-unhappy"></i> <?php echo $lang['wrongLoginEmail']; ?></p></div><?php }
|
|
}
|
|
|
|
?>
|
|
<div class="form">
|
|
<form class="login-form" action="index.php?o=lostPassword" method="POST">
|
|
<input type="text" name="login" placeholder="<?php echo $lang["login_Username"]; ?>"/>
|
|
<input type="email" name="email" placeholder="<?php echo $lang["mailAddress"]; ?>"/>
|
|
<button><?php echo $lang["login_sendNewPassword"]; ?></button>
|
|
<p class="message">
|
|
<a href="index.php"><?php echo $lang["cancel"]; ?></a>
|
|
</p>
|
|
</form>
|
|
</div>
|
|
<?php
|
|
break;
|
|
|
|
default:
|
|
?>
|
|
<div class="form">
|
|
<form class="login-form" action="index.php" method="POST">
|
|
<input type="text" name="login" placeholder="<?php echo $lang["login_Username"]; ?>"/>
|
|
<input type="password" name="password" placeholder="<?php echo $lang["login_Password"]; ?>"/>
|
|
<button><i class="icon-login"></i><?php echo $lang["login_Connexion"]; ?></button>
|
|
<p class="message">
|
|
<a href="index.php?o=lostPassword"><?php echo $lang["login_ForgotPassword"]; ?></a>
|
|
</p>
|
|
</form>
|
|
</div>
|
|
|
|
<?php
|
|
if(isset($_['login']) && isset($_['password']))
|
|
{
|
|
// User exists ? Password matches ?
|
|
if(isset($config['configuration']['users'][$_['login']]) && password_verify($_['password'], $config['configuration']['users'][$_['login']]['password']['#text']))
|
|
{
|
|
$_SESSION['_LOGIN'] = $_['login'];
|
|
//$_SESSION['_PASSWORD'] = $_['password'];
|
|
header('Location: index.php');
|
|
}
|
|
else { ?><div class='notification error'><p><i class="icon-emo-unhappy"></i> <?php echo $lang['wrongLoginPassword']; ?></p></div><?php }
|
|
}
|
|
}
|
|
?>
|
|
|
|
|
|
<div id="Footer">
|
|
<img src="../themes/system/images/logo_a4_300.png" width="250" alt="Logo" />
|
|
<p>
|
|
AEOS v<?php echo AEOS_VERSION; ?> - <?php echo $lang["footer_version_loved"]; ?>
|
|
</p>
|
|
<hr />
|
|
<h5><?php echo AEOS_BRANCH; ?>/version_<?php echo AEOS_UPDATE; ?>.zip</h5>
|
|
<p class="copyright"><?php echo $lang["login_msg_Layus"]; ?></p>
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
<?php } else
|
|
{
|
|
$returned = checkFiles(AEOS_MODULE.'/'.AEOS_THEME, 1, $subdir);
|
|
if($returned['OB'])
|
|
{
|
|
ob_start();
|
|
include_once('base.php');
|
|
$eyecatcher = ob_get_clean();
|
|
echo insertPlugins($eyecatcher, $returned);
|
|
}
|
|
else require_once('base.php');
|
|
} ?>
|
|
</html>
|