mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-12-27 02:40:48 +01:00
Add nonce to GravAdmin.config.admin_nonce to be used by JS. Drop jQuery DOM references to #admin-nonce
This commit is contained in:
@@ -12,6 +12,7 @@ use Grav\Common\Plugins;
|
||||
use Grav\Common\Themes;
|
||||
use Grav\Common\Uri;
|
||||
use Grav\Common\User\User;
|
||||
use Grav\Common\Utils;
|
||||
use RocketTheme\Toolbox\File\File;
|
||||
use RocketTheme\Toolbox\File\JsonFile;
|
||||
use RocketTheme\Toolbox\File\LogFile;
|
||||
@@ -703,6 +704,17 @@ class Admin
|
||||
return $parent_route;
|
||||
}
|
||||
|
||||
/**
|
||||
* Static helper method to return the admin form nonce
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getNonce()
|
||||
{
|
||||
$action = 'admin-form';
|
||||
return Utils::getNonce($action);
|
||||
}
|
||||
|
||||
/**
|
||||
* Static helper method to return the last used page name
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user