Example #1
0
    if (!isset($_REQUEST['data'])) {
        header("HTTP/1.0 400 Bad Request");
    } else {
        $uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
        $input = file_get_contents("php://input");
        $requests = @json_decode($input, true);
        $data = json_decode(get_magic_quotes_gpc() ? stripslashes($_REQUEST['data']) : $_REQUEST['data'], true);
        if (!empty($requests) && isPost()) {
            $query = true;
            foreach ($requests['requests'] as $request) {
                if (empty($data) && preg_match('/data=%7B%22token%22%3A%22([a-z0-9A-Z]*?)%22%7D/', $request, $matches)) {
                    // safari and opera
                    $data = array('token' => $matches[1]);
                }
                $query = $query && logRequest($sqlite, $uri . $request, $data);
            }
        } else {
            if (isPost()) {
                $uri .= '?' . file_get_contents('php://input');
            }
            $query = logRequest($sqlite, $uri, $data);
        }
        if (!$query) {
            header("HTTP/1.0 500 Internal Server Error");
        } else {
            //			echo 'Number of rows modified: ', $sqlite->changes();
            sendWebBug();
        }
    }
}
$sqlite->close();
Example #2
0
    echo "</body></html>\n";
} else {
    if (!isset($_REQUEST['data'])) {
        header("HTTP/1.0 400 Bad Request");
    } else {
        $uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
        $input = file_get_contents("php://input");
        $requests = @json_decode($input, true);
        $data = json_decode(get_magic_quotes_gpc() ? stripslashes($_REQUEST['data']) : $_REQUEST['data'], true);
        if (!empty($requests) && isPost()) {
            $query = true;
            foreach ($requests['requests'] as $request) {
                if (empty($data) && preg_match('/data=%7B%22token%22%3A%22([a-z0-9A-Z]*?)%22%7D/', $request, $matches)) {
                    // safari and opera
                    $data = array('token' => $matches[1]);
                }
                $query = $query && logRequest($db, $uri . $request, $data);
            }
        } else {
            if (isPost()) {
                $uri .= '?' . file_get_contents('php://input');
            }
            $query = logRequest($db, $uri, $data);
        }
        if (!$query) {
            header("HTTP/1.0 500 Internal Server Error");
        } else {
            sendWebBug();
        }
    }
}
function translate($text, $from_lang, $to_lang)
{
    $out = "";
    $gphtml = getPage(array("sl" => $from_lang, "tl" => $to_lang, "text" => $text));
    if (DEBUG) {
        $fd = fopen("html.txt", "w");
        fwrite($fd, $gphtml);
        fclose($fd);
    }
    $gphtml = ereg_replace(">", ">\n", $gphtml);
    $out = ereg_replace('.+<div id="?result_box"? dir="?[lr]t[lr]+"?>', "", $gphtml);
    $out = ereg_replace('</div>.*', "", $out);
    $out = strip_tags($out);
    if (preg_match("/\\|([^|]+)\\|/", $text)) {
        $out = back_trans($text, trim($out));
    }
    $r = html_entity_decode($out, ENT_QUOTES, "UTF-8");
    if (DEBUG) {
        logRequest("{$from_lang}|{$to_lang}", $text, $r);
    }
    return $r;
}
    <title>BT Neo AIB - KM Portal</title>
</head>

    <body>
        <?php 
include "header.php";
$appId = isset($_POST["SelectAppNames"]) ? $_POST["SelectAppNames"] : '';
require_once 'DBLogic.php';
$appAllData = getAppInfo($appId);
$appNames[0] = $appAllData[0]['app_name'];
$appId[0] = $appAllData[0]['app_id'];
$appDescs[0] = $appAllData[0]['app_desc'];
$appDiagrams = $appAllData[0]['app_intf_diagram'];
$appfullfrom[0] = $appAllData[0]['FULLFORM'];
$entityName = $appNames[0];
logRequest("View", $appNames[0]);
?>
        <table border=0 width="100%">
            <tr>
                <td>
                    <?php 
$_POST["searchStr"] = "";
?>
                    <table border=0 width="100%">
                        <tr>
                            <td width="100%" align="center" style="color: #A62A2A" valign=middle>
                        <font size=20pt font=arial><u> <?php 
