mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
Add token to themes installation.
Only webmasters can install new plugins, themes or languages. git-svn-id: http://piwigo.org/svn/trunk@5406 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+18
-8
@@ -53,15 +53,24 @@ if (!is_writable($themes_dir))
|
||||
// | perform installation |
|
||||
// +-----------------------------------------------------------------------+
|
||||
|
||||
if (isset($_GET['revision']) and isset($_GET['extension']) and !is_adviser())
|
||||
if (isset($_GET['revision']) and isset($_GET['extension']))
|
||||
{
|
||||
$install_status = $themes->extract_theme_files(
|
||||
'install',
|
||||
$_GET['revision'],
|
||||
$_GET['extension']
|
||||
);
|
||||
|
||||
redirect($base_url.'&installstatus='.$install_status);
|
||||
if (!is_webmaster())
|
||||
{
|
||||
array_push($page['errors'], l10n('Webmaster status is required.'));
|
||||
}
|
||||
else
|
||||
{
|
||||
check_pwg_token();
|
||||
|
||||
$install_status = $themes->extract_theme_files(
|
||||
'install',
|
||||
$_GET['revision'],
|
||||
$_GET['extension']
|
||||
);
|
||||
|
||||
redirect($base_url.'&installstatus='.$install_status);
|
||||
}
|
||||
}
|
||||
|
||||
// +-----------------------------------------------------------------------+
|
||||
@@ -112,6 +121,7 @@ if ($themes->get_server_themes(true)) // only new themes
|
||||
$url_auto_install = htmlentities($base_url)
|
||||
. '&revision=' . $theme['revision_id']
|
||||
. '&extension=' . $theme['extension_id']
|
||||
. '&pwg_token='.get_pwg_token()
|
||||
;
|
||||
|
||||
$template->append(
|
||||
|
||||
Reference in New Issue
Block a user