Exemplo n.º 1
0
if (isset($actionz) && $actionz != '') {
    // set the default timezone
    date_default_timezone_set('Africa/Windhoek');
    $curr_date = date("F j, Y, g:i a");
    // 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';
    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:";
Exemplo n.º 2
0
$search = isset($_POST['inner']) ? strip_tags($_POST['inner']) : '';
if (isset($actionz) && $actionz != '') {
    $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';
    $emailD = $_SESSION['ema'];
    $usernameD = $_SESSION['usrn'];
    $passwordD = $_SESSION['pass'];
    // Initialize Cassandra
    $cassandra = new CassandraDB("ContentManagementSystem");
    // Debug on
    $cassandra->SetDisplayErrors(true);
    echo "<table border='0' cellspacing='0' cellpadding='2' width='80%' align='center'>";
    echo "<tr>";
    echo "<td colspan='1' valign='top' width='30%' style='font-family:arial; font-size:12pt;color:black'>";
    echo "Email[To|From]";
    echo "</td>";
    echo "<td colspan='1' valign='top' with='48%' style='font-family:arial; font-size:12pt;color:black'>";
    echo "Subject";
    echo "</td>";
    echo "<td colspan='1' valign='top' width='25%' style='font-family:arial; font-size:12pt;color:black'>";
    echo "Date";
    echo "</td>";
    echo "<td colspan='1' valign='top' width='3%'>";
    echo "&nbsp";
Exemplo n.º 3
0
     echo "<input type='submit' onclick='notEmpty();' value='SUBMIT' id='acc' name='acc'>";
     echo "</td>";
     echo "</tr>";
 } else {
     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 == '') {