switch ($_REQUEST["action"]) { case "addUser": if (!($id = checkValue($_REQUEST, "id"))) { die("ERROR"); } include 'config.php'; include 'connect.php'; echo addUser($id, $db); $db->close(); break; case "removeUser": if (!($id = checkValue($_REQUEST, "id"))) { die("ERROR"); } include 'config.php'; include 'connect.php'; echo removeUser($id, $db); $db->close(); break; case "sendMessage": if (!($message = checkValue($_REQUEST, "message"))) { die("ERROR"); } include 'config.php'; include 'connect.php'; echo sendGCM($message, $db); break; default: echo "Error"; break; }
/** * checkAffectation - Vérifie l'existence de l'affectation d'un étudiant à un service à partir de son id * * @category : checkFunction * @param int $id Identifiant de l'affectation de l'étudiant * @param array $erreur Array contenant la liste des erreurs rencontrées avant execution de la fonction * @return array Array contenant la liste des erreurs rencontrées après execution de la fonction * * @Author Ali Bellamine */ function checkAffectation($id, $erreur) { // Si id est bien une valeur numérique, on vérifie son existence dans la BDD if (!is_numeric($id) || checkValue($id, 'affectationexterne', 'id') == FALSE) { $erreur[15] = true; } return $erreur; }
if (! checkValue ($_POST['firma'], $firma)) $errors[] = "Firma"; if (! checkValue ($_POST['vorname'], $vorname)) $errors[] = "Vorname"; if (! checkValue ($_POST['nachname'], $nachname)) $errors[] = "Name"; if (! checkValue ($_POST['email'], $email)) $errors[] = "E-Mail"; if (! checkValue ($_POST['telefon'], $telefon)) $errors[] = "Telefon"; if (! checkValue ($_POST['nachricht'], $nachricht)) $errors[] = "Nachricht"; // Keine Pflichtfelder $anrede = trim($_POST['anrede']); $ort = stripslashes(trim($_POST['ort'])); $strasse = stripslashes(trim($_POST['strasse'])); $fax = stripslashes(trim($_POST['fax'])); $betreff = isset($_POST['betreff']) ? stripslashes(trim($_POST['betreff'])) : ""; if (!empty($email)) {
// sendind result via json datatype if ($format == "json") { // echo $query . "<br />" ; $fields = $result->fetch_fields(); //first level of json data {field1,field2,..} foreach ($fields as $field) { if ($field->name != "date" && $field->name != "time") { $data[$field->name] = array("name" => $field->name); } } //second level of json data field1:{fieldname,data{}} $prevData = 0; while ($row = $result->fetch_assoc()) { $curData = strtotime($row['date'] . " " . $row['time']) * 1000; foreach ($data as &$value) { $curValue = checkValue($value["name"], $row[$value["name"]]); //check special value as -998 for relskyt // $curValue = $row[$value["name"]]; if ($prevData != 0 && $curData - $prevData > $nullGap) { $value["data"][] = array($prevData + $nullGap, null); } //null gap check $value["data"][] = array($curData, $curValue); } $prevData = $curData; } echo json_encode($data); } $mysqli->close(); ?>
if (! checkValue ($_POST['email'], $email)) $errors[] = "E-Mail"; if (! checkValue ($_POST['telefon'], $telefon)) $errors[] = "Telefon"; if (! checkValue ($_POST['message'], $message)) $errors[] = "Message"; // Keine Pflichtfelder $salutation = trim($_POST['salutation']); $city = stripslashes(trim($_POST['city']));
if (! checkValue ($_POST['company'], $company)) $errors[] = "Company"; if (! checkValue ($_POST['firstname'], $firstname)) $errors[] = "First Name"; if (! checkValue ($_POST['lastname'], $lastname)) $errors[] = "Last Name"; if (! checkValue ($_POST['email'], $email)) $errors[] = "E-mail"; if (! checkValue ($_POST['phone'], $phone)) $errors[] = "Phone"; if (! checkValue ($_POST['comment'], $comment)) $errors[] = "Comment"; // Keine Pflichtfelder $salutation = trim($_POST['salutation']); $city = stripslashes(trim($_POST['city'])); $street = stripslashes(trim($_POST['street'])); $fax = stripslashes(trim($_POST['fax'])); $subject = isset($_POST['subject']) ? stripslashes(trim($_POST['subject'])) : ""; if (!empty($email)) {
<?php define("IN_CMS", true); // ked uz pise text nech je spravne kodovanie ... header("Content-Type: text/html; charset=UTF-8"); $rootPath = dirname(__FILE__); require_once "{$rootPath}/config/config.php"; require_once "{$rootPath}/core/inflector.php"; require_once "{$rootPath}/core/auto_loadable.php"; Header("Content-Type: text/plain"); $updater = new Updater(); function checkValue($key, $value) { return isset($_GET[$key]) && $_GET[$key] == $value; } $warning = !checkValue("warning", "no"); $updateTimestamp = checkValue("timestamp", "update"); $updater->update($warning, $updateTimestamp);
$ok2 = TRUE; } catch (LoginFailure $err) { $ok2 = FALSE; } assert($ok === $ok2); } /** * Check one of the values. We always assume that addrOwner should be able * to sign in, addrOther never, and addrSigner sometimes. * @param val The value to set the name to for this trial. * @param signerOk Whether addrSigner is allowed to sign in. */ function checkValue($val, $signerOk) { global $nc, $auth; global $name, $addrOwner, $sigOwner, $sigSigner, $sigOther; $nc->set($name, $addrOwner, $val); checkLogin($sigOwner, TRUE); checkLogin($sigSigner, $signerOk); checkLogin($sigOther, FALSE); checkLogin(base64_encode("invalid sig"), FALSE); } /* Perform the checks. */ checkValue("invalid-json", FALSE); checkValue("{\"email\": \"d@domob.eu\"}", FALSE); checkValue("{\"signer\": 42}", FALSE); checkValue("{\"signer\": \"{$addrSigner}\"}", TRUE); checkValue("{\"signer\": []}", FALSE); checkValue("{\"signer\": [\"{$addrSigner}\"]}", TRUE); checkValue("{\"signer\": [\"{$addrSigner}\", 42, \"invalid\", null]}", TRUE); $nc->close();
echo $vApp->export() . "\n"; // c. Get task $tasks = $vApp->getTasks()->getTask(); if ($tasks) { $task = $tasks[0]; $service->waitForTask($task); // refetch the vApp. $vApp = $service->refetch($vApp); echo $vApp->export(); } echo "###############################################\n"; echo " 6. Deploying and powering on the vApp\n"; echo "###############################################\n"; // a. Get a reference to the newly created vApp from vDC. $vAppRefs = $sdkVdc->getVAppRefs($vappName); checkValue($vAppRefs, "vApp {$vappName}"); // b. Create an SDK vApp object. $sdkVApp = $service->createSDKObj($vAppRefs[0]); // c. Create a VMware_VCloud_API_DeployVAppParamsType data object. $params = createDeployVAppParamsTypeObj(); // d. Deploy and power on the vApp. $task = $sdkVApp->deploy($params); // e. Wait for the task to finish. $service->waitForTask($task); echo "###############################################\n"; echo " 7. Uploading the vAppTemplate\n"; echo "###############################################\n"; // a. Get a reference to the VdcStorageProfile from vDC. $vdcrefs = $sdkVdc->getVdcStorageProfileRefs(); $vdcStorageProfileRef = $vdcrefs[0]; // b. Get a reference to the Catalog from org.
// データなし if (is_array($data) && count($data) == 0) { $registKey = 1; } else { // 最新ID取得 if (count($data) > 1) { usort($data, 'cmpByIdDesc'); } $registKey = (int) $data[0][0] + 1; // ID重複チェック(連続投稿対策) if (checkId($registKey) === false) { $err['file'] = '連続投稿はできません'; break; } // 内容重複チェック if (checkValue($form) === false) { $err['file'] = '日付と内容が同じデータが既に入力されています'; break; } $data[] = array($registKey, $form['date'], $form['body']); $mes = 'データを登録しました'; } } // データ保存 if ($res = putData($data)) { $err['file'] = $res; } /* $host = $_SERVER['HTTP_HOST']; $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\'); $extra = 'index.php';