aboutsummaryrefslogtreecommitdiffstats
path: root/admin/plugins_new.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2010-03-27 17:32:45 +0000
committerpatdenice <patdenice@piwigo.org>2010-03-27 17:32:45 +0000
commit66d2cd6ec2e61dac3ccd0003294370d8035dc900 (patch)
treeefd87d6a7975143fe25563e2a7f15d25c9dc5031 /admin/plugins_new.php
parent0b38088a7e860bbfe64c5b2726859607eb086d2d (diff)
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
Diffstat (limited to 'admin/plugins_new.php')
-rw-r--r--admin/plugins_new.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/admin/plugins_new.php b/admin/plugins_new.php
index d699e57d9..8fa3e0ac9 100644
--- a/admin/plugins_new.php
+++ b/admin/plugins_new.php
@@ -36,13 +36,20 @@ $base_url = get_root_url().'admin.php?page='.$page['page'].'&order='.$order;
$plugins = new plugins();
//------------------------------------------------------automatic installation
-if (isset($_GET['revision']) and isset($_GET['extension']) and !is_adviser())
+if (isset($_GET['revision']) and isset($_GET['extension']))
{
- check_pwg_token();
-
- $install_status = $plugins->extract_plugin_files('install', $_GET['revision'], $_GET['extension']);
+ if (!is_webmaster())
+ {
+ array_push($page['errors'], l10n('Webmaster status is required.'));
+ }
+ else
+ {
+ check_pwg_token();
+
+ $install_status = $plugins->extract_plugin_files('install', $_GET['revision'], $_GET['extension']);
- redirect($base_url.'&installstatus='.$install_status);
+ redirect($base_url.'&installstatus='.$install_status);
+ }
}
//--------------------------------------------------------------install result