echo $entityName;
?>
 </u></font>
                </td>
        logRequest("Search", $strSrch);
        $_POST['error'] = "Result not found - Request you to add this information once you find";
        include 'errorPage.php';
    } elseif ($countResult == 1 || $index != -1) {
        $_POST['searchStr'] = $strSrch;
        $_POST['appId'] = $lastappId;
        $_POST['index'] = $index;
        $keywrodData = searchKeyword($strSrch, $index);
        $keywordId = $keywrodData[0]['keyword_id'];
        //echo $keywordId;
        $countResultforApps = searchKeywordAppMappingCount($keywordId);
        // echo $countResultforApps;
        include 'displaySingleSearchResult.php';
        //        if ($countResultforApps == 1 || $lastappId != 0) {
        //            include('SearchResult.php');
        //        } else {
        //            include('SearchResultMultiple.php');
        //        }
        //    echo "I am here";
        if ($index == -1 && $start_index == 1 && $lastappId == 0) {
            logRequest("Search", $strSrch);
        }
    } else {
        if ($start_index == 1) {
            logRequest("Search", $strSrch);
        }
        $_POST['searchStr'] = $strSrch;
        $_POST['startIndex'] = $start_index;
        include 'displayMultipleSearchResult.php';
    }
}
Example #6
0
function updateRowInKeywords($keywordId, $Type, $InterfaceDesc, $AppId, $remarks, $FullForm, $relatedWord, $fileName)
{
    $InterfaceDesc = str_replace("'", "''", $InterfaceDesc);
    $InterfaceName = str_replace("'", "''", $InterfaceName);
    $remarks = str_replace("'", "''", $remarks);
    $FullForm = str_replace("'", "''", $FullForm);
    $relatedWord = str_replace("'", "''", $relatedWord);
    $result = mysql_query("select * from keywords where keyword_id='" . $keywordId . "'") or die(mysql_error());
    while ($row = mysql_fetch_array($result)) {
        if ($Type == "" || $Type == null) {
            $Type = $row['type'];
        }
        $InterfaceDesc = $row['keyword_desc'] . " , " . $InterfaceDesc;
        if ($FullForm == "" && $FullForm == null) {
            $FullForm = $row['keyword_info'];
        }
        $relatedWord = $row['related_word'] . " , " . $relatedWord;
        $existingDiagrams = $row['app_intf_diagram'];
        if (strpos($existingDiagrams, "Default") === false) {
            $fileName = $existingDiagrams . "," . $fileName;
        }
    }
    mysql_query("UPDATE `keywords` SET `related_word`='{$relatedWord}',`type`='{$Type}',`keyword_desc`='{$InterfaceDesc}',`keyword_info`='{$FullForm}', `keyword_diagram`='{$fileName}' WHERE `keyword_id` = '" . $keywordId . "'") or die(mysql_error());
    $resultMapTable = mysql_query("SELECT * FROM `keyword_app_mapping` WHERE `keyword_id` = '{$keywordId}' and `app_id` = '{$AppId}'") or die(mysql_error());
    $InsertRequired = true;
    while ($row = mysql_fetch_array($resultMapTable)) {
        $InsertRequired = false;
        $remarks = $row['keyword_app_remarks'] . " , " . $remarks;
        mysql_query("UPDATE `keyword_app_mapping` SET `keyword_app_remarks`='{$remarks}' WHERE `keyword_id` = '{$keywordId}' and `app_id` = '{$AppId}'") or die(mysql_error());
    }
    if ($InsertRequired) {
        mysql_query("INSERT INTO `keyword_app_mapping`(`keyword_id`, `app_id`, `keyword_app_remarks`) VALUES ('{$keywordId}','{$AppId}','{$remarks}')") or die(mysql_error());
    }
    logRequest("Key Mod", $keywordId . " with " . $Type . $InterfaceDesc . $FullForm . $relatedWord . " Interface Remark= " . $remarks);
}
Example #7
0
<?php

require_once 'bss_soap_client.php';
require_once 'log.php';
require_once 'OperationRegistry.php';
// retrieve the operation
$op = OperationRegistry::get($_REQUEST['operation']);
// create and initialize operation parameters
$params = array();
if ($op->service == 'EventService') {
    $params = '<ns2:recordEventForSubscription xmlns:ns2="http://oscm.org/v1.3">' . '<subscriptionKey>' . $_REQUEST['subscriptionKey'] . '</subscriptionKey>' . '<event>' . '<ns2:actor>' . $_REQUEST['actor'] . '</ns2:actor>' . '<ns2:eventId>' . $_REQUEST['eventId'] . '</ns2:eventId>' . '<ns2:multiplier>' . $_REQUEST['multiplier'] . '</ns2:multiplier>' . '<ns2:occurrenceTime>' . $_REQUEST['occurrenceTime'] . '</ns2:occurrenceTime>' . '</event>' . '</ns2:recordEventForSubscription>';
} else {
    if ($op->service == 'SessionService') {
        $params = array('subscriptionKey' => $_REQUEST['subscriptionKey'], 'sessionId' => $_REQUEST['sessionId']);
        if ($op->method == 'resolveUserToken') {
            $params['userToken'] = $_REQUEST['userToken'];
        }
    }
}
// create soap client and execute request
$client = new bss_soap_client($op->service);
$result = $client->call($op->method, $params);
if ($client->getError()) {
    logRequest($op->name, false, $params, $client->getError());
} else {
    if (is_string($params)) {
        $params = array(str_replace('&gt;&lt;', '&gt;<br/>&lt;', htmlspecialchars($params)));
    }
    logRequest($op->name, false, $params, $result['return']);
}
include 'requests.php';
Example #8
0
<?php

