Exemplo n.º 1
0
    die("Access denied");
}
try {
    if (!$this->addon) {
        throw new Exception("missing data");
    }
    $addon = new Addon($this->addon);
    if (!$addon->checkInstall()) {
        throw new Exception("addons is not installable");
    }
    if (isset($_POST['save'])) {
        try {
            if ($_POST['secure_input'] != $_SESSION['secure_token']) {
                throw new Exception("Wrong secured token");
            }
            $addon->Install();
            $db = new DB("addons");
            $db->setColPrefix("addon_");
            $db->installed = true;
            $db->group = $_POST['group'];
            $db->update("addon_name = '" . $db->escape($this->addon) . "'");
            header("location: " . page("admin", "addons"), true);
        } catch (Exception $e) {
            echo error(_t($e->getMessage()));
        }
    }
    $db = new DB("addons");
    $db->select("addon_name = '" . $db->escape($this->addon) . "'");
    $db->nextRecord();
    ?>
    <h4><?php