function activate_rm_plugin($q) { $name = rmc_server_var($_GET, 'plugin', ''); if ($name == '') { redirectMsg('plugins.php', __('You must specify a existing plugin', 'rmcommon'), 1); die; } $plugin = new RMPlugin($name); if ($plugin->isNew()) { redirectMsg('plugins.php', __('Specified plugin is not installed yet!', 'rmcommon'), 1); die; } $plugin->setVar('status', $q); if (!$plugin->save()) { redirectMsg('plugins.php', __('Plugin could not be updated, please try again.', 'rmcommon'), 1); die; } if (!$plugin->on_activate()) { redirectMsg('plugins.php', __('The database has been updated, but erros ocurred on this process.', 'rmcommon') . '<br />' . $plugin->errors(), 1); die; } rm_reload_plugins(); redirectMsg('plugins.php', __('Plugin status changed succesfully!', 'rmcommon'), 0); }