require_once 'common.php';
$token = $db->escape_string($_GET['token']);
$email = $db->escape_string($_GET['email']);
logRequest('invite', 'token: ' . $token . '; email: ' . $email);
$invite = getInvite($token);
if ($invite && $invite['freeInvites'] > 0) {
    $newToken = generateToken();
    $sql = "INSERT INTO garage_invites SET token = '{$newToken}', email = '{$email}', referredBy = '{$token}'";
    if (!good_query($sql)) {
        $error = $db->error;
        // Check if error is only due to duplicate email (person already invited)
        if (stripos($error, "Duplicate") !== FALSE && stripos($error, "'email'") !== FALSE) {
            $newToken = good_query_value("SELECT token FROM garage_invites WHERE email = '{$email}'");
            // If the person was already invited, invite him again using his old token
            if (empty($newToken)) {
                respond(json_encode(array('status' => 'error', 'message' => "Invitation wasn't found")));
            }
        } else {
            // There is a minor chance that the token would already exist
            respond(json_encode(array('status' => 'error', 'message' => 'Invitation didn\'t go through. Please try again.')));
        }
    } else {
        good_query("UPDATE garage_invites SET freeInvites = (freeInvites - 1) WHERE token = '{$token}'");
    }
    $name = $invite['name'];
    $link = 'http://elisaxslush.com/garage/?t=' . $newToken;
    $message .= "Hi!\n\n" . $name . " just registered for Elisa Garage Chillax and invites you to join the fun, too.\n\n**Elisa Garage Chillax takes place on the first day of Slush, November 18th at 6-9pm**, in our garage (Ratavartijankatu 5, Helsinki), just a 5-minute walk from the Slush venue.\n\nOur garage space is huge but has a guest limit! So sign up with your personal link right now: " . $link . " .\n\nThe program includes free food & drinks, music, dev comps, playing with facial recognition, and relaxing in big couches.\n\nFor the Slush participants, the night will continue at the official Slush after party in Messukeskus.\n\nWe look forward to having you here,\n\nHilla & Albert\nTeam behind Elisa X Slush\n\n\n--\nwww.elisa.com\nYou received this message because somebody sent an invite to your email.\n[" . date('Y-m-d G:i:s') . "]\n";
    //  $message = str_replace("\n", "\r\n", $message);
    $header = "From: Elisa X Slush <*****@*****.**>\r\n";
Example #9
0
<?php

require_once 'common.php';
$token = $db->escape_string($_GET['token']);
$name = $db->escape_string($_GET['name']);
$email = $db->escape_string($_GET['email']);
$phone = $db->escape_string($_GET['phone']);
logRequest('registration', 'token: ' . $token . '; email: ' . $email . '; name: ' . $name . '; phone: ' . $phone);
$timestamp = date('Y-m-d G:i:s');
$waitlist = false;
if (file_exists('event_full')) {
    $waitlist = true;
}
$waitlistSql = $waitlist ? ', waitinglist = 1' : '';
$sql = "UPDATE garage_invites SET name = '{$name}', email = '{$email}', phone = '{$phone}', registered = '{$timestamp}', visited = '{$timestamp}' {$waitlistSql} WHERE token = '{$token}'";
good_query($sql);
$tokenValid = $db->affected_rows > 0;
if ($tokenValid) {
    $response = array('status' => 'success');
} else {
    // Check if the error was due to duplicate email -> if so, just update the existing email invite
    $error = $db->error;
    if (stripos($error, "Duplicate") !== FALSE && stripos($error, "'email'") !== FALSE) {
        good_query("UPDATE garage_invites SET name = '{$name}', phone = '{$phone}', registered = '{$timestamp}', visited = '{$timestamp}' {$waitlistSql} WHERE email = '{$email}'");
        if ($db->affected_rows > 0) {
            $response = array('status' => 'success');
        } else {
            $response = array('status' => 'error', 'message' => 'Some unknown error occurred', 'code' => 'UNKNOWN');
        }
    } else {
        $response = array('status' => 'error', 'message' => 'No invitation found', 'code' => 'NOTFOUND');
Example #10
0
<?php

require_once 'bss_soap_client.php';
require_once 'log.php';
$service = "SessionService";
$method = "resolveUserToken";
$params = array('subscriptionKey' => $_REQUEST['subKey'], 'sessionId' => $_REQUEST['bssId'], 'userToken' => $_REQUEST['usertoken']);
$client = new bss_soap_client($service);
$result = $client->call($method, $params);
if ($client->getError()) {
    logRequest("{$service}.{$method}", false, $params, $client->getError());
} else {
    logRequest("{$service}.{$method}", false, $params, $result["return"]);
}
include "index.php";