Example #1
0
            rename_file($temp, $init);
            if (!file_exists($init)) {
                // failed to create gsconfig
                $err .= sprintf(i18n_r('MOVE_TEMPCONFIG_ERROR'), $tempconfig, GSCONFIGFILE) . '<br />';
            }
        }
        # send email to new administrator
        $subject = $site_full_name . ' ' . i18n_r('EMAIL_COMPLETE');
        $message .= '<p>' . i18n_r('EMAIL_USERNAME') . ': <strong>' . stripslashes($_POST['user']) . '</strong>';
        $message .= '<br>' . i18n_r('EMAIL_PASSWORD') . ': <strong>' . $random . '</strong>';
        $message .= '<br>' . i18n_r('EMAIL_LOGIN') . ': <a href="' . $SITEURL . $GSADMIN . '/">' . $SITEURL . $GSADMIN . '/</a></p>';
        $message .= '<p><em>' . i18n_r('EMAIL_THANKYOU') . ' ' . $site_full_name . '!</em></p>';
        $status = sendmail($EMAIL, $subject, $message);
        # activate default plugins
        foreach (explode(',', GSINSTALLPLUGINS) as $actplugin) {
            change_plugin($actplugin, true);
        }
        # set the login cookie, then redirect user to secure panel
        create_cookie();
        $success = true;
    }
}
$pagetitle = $site_full_name . ' &middot; ' . i18n_r('INSTALLATION');
get_template('header');
?>
	
		<h1><?php 
echo $site_full_name;
?>
</h1>
	</div>
 *
 * Displays all installed plugins 
 *
 * @package GetSimple
 * @subpackage Plugins
 */
// Setup inclusions
$load['plugin'] = true;
// Include common.php
include 'inc/common.php';
$pluginid = isset($_GET['set']) ? $_GET['set'] : null;
$nonce = isset($_GET['nonce']) ? $_GET['nonce'] : null;
if ($pluginid) {
    if (check_nonce($nonce, "set", "plugins.php")) {
        $plugin = antixss($pluginid);
        change_plugin($pluginid);
        redirect('plugins.php');
    }
}
// Variable settings
login_cookie_check();
$counter = 0;
$table = null;
$pluginfiles = getFiles(GSPLUGINPATH);
sort($pluginfiles);
$needsupdate = false;
foreach ($pluginfiles as $fi) {
    $pathExt = pathinfo($fi, PATHINFO_EXTENSION);
    $pathName = pathinfo_filename($fi);
    $setNonce = '&amp;nonce=' . get_nonce("set", "plugins.php");
    if ($pathExt == "php") {
Example #3
0
 * Displays all installed plugins 
 *
 * @package GetSimple
 * @subpackage Plugins
 */
// Setup inclusions
$load['plugin'] = true;
// Include common.php
include 'inc/common.php';
login_cookie_check();
$pluginid = isset($_GET['set']) ? $_GET['set'] : null;
$nonce = isset($_GET['nonce']) ? $_GET['nonce'] : null;
if ($pluginid) {
    if (check_nonce($nonce, "set_" . pathinfo_filename($pluginid), "plugins.php")) {
        $plugin = antixss($pluginid);
        change_plugin($plugin);
        redirect('plugins.php?success=' . i18n_r('PLUGIN_UPDATED'));
    } else {
        redirect('plugins.php?error=' . i18n_r('ERROR_OCCURED'));
    }
}
// Variable settings
$counter = 0;
$table = '';
$needsupdate = false;
$plugin_info_sorted = subval_sort($plugin_info, 'name');
foreach ($plugin_info_sorted as $pluginid => $plugininfo) {
    $setNonce = '&amp;nonce=' . get_nonce("set_" . $pluginid, "plugins.php");
    // @todo disabled plugins have a version of (str) 'disabled', should be 0 or null
    $pluginver = $plugininfo['version'] == 'disabled' ? 0 : $plugininfo['version'];
    if (plugin_active($pluginid)) {
/**
 * Include any plugins, depending on where the referring 
 * file that calls it we need to set the correct paths. 
*/
if (file_exists(GSPLUGINPATH)) {
    $pluginfiles = getFiles(GSPLUGINPATH);
}
$pluginsLoaded = false;
// Check if data\other\plugins.xml exists
if (!file_exists(GSDATAOTHERPATH . "plugins.xml")) {
    create_pluginsxml();
}
read_pluginsxml();
// get the live plugins into $live_plugins array
if (isset($_GET['set'])) {
    change_plugin($_GET['set']);
    header('Location: plugins.php');
}
create_pluginsxml();
// check that plugins have not been removed or added to the directory
// load each of the plugins
foreach ($live_plugins as $file => $en) {
    $pluginsLoaded = true;
    if (file_exists(GSPLUGINPATH . $file)) {
        require_once GSPLUGINPATH . $file;
    }
}
/**
 * change_plugin
 * 
 * Enable/Disable a plugin