Example #1
0
            echo '<div class="a-error">' . $LANG['invalid_id'] . '</div>';
        }
        break;
        /** UNINSTALLING */
    /** UNINSTALLING */
    case 'uninstall':
        $csrf = \site\utils::str_random(10);
        echo '<div class="title">

<h2>' . $LANG['plugins_uninstall_title'] . '</h2>

<div style="float:right; margin: 0 2px 0 0;">';
        echo '<a href="?route=plugins.php&amp;action=list" class="btn">' . $LANG['plugins_view'] . '</a>
</div>';
        echo '</div>';
        if (isset($_GET['id']) && ($plugin_exists = admin_query::plugin_exists($_GET['id']))) {
            $info = admin_query::plugin_infos($_GET['id']);
            echo '<div class="a-message">' . $LANG['delete_plugin'] . '</div>';
            echo '<div class="title" style="margin-top: 40px;">
  <h2>' . $LANG['plugins_unist_files'] . '</h2>
</div>

<ul class="list-of-items">';
            echo '<li>' . UPDIR . '/' . dirname($info->main_file) . '</li>';
            echo '</ul>';
            if (isset($info->uninstall_preview['delete']['tables'])) {
                echo '<div class="title" style="margin-top: 40px;">
  <h2>' . $LANG['plugins_unist_tables'] . '</h2>
</div>

<ul class="list-of-items">';
Example #2
0
 public static function delete_plugin_image($id)
 {
     global $db;
     if (!$GLOBALS['me']->is_admin) {
         return false;
     }
     $id = (array) $id;
     $stmt = $db->stmt_init();
     foreach ($id as $ID) {
         if (admin_query::plugin_exists($ID)) {
             $plugin = admin_query::plugin_infos($ID);
             $stmt->prepare("UPDATE " . DB_TABLE_PREFIX . "plugins SET image = '' WHERE id = ?");
             $stmt->bind_param("i", $ID);
             $stmt->execute();
             if (!empty($plugin->image)) {
                 @unlink(DIR . '/' . $plugin->image);
             }
         }
     }
     @$stmt->close();
     return true;
 }