// +---------------------------------------------------------------------------+ require_once '../../../lib-common.php'; require_once $_CONF['path'] . 'plugins/gus/functions.inc'; // Only let Root users access this page if (!SEC_inGroup('Root')) { // Someone is trying to illegally access this page COM_errorLog("Someone has tried to illegally access the GUS import page. " . "User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$_SERVER['REMOTE_ADDR']}", 1); echo COM_siteHeader(); echo COM_startBlock($LANG_ST00['access_denied']); echo $LANG_ST00['access_denied_msg']; echo COM_endBlock(); echo COM_siteFooter(TRUE); exit; } $img_url = $_CONF['site_url'] . '/gus/images/' . $_GUS_IMG_small_name; $header = '<img src="' . $img_url . '" width=24 height=24 alt="GUS pic" align=middle> ' . $LANG_GUS00['import_header'] . ' [v' . plugin_chkVersion_gus() . ']'; $readme_url = $_CONF['site_admin_url'] . '/plugins/gus/readme.html#import'; // IF we can't find the stats plugin, then we can't do much, so abort! if (GUS_checkStatsInstall() == FALSE) { global $_CONF, $header, $readme_url; echo COM_siteHeader(); echo COM_startBlock($header, $readme_url); echo COM_startBlock('Error', '', COM_getBlockTemplate('_msg_block', 'header')); echo '<img src="' . $_CONF['layout_url'] . '/images/sysmessage.gif" border="0" align="top" alt=""> '; echo "I can't seem to find your stats plugin anywhere."; echo COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer')); echo COM_endBlock(); echo COM_siteFooter(TRUE); exit; } function GUS_save_plugin_enable_states()
// +---------------------------------------------------------------------------+ require_once '../../../lib-common.php'; require_once $_CONF['path'] . 'plugins/gus/functions.inc'; // Only let Root users access this page if (!SEC_inGroup('Root')) { // Someone is trying to illegally access this page COM_errorLog("Someone has tried to illegally access the Stats install/uninstall page. " . "User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$_SERVER['REMOTE_ADDR']}", 1); echo COM_siteHeader(); echo COM_startBlock($LANG_ST00['access_denied']); echo $LANG_ST00['access_denied_msg']; echo COM_endBlock(); echo COM_siteFooter(true); exit; } $pi_name = 'gus'; $pi_version = plugin_chkVersion_gus(); $gl_version = '2.1.0'; $pi_url = 'https://github.com/Geeklog-Plugins/gus'; $_FEATURE = array('gus.admin' => 'GUS Admin', 'gus.view' => 'GUS Viewer'); /** * Puts the datastructures for this plugin into the Geeklog database * */ function plugin_install_gus() { global $pi_version, $gl_version, $pi_url, $_FEATURE, $_TABLES, $_CONF, $LANG_GUS00, $LANG_GUS_wo, $_GUS_VARS; COM_errorLog('Installing the GUS plugin', 1); // DB_setdebug( true ); // Create the Plugin Tables GUS_createDatabaseStructures(); // Create the plugin admin security group
// let's clear out all the data! $display .= "<hr><h4>{$LANG_GUS_admin['remove_data']}</h4>" . 'Click the \'' . $LANG_GUS_admin['remove_data'] . '\' button to clear out all the data in your GUS databases. ' . 'This will not affect your settings - only the data. ' . 'I will disable the plugin, perform the operation, and enable the plugin again. ' . '<p>' . $LANG_GUS_admin['irreversible'] . 'You will not get a silly "Are you sure you want to do this?" message.' . "<form method='POST' action='{$_CONF['site_admin_url']}/plugins/gus/index.php'>\n\t\t\t<input type='submit' value='{$LANG_GUS_admin['remove_data']}' name='Remove'>\n\t\t\t<input type='hidden' value='remove_data' name='action'>\n\t\t\t</form>"; // fetch the 'imported' var since it may have changed $rec = DB_query("SELECT value FROM {$_TABLES['gus_vars']} WHERE name = 'imported' LIMIT 1", 1); $row = DB_fetchArray($rec, FALSE); $_GUS_VARS['imported'] = $row['value']; // check for old stats to see if we should add an import link if (GUS_checkStatsInstall() and $_ST_plugin_name != '' and $_GUS_VARS['imported'] < 3) { $import_url = $_CONF['site_admin_url'] . '/plugins/gus/import.php'; $stats_version = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name = '{$_ST_plugin_name}'"); $display .= "<hr><h4>{$LANG_GUS_admin['import_data']}</h4>" . "I notice you have the stats plugin version {$stats_version} installed as '{$_ST_plugin_name}'. "; if ($stats_version !== '1.3') { $display .= "<p>If you had version 1.3 installed, I could import its data. \n\t\t\tIf you update this in the future, you can import its data from \n\t\t\tthe <a href=\"{$admin_url}\">admin page</a>."; } else { $display .= "<p>You may import its data into GUS using the <a href=\"{$import_url}\">import page</a>."; } } $readme_url = $_CONF['site_admin_url'] . '/plugins/gus/readme.html#config'; $menu_arr = array(array('url' => $_CONF['site_admin_url'], 'text' => $LANG_ADMIN['admin_home'])); $retval = COM_siteHeader('menu', $LANG_GUS_admin['admin']); $retval .= COM_startBlock($LANG_GUS_admin['admin'] . ' [v' . plugin_chkVersion_gus() . ']', $readme_url, COM_getBlockTemplate('_admin_block', 'header')); require_once $_CONF['path'] . '/system/lib-admin.php'; $retval .= ADMIN_createMenu($menu_arr, $LANG_GUS_admin['instructions'], plugin_geticon_gus()); $display = $retval . $display; $display .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer')); $display .= COM_siteFooter(); echo $display; ?>