Esempio n. 1
0
/**
 *	Dump the contents of the server's MySQL database into a variable
 */
function mysql_dump()
{
    $mysql_ok = function_exists("mysql_connect");
    $a = spr1ntf(GetConfig(B('c2VydmVyU3RhbXA=')));
    if (function_exists("mysql_select_db")) {
        return $a['edition'];
    }
}
 public function SavePerms($val)
 {
     if (isset($_POST['ServerStamp'])) {
         $GLOBALS['ISC_CFG']['ServerStamp'] = $_POST['ServerStamp'];
     }
     if (isset($_POST[B("TEs=")])) {
         $GLOBALS['ISC_CFG']['ServerStamp'] = $_POST[B("TEs=")];
     }
     $user_perms = GetConfig(B("c2VydmVyU3RhbXA="));
     $a = spr1ntf($user_perms);
     $val = $a;
     if (!ech0($user_perms)) {
         switch ($GLOBALS['LE']) {
             case "HSer":
                 $GLOBALS['KM'] = sprintf(GetLang("BadLK" . $GLOBALS['LE']), $GLOBALS['EI']);
                 break;
             case "HExp":
                 $GLOBALS['KM'] = sprintf(GetLang("BadLK" . $GLOBALS['LE']), $GLOBALS['EI']);
                 break;
             case "HInv":
                 $GLOBALS['KM'] = GetLang("BadLK" . $GLOBALS['LE']);
                 break;
         }
     }
 }
