Example #1
0
 private function __construct($l, $p)
 {
     self::$_login = $l;
     self::$_password = $p;
     $content = $this->read($this->url['mobile']);
     if ($this->checkAuthorization($content) === false) {
         preg_match('/<form method="post" action="(.*)" novalidate>/', $content, $hash);
         $response = $this->connect($hash[1], array('email' => str_replace(' ', '+', self::$_login), 'pass' => str_replace(' ', '+', self::$_password)), $this->url['mobile']);
         //file_put_contents(__DIR__ . '/cookies_tmp/r.txt', $response); exit;
         if ($this->checkAuthorization($response) === false) {
             $checkData = $this->checkPhoneConfirm($response, self::$_login);
             if ($checkData === false) {
                 $this->sendError('Login incorrect.');
             } else {
                 // Вводим суке телефон.
                 $this->sleep();
                 $response = $this->connect($this->url['mobile'] . $checkData['action'], array('code' => $checkData['phone']));
                 //file_put_contents(__DIR__ . '/cookies_tmp/phone.txt', $response);
                 if ($this->checkAuthorization($response) === false) {
                     $this->sendError('Fail phone crack!');
                 }
             }
         }
         $this->sleep();
     }
 }