/** * Plugin Installer (this is a copy of enable actions of core) * * @package plugin_installer * @author ColdTrick IT Solutions * @copyright Coldtrick IT Solutions 2009 * @link http://www.coldtrick.com/ */ require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/engine/start.php"; // block non-admin users admin_gatekeeper(); // Validate the action action_gatekeeper(); // Get the plugin $plugin = get_input('plugin'); if (!is_array($plugin)) { $plugin = array($plugin); } foreach ($plugin as $p) { // Re enable if (disable_plugin($p) && enable_plugin($p)) { system_message(sprintf(elgg_echo('plugin_installer:plugin_admin:reactivate:yes'), $p)); } else { register_error(sprintf(elgg_echo('plugin_installer:plugin_admin:reactivate:no'), $p)); } } elgg_view_regenerate_simplecache(); $cache = elgg_get_filepath_cache(); $cache->delete('view_paths'); forward($vars['url'] . "pg/admin/plugins/"); exit;
<?php /** * Enable plugin action. * * @package Elgg * @subpackage Core * @author Curverider Ltd * @link http://elgg.org/ */ // block non-admin users admin_gatekeeper(); // Get the plugin $plugin = get_input('plugin'); if (!is_array($plugin)) { $plugin = array($plugin); } foreach ($plugin as $p) { // Disable if (enable_plugin($p)) { system_message(sprintf(elgg_echo('admin:plugins:enable:yes'), $p)); } else { register_error(sprintf(elgg_echo('admin:plugins:enable:no'), $p)); } } elgg_view_regenerate_simplecache(); elgg_filepath_cache_reset(); forward($_SERVER['HTTP_REFERER']); exit;
<?php /** * Because Elgg now has a plugable account activation process we need to activate * the email account activation plugin for existing installs. */ enable_plugin('uservalidationbyemail', $CONFIG->site->guid);
<?php global $CONFIG; /// Deprecate kses and activate htmlawed /** * Kses appears to be a dead project so we are deprecating it in favour of htmlawed. */ disable_plugin('kses', $CONFIG->site->guid); enable_plugin('htmlawed', $CONFIG->site->guid);
set_config('https_login', 1, $site->getGUID()); } else { unset_config('https_login', $site->getGUID()); } // activate some plugins by default if (isset($CONFIG->default_plugins)) { if (!is_array($CONFIG->default_plugins)) { $plugins = explode(',', $CONFIG->default_plugins); } else { $CONFIG->default_plugins = $CONFIG->default_plugins; } foreach ($plugins as $plugin) { enable_plugin(trim($plugin), $site->getGUID()); } } else { enable_plugin('profile', $site->getGUID()); enable_plugin('river', $site->getGUID()); enable_plugin('logbrowser', $site->getGUID()); enable_plugin('diagnostics', $site->getGUID()); enable_plugin('uservalidationbyemail', $site->getGUID()); enable_plugin('htmlawed', $site->getGUID()); } // Now ping home if ($usage) { ping_home($site); } system_message(elgg_echo("installation:configuration:success")); header("Location: ../../account/register.php"); exit; } }
<?php global $CONFIG; /** * Elgg now has kses tag filtering built as a plugin. This needs to be enabled. */ enable_plugin('kses', $CONFIG->site->guid);
$plugin_name = str_ireplace("/manifest.xml", "", $entry['name']); } elseif (stristr($entry['name'], "start.php") && substr_count($entry['name'], "/") == 1) { $start = true; } } if (!$manifest) { register_error(elgg_echo('plugin_installer:upload:error:nomanifest')); } elseif (!$start) { register_error(elgg_echo('plugin_installer:upload:error:nostart')); } else { if (!file_exists($CONFIG->pluginspath . $plugin_name) || $overwrite) { $extract = $zip->extractTo($CONFIG->pluginspath); $zip->close(); if ($extract === TRUE && file_exists($CONFIG->pluginspath . $plugin_name)) { disable_plugin($plugin_name); enable_plugin($plugin_name); regenerate_plugin_list(); system_message(elgg_echo('plugin_installer:upload:success')); } else { register_error(elgg_echo('plugin_installer:upload:error:unzip')); } } else { register_error(elgg_echo('plugin_installer:upload:error:pluginexists')); } } } else { register_error(elgg_echo('plugin_installer:upload:error')); } $filehandler->delete(); } else { register_error(elgg_echo('plugin_installer:upload:missing'));
set_config('disable_api', 'disabled', $site->getGUID()); } $https_login = get_input('https_login'); if ($https_login) { set_config('https_login', 1, $site->getGUID()); } else { unset_config('https_login', $site->getGUID()); } // activate some plugins by default if (isset($CONFIG->default_plugins)) { $plugins = explode(',', $CONFIG->default_plugins); foreach ($plugins as $plugin) { enable_plugin(trim($plugin), $site->getGUID()); } } else { enable_plugin('profile', $site->getGUID()); enable_plugin('river', $site->getGUID()); enable_plugin('updateclient', $site->getGUID()); enable_plugin('logbrowser', $site->getGUID()); enable_plugin('diagnostics', $site->getGUID()); enable_plugin('uservalidationbyemail', $site->getGUID()); } // Now ping home if ($usage) { ping_home($site); } system_message(elgg_echo("installation:configuration:success")); header("Location: ../../account/register.php"); exit; } }
<?php // Add plugins to the plugin folder. They should be at least just the plugin_name.php in the root of plugins, (and if you need additional files, in a subdirectory named accordingly). // Add plugins using enable_plugin("pluginName"); do not include the extension. enable_plugin("navigation_bar"); enable_plugin("blog"); enable_plugin("sculpt_site_special");
} else { unset_config('https_login', $site->getGUID()); } // activate some plugins by default if (isset($CONFIG->default_plugins)) { if (!is_array($CONFIG->default_plugins)) { $plugins = explode(',', $CONFIG->default_plugins); } else { $CONFIG->default_plugins = $CONFIG->default_plugins; } foreach ($plugins as $plugin) { enable_plugin(trim($plugin), $site->getGUID()); } } else { enable_plugin('profile', $site->getGUID()); enable_plugin('logbrowser', $site->getGUID()); enable_plugin('diagnostics', $site->getGUID()); enable_plugin('uservalidationbyemail', $site->getGUID()); enable_plugin('htmlawed', $site->getGUID()); enable_plugin('search', $site->getGUID()); } // reset the views path in case of installing over an old data dir. // @todo should this warn / error first? $dataroot = datalist_get('dataroot'); $cache = new ElggFileCache($dataroot); $cache->delete('view_paths'); system_message(elgg_echo("installation:configuration:success")); header("Location: ../../account/register.php"); exit; } }
<?php /** * Upgrades the oAuth Library plugin name */ if (elgg_is_active_plugin('oauth')) { disable_plugin('oauth'); enable_plugin('oauth_lib'); }
<?php global $CONFIG; /** * Enable the search plugin */ enable_plugin('search', $CONFIG->site->guid);