Exemple #1
0
/**
 * Reset all the FREE plugins, even if they are not activated.
 *
 * @param  boolean $process_form Whether a form was submitted or not.
 * @return void
 */
function sucuriscan_posthack_plugins($process_form = false)
{
    $template_variables = array('ResetPlugin.PluginList' => '', 'ResetPlugin.CacheLifeTime' => 'unknown');
    if (defined('SUCURISCAN_GET_PLUGINS_LIFETIME')) {
        $template_variables['ResetPlugin.CacheLifeTime'] = SUCURISCAN_GET_PLUGINS_LIFETIME;
    }
    sucuriscan_posthack_reinstall_plugins($process_form);
    return SucuriScanTemplate::get_section('posthack-resetplugins', $template_variables);
}
Exemple #2
0
/**
 * Reset all the FREE plugins, even if they are not activated.
 *
 * @param  boolean $process_form Whether a form was submitted or not.
 * @return void
 */
function sucuriscan_posthack_plugins($process_form = false)
{
    $template_variables = array('ResetPlugin.PluginList' => '', 'ResetPlugin.CacheLifeTime' => 'unknown');
    if (defined('SUCURISCAN_GET_PLUGINS_LIFETIME')) {
        $template_variables['ResetPlugin.CacheLifeTime'] = SUCURISCAN_GET_PLUGINS_LIFETIME;
    }
    sucuriscan_posthack_reinstall_plugins($process_form);
    $all_plugins = SucuriScanAPI::get_plugins();
    $counter = 0;
    foreach ($all_plugins as $plugin_path => $plugin_data) {
        $css_class = $counter % 2 == 0 ? '' : 'alternate';
        $plugin_type_class = $plugin_data['PluginType'] == 'free' ? 'primary' : 'warning';
        $input_disabled = $plugin_data['PluginType'] == 'free' ? '' : 'disabled="disabled"';
        $plugin_status = $plugin_data['IsPluginActive'] ? 'active' : 'not active';
        $plugin_status_class = $plugin_data['IsPluginActive'] ? 'success' : 'default';
        $template_variables['ResetPlugin.PluginList'] .= SucuriScanTemplate::get_snippet('posthack-resetplugins', array('ResetPlugin.CssClass' => $css_class, 'ResetPlugin.Disabled' => $input_disabled, 'ResetPlugin.PluginPath' => SucuriScan::escape($plugin_path), 'ResetPlugin.Plugin' => SucuriScan::excerpt($plugin_data['Name'], 35), 'ResetPlugin.Version' => $plugin_data['Version'], 'ResetPlugin.Type' => $plugin_data['PluginType'], 'ResetPlugin.TypeClass' => $plugin_type_class, 'ResetPlugin.Status' => $plugin_status, 'ResetPlugin.StatusClass' => $plugin_status_class));
        $counter += 1;
    }
    return SucuriScanTemplate::get_section('posthack-resetplugins', $template_variables);
}