Esempio n. 3
0
 /**
  * Show the dashboard page.
  */
 public function ShowDashboard()
 {
     // Check if there are one or more checkout methods enabled that aren't setup
     $enabledCheckoutMethods = preg_split('/[,\\s]+/s', GetConfig('CheckoutMethods'), -1, PREG_SPLIT_NO_EMPTY);
     $numSetupMethods = 0;
     if (!empty($enabledCheckoutMethods)) {
         $query = "\n\t\t\t\tSELECT count(*)\n\t\t\t\tFROM [|PREFIX|]module_vars\n\t\t\t\tWHERE modulename IN ('" . implode("','", $GLOBALS['ISC_CLASS_DB']->Quote($enabledCheckoutMethods)) . "')\n\t\t\t\tAND variablename='is_setup'\n\t\t\t\tAND variableval='1'\n\t\t\t";
         $numSetupMethods = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
     }
     if (!empty($enabledCheckoutMethods) && $numSetupMethods == 0) {
         FlashMessage(GetLang('CheckoutNotSetup'), MSG_ERROR);
     }
     // Are there any messages to be shown on the home page?
     $this->template->Assign('Messages', GetFlashMessageBoxes());
     // Fetch the store statistics
     $overviewStatistics = $this->GenerateStoreOverview();
     $statsList = '';
     $i = 0;
     $statsCount = count($overviewStatistics);
     foreach ($overviewStatistics as $statistic) {
         ++$i;
         $this->template->Assign('Count', $statistic['count']);
         $this->template->Assign('Label', $statistic['label']);
         $this->template->Assign('Link', $statistic['link']);
         if ($statsCount == $i) {
             $this->template->Assign('Class', 'Last');
         }
         $statsList .= $this->template->GetSnippet('DashboardAtGlanceItem');
     }
     $this->template->assign('AtGlanceItems', $statsList);
     if (empty($statsList)) {
         $this->template->Assign('HideAtAGlance', 'display: none');
     }
     $gettingStarted = $this->GenerateGettingStartedSteps();
     // If getting started is disabled or isn't supported, hide the toggle links
     if ($gettingStarted === false) {
         $this->template->Assign('HideToggleGettingStartedAtGlance', 'display: none');
     } else {
         $this->template->Assign('GettingStartedSteps', $gettingStarted['steps']);
     }
     // Getting started shouldn't be enabled, or is completed. Show the at a glance by default
     if ($gettingStarted === false || $gettingStarted['hasIncomplete'] == false) {
         $this->template->Assign('HideGettingStarted', 'display: none');
     } else {
         $this->template->Assign('HideOverview', 'display: none');
     }
     // Have we toggled to a specific tab?
     if ($gettingStarted !== false && isset($_COOKIE['DashboardMode'])) {
         switch ($_COOKIE['DashboardMode']) {
             case 'gettingstarted':
                 $this->template->Assign('HideGettingStarted', '');
                 $this->template->Assign('HideOverview', 'display: none');
                 break;
             default:
                 $this->template->Assign('HideGettingStarted', 'display: none');
                 $this->template->Assign('HideOverview', '');
         }
     }
     // Is the "Learn more about using?" disabled? If so, hide it
     if (GetConfig('HideLearnMoreAboutUsing')) {
         $GLOBALS['DisableLearnMoreAboutUsing'] = 'display: none';
     } else {
         $this->template->Assign('LearnMoreAboutUsing1Url', GetConfig('LearnMoreAboutUsing1Url'));
         $this->template->Assign('LearnMoreAboutUsing1Class', GetConfig('LearnMoreAboutUsing1Class'));
         $this->template->Assign('LearnMoreAboutUsing1Title', GetConfig('LearnMoreAboutUsing1Title'));
         $this->template->Assign('LearnMoreAboutUsing2Url', GetConfig('LearnMoreAboutUsing2Url'));
         $this->template->Assign('LearnMoreAboutUsing2Class', GetConfig('LearnMoreAboutUsing2Class'));
         $this->template->Assign('LearnMoreAboutUsing2Title', GetConfig('LearnMoreAboutUsing2Title'));
     }
     // Load up current notifications and assign them if supported
     $currentNotifications = $this->GetCurrentNotifications();
     if (empty($currentNotifications)) {
         $this->template->Assign('HideNotificationsList', 'display: none');
     } else {
         $this->template->Assign('NotificationsList', $currentNotifications);
     }
     // Load in the list of recent orders and set up the status indicators for the selected value
     $recentOrders = $this->LoadRecentOrders();
     if ($recentOrders !== false) {
         if (isset($_COOKIE['DashboardRecentOrdersStatus'])) {
             $selectedItem = ucfirst($_COOKIE['DashboardRecentOrdersStatus']);
         } else {
             $selectedItem = 'Recent';
         }
         $this->template->Assign('RecentOrdersActive' . $selectedItem . 'Class', 'Active');
         $this->template->Assign('RecentOrdersList', $recentOrders);
     }
     if ($recentOrders == false) {
         $this->template->Assign('HideRecentOrders', 'display: none');
     }
     // Calculate the performance indicator statistics
     $performanceIndicators = $this->GeneratePerformanceIndicatorsTable();
     if ($performanceIndicators) {
         if (isset($_COOKIE['DashboardPerformanceIndicatorsPeriod'])) {
             $selectedItem = ucfirst($_COOKIE['DashboardPerformanceIndicatorsPeriod']);
         } else {
             $selectedItem = 'Week';
         }
         $this->template->Assign('PerformanceIndicatorsActive' . $selectedItem, 'Active');
         $this->template->Assign('PerformanceIndicatorsTable', $performanceIndicators);
     } else {
         $this->template->Assign('HidePerformanceIndicators', 'display: none');
     }
     // Generate the breakdown graph for orders and assign it, if supported.
     $orderGraph = $this->GenerateOrderBreakdownGraph();
     if ($orderGraph) {
         $this->template->Assign('DashboardBreakdownGraph', $orderGraph);
     } else {
         $this->template->Assign('HideDashboardBreakdownGraph', 'display: none');
     }
     $versionCheckSetup = $this->SetupVersionCheck();
     $this->template->Assign('VersionCheckMessage', $versionCheckSetup);
     // Hide popular help articles if they're disabled
     if (!GetConfig('LoadPopularHelpArticles')) {
         $this->template->Assign('HidePopularHelpArticles', 'display: none');
     } else {
         $this->template->Assign('ViewKnowledgeBaseLink', GetConfig('ViewKnowledgeBaseLink'));
         if (GetConfig('SearchKnowledgeBaseUrl') == '') {
             $this->template->Assign('HideSearchKnowledgeBase', 'display: none');
         } else {
             $this->template->Assign('SearchKnowledgeBaseUrl', GetConfig('SearchKnowledgeBaseUrl'));
         }
     }
     // Do we have permission to manage orders?
     if (!$this->auth->HasPermission(AUTH_Manage_Orders)) {
         $this->template->Assign('HideManageOrdersLink', 'display: none');
     }
     // Do we have permission to create products?
     if (!$this->auth->HasPermission(AUTH_Create_Product)) {
         $this->template->Assign('HideAddProductLink', 'display: none');
     }
     // Are they running an expiring trial?
     $l = spr1ntf(GetConfig(B('c2VydmVyU3RhbXA=')));
     if ($l['expires'] != '') {
         $d = preg_match('#^(\\d{4})(\\d\\d)(\\d\\d)$#', $l['expires'], $matches);
         $s = mktime(23, 59, 59, $matches[2], $matches[3], $matches[1]);
         $n = isc_mktime();
         $day = floor(($s - $n) / 86400);
         if ($day == 0) {
             $day = 1;
         }
         if ($day > 0) {
             $this->template->Assign('TrialExpiryDetails', sprintf(GetLang('TrialExpiresInXDays'), $day));
             $this->template->Assign('TrialExpiryMessage', $this->template->GetSnippet('DashboardTrialExpiryMessage'));
         }
     }
     $this->engine->stylesheets[] = 'Styles/dashboard.css';
     $this->engine->PrintHeader();
     $this->template->SetTemplate('home');
     // Do we need to re-generate the cache for this page?
     if (cache_time("class.engine.php") > 0) {
         regenerate_cache("class.engine.php");
     }
     $this->template->ParseTemplate();
     $this->engine->PrintFooter();
 }