diff options
author | Marc Alexander <admin@m-a-styles.de> | 2019-08-17 11:02:08 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2019-08-17 11:02:08 +0200 |
commit | 9a992a48666b1769522002d84f5d6e995dca80fb (patch) | |
tree | 37840c99a0ed7a4bc7d0275439508ce1ceb00423 /phpBB/includes/acp/acp_styles.php | |
parent | 2d8c5efbd26cecf00188c2e3d6d6235b820575a0 (diff) | |
parent | 6de0c7bc666ec934cc801cdf7cf94290a3d013f9 (diff) | |
download | forums-9a992a48666b1769522002d84f5d6e995dca80fb.tar forums-9a992a48666b1769522002d84f5d6e995dca80fb.tar.gz forums-9a992a48666b1769522002d84f5d6e995dca80fb.tar.bz2 forums-9a992a48666b1769522002d84f5d6e995dca80fb.tar.xz forums-9a992a48666b1769522002d84f5d6e995dca80fb.zip |
Merge pull request #5656 from 3D-I/ticket/16019
[ticket/16019] Deny prosilver's uninstallation
Diffstat (limited to 'phpBB/includes/acp/acp_styles.php')
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 5029510839..87c8d88f52 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -259,6 +259,19 @@ class acp_styles // Get list of styles to uninstall $ids = $this->request_vars('id', 0, true); + // Don't remove prosilver, you can still deactivate it. + $sql = 'SELECT style_id + FROM ' . STYLES_TABLE . " + WHERE style_name = '" . $this->db->sql_escape('prosilver') . "'"; + $result = $this->db->sql_query($sql); + $prosilver_id = (int) $this->db->sql_fetchfield('style_id'); + $this->db->sql_freeresult($result); + + if ($prosilver_id && in_array($prosilver_id, $ids)) + { + trigger_error($this->user->lang('UNINSTALL_PROSILVER') . adm_back_link($this->u_action), E_USER_WARNING); + } + // Check if confirmation box was submitted if (confirm_box(true)) { @@ -998,11 +1011,14 @@ class acp_styles 'L_ACTION' => $this->user->lang['EXPORT'] ); */ - // Uninstall - $actions[] = array( - 'U_ACTION' => $this->u_action . '&action=uninstall&hash=' . generate_link_hash('uninstall') . '&id=' . $style['style_id'], - 'L_ACTION' => $this->user->lang['STYLE_UNINSTALL'] - ); + if ($style['style_name'] !== 'prosilver') + { + // Uninstall + $actions[] = array( + 'U_ACTION' => $this->u_action . '&action=uninstall&hash=' . generate_link_hash('uninstall') . '&id=' . $style['style_id'], + 'L_ACTION' => $this->user->lang['STYLE_UNINSTALL'] + ); + } // Preview $actions[] = array( |