예제 #1
0
<?php

//Author: satya gowtham kudupudi
//Time: 2012-03-04 13:08:00
require 'HTTP/Request2.php';
$url = 'http://mail.ferryfair.com/PHPWebAdmin/index.php';
$r = new Http_Request2($url);
$r->setMethod(HTTP_Request2::METHOD_POST);
$r->setHeader(array("Accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Charset" => "ISO-8859-1,utf-8;q=0.7,*;q=0.3", "Accept-Encoding" => "gzip,deflate,sdch", "Accept-Language" => "en-US,en;q=0.8,te;q=0.6", "Cache-Control" => "max-age=0", "Connection" => "keep-alive", "Content-Length" => "355", "Content-Type" => "application/x-www-form-urlencoded"));
$r->addPostParameter(array('page' => 'background_account_save', 'action' => 'edit', 'domainid' => '1', 'accountid' => '12', 'accountaddress' => 'capt.roja', 'accountpassword' => 'g2wjzxx1NXDeujPW', 'accountmaxsize' => '100', 'accountadminlevel' => '0', 'accountactive' => '1', 'vacationsubject' => '', 'vacationmessage' => '', 'vacationmessageexpiresdate' => '2012-03-04', 'forwardaddress' => '', 'SignaturePlainText' => '', 'SignatureHTML' => '', 'addomain' => '', 'adusername' => '', 'PersonFirstName' => '', 'PersonLastName' => ''));
$r->send();
$page = $r->getBody();
print_r($page);
예제 #2
0
                 ob_flush();
                 flush();
                 ob_start();
                 break;
             }
         }
         echo '<rs/>';
         ob_end_flush();
         ob_flush();
         flush();
         ob_start();
     }
     $r = new Http_Request2('https://collegedb2.ferryfair.com/lib/signOut.php');
     $r->setConfig(array("ssl_verify_peer" => FALSE, "ssl_local_cert" => "{$root}/ssl/collegedb2.ferryfair.com.cert"));
     $r->setMethod(HTTP_Request2::METHOD_POST);
     $r->addPostParameter(array('SESSION_ID' => $sessionId));
     //$r->addCookie('PHPSESSID', 'bkq0t2vf2n9898t4q83jje7bp7');
     //$r->addCookie('XDEBUG_SESSION', 'netbeans-xdebug');
     try {
         $response = $r->send();
     } catch (Exception $exc) {
         $es = $exc->getTraceAsString();
         $response = NULL;
     }
     $body = $response->getBody();
     if (strpos($body, "<status>signedOut</status>") >= 0) {
         echo json_encode(array('status' => 'I, dataGrabber.php finished my job ~:)~'));
     } else {
         echo json_encode(array('status' => 'I, dataGrabber.php unable to signOut from the ferry ~:|~'));
     }
 } else {
 private function post_to_twitter($resp_data)
 {
     if ($this->format == 'json') {
         $data = json_decode($resp_data);
     } elseif ($this->format == 'xml') {
         $data = simplexml_load_string($resp_data);
     }
     $tweet = $this->truncate((string) $data->text) . ' ' . (string) $data->url;
     $header = $this->build_header($tweet);
     $url = "http://api.twitter.com/1/statuses/update.{$this->format}";
     $r = new Http_Request2($url, Http_Request2::METHOD_POST);
     $r->setHeader('Authorization', $header);
     $r->addPostParameter('status', $tweet);
     $res = $r->send();
     if ($res->getStatus() == 200) {
         return $this->respond($resp_data);
     } else {
         throw new TwitPicAPIException("Image uploaded, but error posting to Twitter");
     }
 }
예제 #4
0
 $error3 = mysql_error($dbc);
 if (!$error3) {
     $mkdir = mkdir('../../userFiles/' . $usrname);
     $fhandler = fopen('../../userFiles/' . $usrname . '/live.shm', 'w');
     fclose($fhandler);
     $photo_id = $_POST['photoID'];
     if (copy('../../tmp/' . $photo_id, '../../userFiles/' . $usrname . '/' . $photo_id)) {
         unlink('../../tmp/' . $photo_id);
     }
     // Connect to hMailServer
     require 'HTTP/Request2.php';
     $url = 'http://mail.ferryfair.com/PHPWebAdmin/standardAccountCreator.php';
     $r = new Http_Request2($url);
     $r->setMethod(HTTP_Request2::METHOD_POST);
     $r->setHeader(array("Content-Type" => "application/x-www-form-urlencoded"));
     $r->addPostParameter(array('username' => $usrname, 'ePass' => $ePass, 'fullName' => $_POST['fullName']));
     $r->addCookie('PHPSESSID', 'bkq0t2vf2n9898t4q83jje7bp7');
     $r->addCookie('XDEBUG_SESSION', 'netbeans-xdebug');
     $response = $r->send();
     $page = $response->getBody();
     $dd = new DOMDocument();
     $dd->loadXML($page);
     $st = innerHTML($dd->getElementsByTagName('status')->item(0));
     $accountId = innerHTML($dd->getElementsByTagName('accountId')->item(0));
     if ($mkdir && $accountId) {
         $key = ftok('../../userFiles/' . $usrname . '/live.shm', 'c');
         $shmId = shm_attach($key);
         $user['status'] = 0;
         $user['nickName'] = trim($nickName, "'");
         $user['username'] = $usrname;
         $user['lat'] = time();