function __construct($args) { $this->args = $args; $this->site = new MgSiteConnection(); $this->site->Open(new MgUserInformation($args['SESSION'])); SetLocalizedFilesPath(GetLocalizationPath()); if(isset($_REQUEST['LOCALE'])) { $locale = $_REQUEST['LOCALE']; } else { $locale = GetDefaultLocale(); } $equalToLocal = GetLocalizedString('QUERYEQUALTO', $locale ); $notEqualToLocal = GetLocalizedString('QUERYNOTEQUALTO', $locale ); $greatThanLocal = GetLocalizedString('QUERYGREATTHAN', $locale ); $greatThanEqualLocal = GetLocalizedString('QUERYGREATTHANEQUAL', $locale ); $lessThanLocal = GetLocalizedString('QUERYLESSTHAN', $locale ); $lessThanEqualLocal = GetLocalizedString('QUERYLESSTHANEQUAL', $locale ); $beginLocal = GetLocalizedString('QUERYBEGIN', $locale ); $containsLocal = GetLocalizedString('QUERYCONTAINS', $locale ); $this->numOperators = array($equalToLocal, $notEqualToLocal, $greatThanLocal, $greatThanEqualLocal, $lessThanLocal, $lessThanEqualLocal); $this->numExpressions = array(' = %s', ' != %s', ' > %s', ' >= %s', ' < %s', ' <= %s'); $this->strOperators = array($beginLocal, $containsLocal, $equalToLocal); $this->strExpressions = array(" like '%s%%'", " like '%%%s%%'", " = '%s'"); }
// // This library is free software; you can redistribute it and/or // modify it under the terms of version 2.1 of the GNU Lesser // General Public License as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA include 'common.php'; include 'constants.php'; $locale = GetDefaultLocale(); $scaleDenominator; $annotations; $args = GetRequestMethod(); GetParameters($args); $templ = file_get_contents("../viewerfiles/quickplotpreviewinner.templ"); SetLocalizedFilesPath(GetLocalizationPath()); // Localize the page $templ = Localize($templ, $locale, GetClientOS()); // Set some annotation labels in the page by replacing the placeholders in the html code $templ = str_replace(array_keys($annotations), array_values($annotations), $templ); // Set the date annotation according to its format mask $pattern = "/\\{date:.*\\[php=(.+?)\\].+?\\}/"; $matches = array(); if (preg_match($pattern, $templ, $matches)) { $mask = $matches[1];
function ValidateLocaleString($proposedLocaleString) { // aa or aa-aa $validLocaleString = GetDefaultLocale(); // Default if ($proposedLocaleString != null && (preg_match('/^[A-Za-z]{2}$/', $proposedLocaleString) || preg_match('/^[A-Za-z]{2}-[A-Za-z]{2}$/', $proposedLocaleString))) { $validLocaleString = $proposedLocaleString; } return $validLocaleString; }
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --> <head> <title>PHP Test</title> </head> <body> <?php include 'common.php'; echo "<b>Server Admin Service Tests</b><p>"; // Initialize web tier with the site configuration file. InitializeWebTier(); $cred = new MgUserInformation(); $cred->SetMgUsernamePassword("Administrator", "admin"); $cred->SetLocale(GetDefaultLocale()); $cred->SetClientIp(GetClientIp()); $cred->SetClientAgent(GetClientAgent()); $serverAdmin = new MgServerAdmin(); $serverAdmin->Open("localhost", $cred); $operation = $_GET['OPERATION']; //Get all information properties $infoProp = $serverAdmin->GetInformationProperties(); try { switch ($operation) { case "ONLINE": $serverAdmin->BringOnline(); if ($serverAdmin->IsOnline()) { echo "Server online<p>"; } else { echo "Server offline<p>";