Esempio n. 1
0
    $GLOBALS['THRIFT_ROOT'] = 'C:/xampp/htdocs/cassandra';
    // Load up all the thrift stuff
    require_once $GLOBALS['THRIFT_ROOT'] . '/class.php';
    require_once $GLOBALS['THRIFT_ROOT'] . '/Thrift.php';
    require_once $GLOBALS['THRIFT_ROOT'] . '/protocol/TBinaryProtocol.php';
    require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TSocket.php';
    require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TBufferedTransport.php';
    require_once $GLOBALS['THRIFT_ROOT'] . '/tmp.php';
    require_once $GLOBALS['THRIFT_ROOT'] . '/key.php';
    // Initialize Cassandra
    $cassandra = new CassandraDB("ContentManagementSystem");
    // Debug on
    $cassandra->SetDisplayErrors(true);
    $keyC = key_cms();
    $record = array("to" => "{$to}", "from" => "{$from}", "subject" => "{$subject}", "content" => "{$content}", "timestamp" => "{$curr_date}", "status" => "unread");
    if ($cassandra->InsertRecordArray("cms", $keyC, $record)) {
        $records = $cassandra->GetRecordByKey("cms", $keyC);
        echo "<span style='font-family:arial; font-size:10pt;color:#045FB4;'>Your message has been sent!</span><br />";
        echo "<span style='font-family:arial; font-size:10pt;color:#045FB4;'>To:</span>\n\t\t<span style='font-family:arial; font-size:10pt;color:black;'>" . $records['to'] . '<span><br / >';
    }
} else {
    echo "<form method='POST' action='default.php?do=compose&act=sent'>";
    echo "<table border='0' cellspacing='0' cellpadding='0' width='100%'>";
    echo "<tr>";
    echo "<td colspan='1' width='8%' style='font-family:arial; font-size:10pt;color:#045FB4;'>";
    echo "To:";
    echo "</td>";
    echo "<td colspan='1' >";
    echo "<input type='text' name='to' id='to' size='65'>";
    echo "</td>";
    echo "</tr>";
Esempio n. 2
0
 if (isset($acc) && $acc != '' && $_POST['pwd1'] == $_POST['pwd2']) {
     // Setup the path to the thrift library folder
     $GLOBALS['THRIFT_ROOT'] = 'C:/xampp/htdocs/cassandra';
     // Load up all the thrift stuff
     require_once $GLOBALS['THRIFT_ROOT'] . '/class.php';
     require_once $GLOBALS['THRIFT_ROOT'] . '/Thrift.php';
     require_once $GLOBALS['THRIFT_ROOT'] . '/protocol/TBinaryProtocol.php';
     require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TSocket.php';
     require_once $GLOBALS['THRIFT_ROOT'] . '/transport/TBufferedTransport.php';
     require_once $GLOBALS['THRIFT_ROOT'] . '/tmp.php';
     // Initialize Cassandra
     $cassandra = new CassandraDB("ContentManagementSystem");
     // Debug on
     $cassandra->SetDisplayErrors(true);
     $record = array("email" => "{$email}", "password" => "{$password}");
     if ($cassandra->InsertRecordArray("users", "{$username}", $record)) {
         //get record
         $records = $cassandra->GetRecordByKey("users", "{$username}");
         //email,pass and name
         $_SESSION['ema'] = $records['email'];
         //redirect after making sure that the user is registered and use sessions
         echo "<script language=\"javascript\" type=\"text/javascript\">";
         echo "window.location=\"default.php\"";
         echo "</script>";
     }
 } else {
     if ($acc == '' || $create == '' || $submitted == '') {
         echo "<tr>";
         echo "<td colspan='2' valign='top' style='font-family:arial; font-size:14pt;color:#045FB4;'>";
         echo "Please Login to access your Emails:";
         echo "</td>";