// 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() { global $_TABLES, $_ST_plugin_name, $G_plugin_state; // save the state of our plugins
// show our tabbed Ignore pages $display .= '<script type="text/javascript">' . "\n\tvar ts = new tabstrip();\n\tnew tab( ts, 11, \"{$titles['user']}\", '" . str_replace("/", "\\/", $i_user) . "' );\n\tnew tab( ts, 12, \"{$titles['page']}\", '" . str_replace("/", "\\/", $i_page) . "' );\n\tnew tab( ts, 14, \"{$titles['host']}\", '" . str_replace("/", "\\/", $i_host) . "' );\n\tnew tab( ts, 10, \"{$titles['ip']}\", '" . str_replace("/", "\\/", $i_ip) . "' );\n\tnew tab( ts, 13, \"{$titles['ua']}\", '" . str_replace("/", "\\/", $i_ua) . "' );\n\tnew tab( ts, 15, \"{$titles['referrer']}\", '" . str_replace("/", "\\/", $i_referrer) . "' );\n\tts.write( {$selected_tab} );\n" . '</script>'; // handle the case where the user has javascript disabled $display .= '<noscript>' . '<div class="noscriptpane"><b>' . $titles['user'] . '</b><br>' . $i_user . '</div>' . '<div class="noscriptpane"><b>' . $titles['page'] . '</b><br>' . $i_page . '</div>' . '<div class="noscriptpane"><b>' . $titles['host'] . '</b><br>' . $i_host . '</div>' . '<div class="noscriptpane"><b>' . $titles['ip'] . '</b><br>' . $i_ip . '</div>' . '<div class="noscriptpane"><b>' . $titles['ua'] . '</b><br>' . $i_ua . '</div>' . '<div class="noscriptpane"><b>' . $titles['referrer'] . '</b><br>' . $i_referrer . '</div>' . '</noscript>'; if ($at_least_one_dirty) { $display .= '<p><span class=smaller>' . $LANG_GUS_admin['star'] . '</span>'; } $display .= '</div><br>'; // 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());