1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-12 16:14:16 +02:00

Admin plugin #3 General Updates

This commit is contained in:
Awilum
2018-04-04 17:10:45 +03:00
parent 40fed19ade
commit f3b710c56d
2 changed files with 15 additions and 6 deletions

View File

@@ -17,6 +17,7 @@ use Url;
use Arr;
use Response;
use Request;
use Symfony\Component\Yaml\Yaml;
//
// Add listner for onPageBeforeRender event
@@ -109,8 +110,17 @@ class Admin {
protected static function getAuthPage()
{
if (Request::post('login_submit')) {
$login = Request::post('login');
if (isset($login)) {
if (Flextype::filesystem()->exists($_user_file = ACCOUNTS_PATH . '/' . Request::post('username') . '.yml')) {
$user_file = Yaml::parseFile($_user_file);
}
var_dump($user_file);
}
include 'views/login.php';

View File

@@ -14,14 +14,13 @@
<!-- Custom styles for this template -->
<link href="<?php echo Url::getBase(); ?>/site/plugins/admin/css/auth.css" rel="stylesheet">
</head>
<body class="text-center">
<form class="form-signin">
<form class="form-signin" method="post">
<label for="inputUsername" class="sr-only"><?php echo Flextype\I18n::find('admin_username', 'admin', Flextype\Config::get('site.locale')); ?></label>
<input type="input" id="inputUsername" class="form-control" placeholder="<?php echo Flextype\I18n::find('admin_username', 'admin', Flextype\Config::get('site.locale')); ?>" required autofocus>
<input type="input" name="username" id="inputUsername" class="form-control" placeholder="<?php echo Flextype\I18n::find('admin_username', 'admin', Flextype\Config::get('site.locale')); ?>" required autofocus>
<label for="inputPassword" class="sr-only"><?php echo Flextype\I18n::find('admin_password', 'admin', Flextype\Config::get('site.locale')); ?></label>
<input type="password" id="inputPassword" class="form-control" placeholder="<?php echo Flextype\I18n::find('admin_password', 'admin', Flextype\Config::get('site.locale')); ?>" required>
<button class="btn btn-lg btn-dark btn-block" name="login_submit" type="submit"><?php echo Flextype\I18n::find('admin_login', 'admin', Flextype\Config::get('site.locale')); ?></button>
<input type="password" name="password" id="inputPassword" class="form-control" placeholder="<?php echo Flextype\I18n::find('admin_password', 'admin', Flextype\Config::get('site.locale')); ?>" required>
<button class="btn btn-lg btn-dark btn-block" name="login" type="submit"><?php echo Flextype\I18n::find('admin_login', 'admin', Flextype\Config::get('site.locale')); ?></button>
</form>
</body>
</html>