示例#1
0
if ($is_writable && !empty($_GET['tool_url'])) {
    $tool_url = $_GET['tool_url'];
    $parsed_url = parse_url($tool_url);
    if (empty($parsed_url['scheme']) || !preg_match('/^http|ftp$/', $parsed_url['scheme']) || empty($parsed_url['host']) || empty($parsed_url['path'])) {
        $err = __('URL is not valid.');
    } else {
        if (($err = $plugins->install($tool_url)) === true) {
            header('Location: tools.php?p=toolsmng');
            exit;
        }
    }
}
# Changement de status d'un plugin
$switch = !empty($_GET['switch']) ? $_GET['switch'] : '';
if ($is_writable && $switch != '' && in_array($switch, array_keys($plugins_list)) && $switch != 'toolsmng') {
    $plugins->switchStatus($switch);
    header('Location: tools.php?p=toolsmng');
    exit;
}
# Suppression d'un thème
$delete = !empty($_GET['delete']) ? $_GET['delete'] : '';
if ($is_writable && $delete != '' && in_array($delete, array_keys($plugins_list)) && $delete != 'toolsmng') {
    files::deltree($plugins_root . '/' . $delete);
    header('Location: tools.php?p=toolsmng');
    exit;
}
if ($err != '') {
    buffer::str('<div class="erreur"><p><strong>' . __('Error(s)') . ' :</strong></p>' . $err . '</div>');
}
buffer::str('<h2>' . __('Plugins manager') . '</h2>' . '<h3>' . __('Install a plugin') . '</h3>');
if (!$is_writable) {