Esempio n. 1
0
 /**
  * Check the connection
  */
 public function checkConnection()
 {
     $connection = false;
     if (preg_match("/logout/", $this->_client->getConstructResult(), $matches)) {
         $connection = true;
     }
     return $connection;
 }
Esempio n. 2
0
 private function logIn()
 {
     $html = file_get_contents('https://vpnaffiliates.com/affiliates/affiliates/login.php#login');
     if (preg_match("/\"S\\\\\",\\\\\"(.*?)\\\\\"/", $html, $matches)) {
         $this->_s = $matches[1];
     }
     $valuesLogin = array(new Oara_Curl_Parameter('D', '{"C":"Gpf_Rpc_Server", "M":"run", "requests":[{"C":"Gpf_Auth_Service", "M":"authenticate", "fields":[["name","value"],["Id",""],["username","' . $this->_credentials["user"] . '"],["password","' . $this->_credentials["password"] . '"],["rememberMe","Y"],["language","en-US"]]}], "S":"' . $this->_s . '"}'));
     $loginUrl = 'https://vpnaffiliates.com/affiliates/scripts/server.php?';
     $this->_client = new Oara_Curl_Access($loginUrl, $valuesLogin, $this->_credentials);
     $this->_loginResult = $this->_client->getConstructResult();
 }
Esempio n. 3
0
 /**
  * Constructor and Login
  * @param $credentials
  * @return Oara_Network_Publisher_Effiliation
  */
 public function __construct($credentials)
 {
     $user = $credentials['user'];
     $password = $credentials['password'];
     $loginUrl = 'http://es.publicideas.com/logmein.php';
     $valuesLogin = array(new Oara_Curl_Parameter('loginAff', $user), new Oara_Curl_Parameter('passAff', $password), new Oara_Curl_Parameter('userType', 'aff'));
     $this->_client = new Oara_Curl_Access($loginUrl, $valuesLogin, $credentials);
     $result = json_decode($this->_client->getConstructResult());
     $loginUrl = 'http://publisher.publicideas.com/entree_affilies.php';
     $valuesLogin = array(new Oara_Curl_Parameter('login', $result->login), new Oara_Curl_Parameter('pass', $result->pass), new Oara_Curl_Parameter('submit', 'Ok'), new Oara_Curl_Parameter('h', $result->h));
     $this->_client = new Oara_Curl_Access($loginUrl, $valuesLogin, $credentials);
 }
Esempio n. 4
0
 private function logIn()
 {
     $valuesLogin = array(new Oara_Curl_Parameter('_method', 'POST'), new Oara_Curl_Parameter('data[User][username]', $this->_credentials['user']), new Oara_Curl_Parameter('data[User][password]', $this->_credentials['password']));
     $loginUrl = 'https://affiliate.hidemyass.com/users/login';
     $this->_client = new Oara_Curl_Access($loginUrl, array(), $this->_credentials);
     $dom = new Zend_Dom_Query($this->_client->getConstructResult());
     $hidden = $dom->query('#loginform input[name*="Token"][type="hidden"]');
     foreach ($hidden as $values) {
         $valuesLogin[] = new Oara_Curl_Parameter($values->getAttribute("name"), $values->getAttribute("value"));
     }
     $urls = array();
     $urls[] = new Oara_Curl_Request('https://affiliate.hidemyass.com/users/login', $valuesLogin);
     $exportReport = $this->_client->post($urls);
 }
Esempio n. 5
0
 /**
  * Constructor and Login
  * @param $credentials
  * @return Oara_Network_Publisher_Effiliation
  */
 public function __construct($credentials)
 {
     $user = $credentials['user'];
     $password = $credentials['password'];
     $loginUrl = 'http://es.publicideas.com/logmein.php';
     /*
     		//getting the hidden value
     		$dom = new Zend_Dom_Query(file_get_contents("http://www.publicidees.es/"));
     		$results = $dom->query("input[name='h']");
     $hValue = null;
     		foreach ($results as $result) {
     			$hValue = $result->getAttribute('value');
     		}
     */
     $valuesLogin = array(new Oara_Curl_Parameter('loginAff', $user), new Oara_Curl_Parameter('passAff', $password), new Oara_Curl_Parameter('userType', 'aff'));
     $this->_client = new Oara_Curl_Access($loginUrl, $valuesLogin, $credentials);
     $result = json_decode($this->_client->getConstructResult());
     $loginUrl = 'http://affilie.publicidees.com/entree_affilies.php';
     $valuesLogin = array(new Oara_Curl_Parameter('login', $result->login), new Oara_Curl_Parameter('pass', $result->pass), new Oara_Curl_Parameter('submit', 'Ok'), new Oara_Curl_Parameter('h', $result->h));
     $this->_client = new Oara_Curl_Access($loginUrl, $valuesLogin, $credentials);
 }
Esempio n. 6
0
 private function logIn()
 {
     $dir = COOKIES_BASE_DIR . DIRECTORY_SEPARATOR . $this->_credentials['cookiesDir'] . DIRECTORY_SEPARATOR . $this->_credentials['cookiesSubDir'] . DIRECTORY_SEPARATOR;
     $cookieName = $this->_credentials["cookieName"];
     $cookies = $dir . $cookieName . '_cookies.txt';
     $defaultOptions = array(CURLOPT_USERAGENT => "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:22.0) Gecko/20100101 Firefox/22.0", CURLOPT_RETURNTRANSFER => true, CURLOPT_FAILONERROR => true, CURLOPT_COOKIEJAR => $cookies, CURLOPT_COOKIEFILE => $cookies, CURLOPT_AUTOREFERER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_HEADER => false);
     //Init curl
     $ch = curl_init();
     $options = $defaultOptions;
     $options[CURLOPT_URL] = 'http://ref.webhostinghub.com/affiliates/login.php#login';
     $options[CURLOPT_FOLLOWLOCATION] = true;
     curl_setopt_array($ch, $options);
     $result = curl_exec($ch);
     if (preg_match("/\"S\\\\\",\\\\\"(.*?)\\\\\"/", $result, $matches)) {
         $this->_s = $matches[1];
     }
     $valuesLogin = array(new Oara_Curl_Parameter('D', '{"C":"Gpf_Rpc_Server", "M":"run", "requests":[{"C":"Gpf_Auth_Service", "M":"authenticate", "fields":[["name","value"],["Id",""],["username","' . $this->_credentials["user"] . '"],["password","' . $this->_credentials["password"] . '"],["rememberMe","Y"],["language","en-US"]]}], "S":"' . $this->_s . '"}'));
     $loginUrl = 'http://ref.webhostinghub.com/scripts/server.php';
     $this->_client = new Oara_Curl_Access($loginUrl, $valuesLogin, $this->_credentials);
     $this->_loginResult = $this->_client->getConstructResult();
 }