mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 11:26:04 +01:00
Post merge conflicts
This commit is contained in:
@@ -383,6 +383,7 @@ class AdminPlugin extends Plugin
|
|||||||
// Create user object and save it
|
// Create user object and save it
|
||||||
$user = $users->load($username);
|
$user = $users->load($username);
|
||||||
$user->update($data);
|
$user->update($data);
|
||||||
|
$user->set('access', ['admin' => ['login' => true, 'super' => true], 'site' => ['login' => true]]);
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
// Login user
|
// Login user
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Grav\Plugin\Admin;
|
|
||||||
|
|
||||||
use Grav\Common\Processors\ProcessorBase;
|
|
||||||
use Psr\Http\Message\ResponseInterface;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
|
||||||
use Psr\Http\Server\RequestHandlerInterface;
|
|
||||||
|
|
||||||
class Router extends ProcessorBase
|
|
||||||
{
|
|
||||||
public $id = 'admin_router';
|
|
||||||
public $title = 'Admin Panel';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Admin router.
|
|
||||||
*
|
|
||||||
* @param ServerRequestInterface $request
|
|
||||||
* @param RequestHandlerInterface $handler
|
|
||||||
* @return ResponseInterface
|
|
||||||
*/
|
|
||||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
|
|
||||||
{
|
|
||||||
$this->startTimer();
|
|
||||||
$response = $handler->handle($request);
|
|
||||||
$this->stopTimer();
|
|
||||||
|
|
||||||
// Never allow admin pages to be rendered in <frame>, <iframe>, <embed> or <object> for improved security.
|
|
||||||
return $response->withHeader('X-Frame-Options', 'NONE');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2536,11 +2536,10 @@ class AdminController extends AdminBaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->uri = $this->uri ?? $this->grav['uri'];
|
$this->uri = $this->uri ?? $this->grav['uri'];
|
||||||
$this->grav['twig']->twig_vars['current_form_data'] = (array)$this->data;
|
|
||||||
|
|
||||||
$field = (string)$this->uri->post('field', '');
|
$field = (string)$this->uri->post('field', '');
|
||||||
$order = $this->uri->post('order') ?: null;
|
$order = $this->uri->post('order') ?: null;
|
||||||
if (!is_array($order)) {
|
if ($order && is_string($order)) {
|
||||||
$order = array_map('trim', explode(',', $order));
|
$order = array_map('trim', explode(',', $order));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class Router extends ProcessorBase
|
|||||||
|
|
||||||
$this->stopTimer();
|
$this->stopTimer();
|
||||||
|
|
||||||
return $response;
|
// Never allow admin pages to be rendered in <frame>, <iframe>, <embed> or <object> for improved security.
|
||||||
|
return $response->withHeader('X-Frame-Options', 'NONE');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user