echo '<span>' . $LANG['plugins_istl_subtitle'] . '</span>'; } echo '</div>'; echo '<div id="upload-theme-form">'; if ($_SERVER['REQUEST_METHOD'] == 'POST' && check_csrf($_POST['csrf'], 'plugins_csrf')) { if (isset($_FILES['file'])) { try { actions::extract_plugin($_FILES['file']['name'], $_FILES['file']['tmp_name']); echo '<div class="a-success">' . $LANG['plugins_installed'] . '</div>'; } catch (Exception $e) { echo '<div class="a-error">' . $e->getMessage() . '</div>'; } } else { if (isset($_POST['URL'])) { try { actions::extract_plugin($_POST['URL']); echo '<div class="a-success">' . $LANG['plugins_installed'] . '</div>'; } catch (Exception $e) { echo '<div class="a-error">' . $e->getMessage() . '</div>'; } } } } $csrf = $_SESSION['plugins_csrf'] = \site\utils::str_random(10); /* */ if ($_SERVER['REQUEST_METHOD'] !== 'POST') { echo '<div class="a-alert">' . $LANG['plugins_install_msg'] . '</div>'; } echo '<div class="form-table">'; echo '<form action="#" method="POST" enctype="multipart/form-data"> <div class="row"><span>' . $LANG['plugins_select_plugin'] . ':</span><div><input type="file" name="file" value="" /></div></div>