| @@ -18,8 +18,11 @@ | ||
| 18 | 18 | $data['level'] = $this->level; |
| 19 | 19 | $data['plugins'] = $this->getAllPlugins(); |
| 20 | 20 | $data['workflowHelper'] = new WorkflowHelper(); |
| 21 | 21 | |
| 22 | + acym_addScript(true, 'window.acymailingAddons = '.json_encode($data['plugins']).';'); | |
| 23 | + acym_addScript(true, 'window.acymailingAvailableAddons = '.json_encode(ACYM_AVAILABLE_PLUGINS).';'); | |
| 24 | + | |
| 22 | 25 | parent::display($data); |
| 23 | 26 | } |
| 24 | 27 | |
| 25 | 28 | public function checkUpdates(): void |
| @@ -29,8 +32,10 @@ | ||
| 29 | 32 | } |
| 30 | 33 | |
| 31 | 34 | public function saveSettings(): void |
| 32 | 35 | { |
| 36 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 37 | + | |
| 33 | 38 | $pluginFolderName = acym_getVar('string', 'plugin__folder_name', ''); |
| 34 | 39 | |
| 35 | 40 | if (empty($pluginFolderName)) { |
| 36 | 41 | acym_enqueueMessage(acym_translation('ACYM_COULD_NOT_SAVE_SETTINGS')); |
| @@ -84,8 +89,10 @@ | ||
| 84 | 89 | } |
| 85 | 90 | |
| 86 | 91 | public function update(): void |
| 87 | 92 | { |
| 93 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 94 | + | |
| 88 | 95 | $this->isLatestAcyMailingVersion(); |
| 89 | 96 | |
| 90 | 97 | $plugin = acym_getVar('array', 'plugin'); |
| 91 | 98 | |
| @@ -99,8 +106,10 @@ | ||
| 99 | 106 | } |
| 100 | 107 | |
| 101 | 108 | public function deletePlugin(): void |
| 102 | 109 | { |
| 110 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 111 | + | |
| 103 | 112 | $pluginClass = new PluginClass(); |
| 104 | 113 | $id = acym_getVar('int', 'id'); |
| 105 | 114 | |
| 106 | 115 | $plugin = $pluginClass->getOneById($id); |
| @@ -121,8 +130,10 @@ | ||
| 121 | 130 | } |
| 122 | 131 | |
| 123 | 132 | public function toggleActivate(): void |
| 124 | 133 | { |
| 134 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 135 | + | |
| 125 | 136 | $pluginClass = new PluginClass(); |
| 126 | 137 | $id = acym_getVar('int', 'id'); |
| 127 | 138 | |
| 128 | 139 | $plugin = $pluginClass->getOneById($id); |
| @@ -143,8 +154,10 @@ | ||
| 143 | 154 | } |
| 144 | 155 | |
| 145 | 156 | public function getCustomViewPlugin(): void |
| 146 | 157 | { |
| 158 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 159 | + | |
| 147 | 160 | $plugin = $this->getPluginClassAjaxCustomView(); |
| 148 | 161 | |
| 149 | 162 | $customLayoutPath = ACYM_CUSTOM_PLUGIN_LAYOUT.$plugin['folderName'].'.html'; |
| 150 | 163 | |
| @@ -157,8 +170,10 @@ | ||
| 157 | 170 | } |
| 158 | 171 | |
| 159 | 172 | public function saveCustomViewPlugin(): void |
| 160 | 173 | { |
| 174 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 175 | + | |
| 161 | 176 | $plugin = $this->getPluginClassAjaxCustomView(); |
| 162 | 177 | $pluginCustomView = acym_getVar('string', 'custom_view', ''); |
| 163 | 178 | $pluginCustomView = urldecode($pluginCustomView); |
| 164 | 179 | |
| @@ -174,8 +189,10 @@ | ||
| 174 | 189 | } |
| 175 | 190 | |
| 176 | 191 | public function deleteCustomViewPlugin(): void |
| 177 | 192 | { |
| 193 | + wp_verify_nonce(acym_getVar('cmd', '_wpnonce'), 'acymnonce') || die('Invalid Token'); | |
| 194 | + | |
| 178 | 195 | $plugin = $this->getPluginClassAjaxCustomView(); |
| 179 | 196 | |
| 180 | 197 | $customLayoutPath = ACYM_CUSTOM_PLUGIN_LAYOUT.$plugin['folderName'].'.html'; |
| 181 | 198 | |