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

Admin Panel - Slim Integration - next round of integration

This commit is contained in:
Awilum
2019-03-19 23:29:02 +03:00
parent 336c737411
commit 8827b0bcd6
3 changed files with 43 additions and 8 deletions

View File

@@ -4,6 +4,47 @@ namespace Flextype;
use Flextype\Component\Registry\Registry;
use Slim\Http\Request;
use Slim\Http\Response;
$app->get('/admin/information', function (Request $request, Response $response, array $args) {
if (function_exists('apache_get_modules')) {
if (!in_array('mod_rewrite', apache_get_modules())) {
$apache_mod_rewrite_installed = false;
} else {
$apache_mod_rewrite_installed = true;
}
} else {
$apache_mod_rewrite_installed = true;
}
if (!function_exists('password_hash')) {
$password_hash_installed = false;
} else {
$password_hash_installed = true;
}
if (!function_exists('password_verify')) {
$password_verify_installed = false;
} else {
$password_verify_installed = true;
}
return $this->view->render($response,
'plugins/admin/views/templates/system/information/index.html', [
'menu_item' => 'information',
'php_uname' => php_uname(),
'webserver' => isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : @getenv('SERVER_SOFTWARE'),
'php_sapi_name' => php_sapi_name(),
'apache_mod_rewrite_installed' => $apache_mod_rewrite_installed,
'password_verify_installed' => $password_verify_installed,
'password_hash_installed' => $password_hash_installed
]);
})->setName('information');
class InformationManager
{
public static function getInformationManager()

View File

@@ -16,7 +16,6 @@ use Slim\Http\Response;
$app->get('/admin/plugins', function (Request $request, Response $response, array $args) {
return $this->view->render($response,
'plugins/admin/views/templates/extends/plugins/index.html', [
'registry' => $this->get('registry')->dump(),
'plugins_list' => $this->get('registry')->get('plugins'),
'menu_item' => 'plugins'
]);

View File

@@ -13,15 +13,12 @@ use Slim\Http\Response;
$app->get('/admin/login', function (Request $request, Response $response, array $args) {
return $this->view->render($response,
'plugins/admin/views/templates/users/login.html', [
'registry' => $this->get('registry')->dump()
]);
'plugins/admin/views/templates/users/login.html');
})->setName('login');
$app->get('/admin/profile', function (Request $request, Response $response, array $args) {
return $this->view->render($response,
'plugins/admin/views/templates/users/profile.html', [
'registry' => $this->get('registry')->dump(),
'username' => Session::get('username'),
'rolename' => Session::get('role'),
'sidebar_menu_item' => 'profile'
@@ -35,9 +32,7 @@ $app->get('/admin/logout', function (Request $request, Response $response, array
$app->get('/admin/registration', function (Request $request, Response $response, array $args) {
return $this->view->render($response,
'plugins/admin/views/templates/users/registration.html', [
'registry' => $this->get('registry')->dump()
]);
'plugins/admin/views/templates/users/registration.html');
})->setName('registration');
$app->post('/admin/registration', function (Request $request, Response $response, array $args) {