Add nonce to GravAdmin.config.admin_nonce to be used by JS. Drop jQuery DOM references to #admin-nonce

This commit is contained in:
Flavio Copes
2015-11-21 16:15:23 +01:00
parent fe69322279
commit e6cddea054
4 changed files with 18 additions and 5 deletions

View File

@@ -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
*