Example #1
0
 function nxsCptCheck_ajax()
 {
     global $nxs_gCookiesArr;
     if ($_POST['c'] != '') {
         $seForDB = get_option('nxs_li_ctp_save');
         $ser = maybe_unserialize($seForDB);
         $nxs_gCookiesArr = $ser['c'];
         $flds = $ser['f'];
         $flds['recaptcha_response_field'] = $_POST['c'];
         $cfldsTxt = build_http_query($flds);
         //  prr($cfldsTxt); prr($nxs_gCookiesArr);
         $contents2 = getCurlPageX('https://www.linkedin.com/uas/captcha-submit', 'https://www.linkedin.com/uas/login-submit', false, $cfldsTxt, false, $advSettings);
         //   prr($contents2);
         if (stripos($contents2['content'], 'The email address or password you provided does not match our records') !== false) {
             echo "Invalid Login/Password";
             die;
         }
         if (stripos($contents2['url'], 'linkedin.com/uas/captcha-submit') !== false) {
             echo "Wrong Captcha. Please try Again";
         }
         if (stripos($contents2['url'], 'linkedin.com/home') !== false) {
             echo "OK. You are In";
             $contents3 = getCurlPageX('http://www.linkedin.com/profile/edit?trk=tab_pro', 'http://www.linkedin.com/home', false, '', false, $advSettings);
             // prr($contents3);
             if ($_POST['i'] != '') {
                 global $plgn_NS_SNAutoPoster;
                 if (!isset($plgn_NS_SNAutoPoster)) {
                     return;
                 }
                 $options = $plgn_NS_SNAutoPoster->nxs_options;
                 $options['li'][$_POST['i']]['uCook'] = $nxs_gCookiesArr;
                 if (is_array($options)) {
                     update_option('NS_SNAutoPoster', $options);
                 }
             }
         }
     }
     die;
 }
	function doConnectToPinterest($email, $pass) {
		global $nxs_gCookiesArr, $nxs_gTkn, $nxs_gPNBoards;
		$nxs_gCookiesArr = array ();
		$advSettings = array ();
		$err = nxsCheckSSLCurl ( 'https://www.pinterest.com' );
		if ($err !== false && $err ['errNo'] == '60')
			$advSettings ['noSSLSec'] = true;
		$contents = getCurlPageX ( 'https://pinterest.com/login/?next=%2F', 'https://pinterest.com', true, '', false, $advSettings );
		// ## GET HIDDEN FIELDS
		$md = array ();
		$mids = '';
		while ( stripos ( $contents, "'hidden'" ) !== false ) {
			$contents = substr ( $contents, stripos ( $contents, "'hidden'" ) + 8 );
			$name = trim ( CutFromTo ( $contents, "name='", "'" ) );
			if (! in_array ( $name, $md )) {
				$md [] = $name;
				$val = trim ( CutFromTo ( $contents, "value='", "'" ) );
				$flds [$name] = $val;
				if ($name == 'csrfmiddlewaretoken')
					$nxs_gTkn = $val;
				$mids .= "&" . $name . "=" . $val;
			}
		}
		$flds ['email'] = $email;
		$flds ['password'] = $pass;
		$fldsTxt = build_http_query ( $flds );
		$advSettings ['Origin'] = 'https://pinterest.com';
		// ## ACTUAL LOGIN
		$contents = getCurlPageX ( 'https://pinterest.com/login/?next=%2Flogin%2F', 'https://pinterest.com/login/?next=%2F', true, $fldsTxt, false, $advSettings ); // echo
		                                                                                                                                                            // $fldsTxt;
		                                                                                                                                                            // prr($contents);
		                                                                                                                                                            // die();
		if (stripos ( $contents, 'UserNav' ) !== false) { // echo "You are IN";
			$txt = CutFromTo ( $contents, 'class="BoardList"', '</ul>' );
			$txta = explode ( '<li', $txt ); // prr($txta);
			$items = array();
			foreach ( $txta as $txti )
				if (stripos ( $txti, 'data=' ) !== false) {
					$val = CutFromTo ( $txti, 'data="', '"' );
					$name = CutFromTo ( $txti, '<span>', '</span>' );
					// $items .= '{"optionValue": '.$val.', "optionDisplay":
					// "'.$name.'"},'; } $nxs_gPNBoards = '['.substr($items, 0 ,
					// -1).']'; // JSON, But WHY?
					//$items .= '<option value="' . $val . '">' . $name . '</option>';
					$items[] = array('value'=>$val, 'label'=>$name);
				}
			$nxs_gPNBoards = $items;
			return false;
		} else if (stripos ( 'IP because of suspicious activity', $contents ) !== false)
			return 'Pinterest blocked logins from this IP because of suspicious activity';
		else
			return 'Incorrect Username/Password ';
		return false;
	}
	function doConnectToBlogger($email, $pass) {
		global $nxs_gCookiesArr, $gPlusRecoveryEmail, $gPlusRecoveryPhone;
		$nxs_gCookiesArr = array ();
		if ($gPlusRecoveryPhone == '' && isset ( $_COOKIE ['gPlusRecoveryPhone'] ) && $_COOKIE ['gPlusRecoveryPhone'] != '') {
			$gPlusRecoveryPhone = $_COOKIE ['gPlusRecoveryPhone'];
			if (! headers_sent ()) {
				setcookie ( "gPlusRecoveryPhone", "", time () - 3600 );
				setcookie ( "gPlusRecoveryPhoneHint", "", time () - 3600 );
			}
		}
		if ($gPlusRecoveryEmail == '' && isset ( $_COOKIE ['gPlusRecoveryEmail'] ) && $_COOKIE ['gPlusRecoveryEmail'] != '') {
			$gPlusRecoveryEmail = $_COOKIE ['gPlusRecoveryEmail'];
			if (! headers_sent ()) {
				setcookie ( "gPlusRecoveryEmail", "", time () - 3600 );
				setcookie ( "gPlusRecoveryEmailHint", "", time () - 3600 );
			}
		}
		$contents = getCurlPageX ( 'https://accounts.google.com/ServiceLogin?service=blogger&passive=1209600&continue=http://www.blogger.com/home', '', true );
		// ## GET HIDDEN FIELDS
		$md = array ();
		$mids = '';
		while ( stripos ( $contents, '"hidden"' ) !== false ) {
			$contents = substr ( $contents, stripos ( $contents, '"hidden"' ) + 8 );
			$name = trim ( CutFromTo ( $contents, 'name="', '"' ) );
			if (! in_array ( $name, $md )) {
				$md [] = $name;
				$val = trim ( CutFromTo ( $contents, 'value="', '"' ) );
				$flds [$name] = $val;
				$mids .= "&" . $name . "=" . $val;
			}
		}
		$flds ['Email'] = $email;
		$flds ['Passwd'] = $pass;
		$flds ['signIn'] = 'Sign%20in';
		$fldsTxt = build_http_query ( $flds ); // echo $fldsTxt;
		                                    // ## ACTUAL LOGIN
		$contents = getCurlPageX ( 'https://accounts.google.com/ServiceLoginAuth', '', false, $fldsTxt, false, array (
				'cdomain' => 'google.com' 
		) ); // prr($contents); die();
		if (stripos ( $contents ['url'], 'NewPrivacyPolicy' ) !== false)
			return 'Please login to your account and accept new "New Privacy Policy"';
		if (stripos ( $contents ['content'], 'captcha-box' ) !== false)
			return 'Captcha is "On" for your account. Please login to your account from the bworser and try clearing the CAPTCHA by visiting this link: <a href="https://www.google.com/accounts/DisplayUnlockCaptcha" target="_blank">https://www.google.com/accounts/DisplayUnlockCaptcha</a>. If you\'re a Google Apps user, visit https://www.google.com/a/yourdomain.com/UnlockCaptcha in order to clear the CAPTCHA. Be sure to replace \'yourdomain.com\' with your actual domain name.';
		if (stripos ( $contents ['url'], 'ServiceLoginAuth' ) !== false)
			return 'Incorrect Username/Password ' . $contents ['errmsg'];
		
		if (stripos ( $contents ['content'], 'is that really you' ) !== false || stripos ( $contents ['url'], 'LoginVerification' ) !== false) {
			$text = $contents ['content'];
			$flds = array ();
			while ( stripos ( $text, '"hidden"' ) !== false ) {
				$text = substr ( $text, stripos ( $text, '"hidden"' ) + 8 );
				$name = trim ( CutFromTo ( $text, 'name="', '"' ) );
				if (! in_array ( $name, $md )) {
					$md [] = $name;
					$val = trim ( CutFromTo ( $text, 'value="', '"' ) );
					$flds [$name] = $val;
					$mids .= "&" . $name . "=" . $val;
				}
			} // prr($flds);
			
			if ($gPlusRecoveryEmail == '' && $gPlusRecoveryPhone == '') {
				
				if (stripos ( $contents ['content'], 'RecoveryEmailChallenge' ) !== false) {
					if (stripos ( $contents ['content'], 'RecoveryEmailChallengeLabel">' ) !== false)
						$recEm = trim ( str_ireplace ( "\n", "", CutFromTo ( $contents ['content'], 'RecoveryEmailChallengeLabel">', '</label>' ) ) );
					return "<b style='color:red'>Google Error Message: </b><b>Login Verification is required. Please Enter your Google backup/recovery email (" . $recEm . ").</b><br/>Please see here how to add your backup/recovery email to Google: <a href='http://support.google.com/accounts/bin/answer.py?hl=en&answer=183726'>http://support.google.com/accounts/bin/answer.py?hl=en&answer=183726</a>" . '<script type="text/javascript">   function nxs_setRecCookies(cVal, cHint){ document.cookie = "gPlusRecoveryEmail="+cVal;  document.cookie = "gPlusRecoveryEmailHint="+cHint; } </script>Enter full recovery email address: <input type="tel" name="recoveryEmail" onchange="nxs_setRecCookies(this.value, \'' . $recEm . '\');" id="recoveryEmail" size="30" placeholder="Enter full recovery email address"><br/>
        Please click "OK", then click "Submit Test Post to Blogger" button again to confirm and verify your account.<br/>';
				} elseif (stripos ( $contents ['content'], 'PhoneVerificationChallenge' ) !== false) {
					if (stripos ( $contents ['content'], "Confirm my phone number:" ) !== false)
						$recEm = trim ( CutFromTo ( $contents ['content'], "Confirm my phone number:", "</label>" ) );
					return "<b style='color:red'>Google Error Message: </b><b>Login Verification is required. Please Enter your Google phone number (" . $recEm . ").</b><br/>" . '        
        Enter full phone number: <input type="tel" name="phoneNumber" onchange="document.cookie = \'gPlusRecoveryPhone=\'+this.value;document.cookie = \'gPlusRecoveryPhoneHint=' . $recEm . '\';" id="phoneNumber" size="30" placeholder="Enter full phone number"><br/>
        Please click "OK", then click "Submit Test Post to Blogger" button again to confirm and verify your account.<br/>';
				}
			} else {
				if ($gPlusRecoveryEmail != '') {
					if (trim ( $gPlusRecoveryEmail ) == trim ( $email ))
						return "<b style='color:red'>Google Error Message: </b><b>Your recovery email could not be the same as your login email.</b> Google Help: <a href='http://support.google.com/accounts/bin/answer.py?hl=en&answer=183726'>http://support.google.com/accounts/bin/answer.py?hl=en&answer=183726</a>";
					
					$bgc = CutFromTo ( $contents ['content'], "document.bg = new botguard.bg('", "');" );
					$contents = getCurlPageX ( 'http://www.nextscripts.com/bg.php', '', true, 'bg=' . $bgc );
					$fldsTxt = 'continue=http%3A%2F%2Fwww.blogger.com%2Fhome&service=blogger&_utf8=%E2%98%83&bgresponse=' . $contents . '&challengestate=' . $flds ['challengestate'] . '&challengetype=RecoveryEmailChallenge&emailAnswer=' . urlencode ( $gPlusRecoveryEmail ) . '&answer=';
					$contents = getCurlPageX ( 'https://accounts.google.com/LoginVerification', '', false, $fldsTxt );
					
					if (stripos ( $contents ['content'], 'class="errormsg"' ) !== false) {
						$errMsg = CutFromTo ( $contents ['content'], 'class="errormsg"', "/div>" );
						$errMsg = CutFromTo ( $errMsg, '>', "<" );
						return '<b style="color:red">Google Error Message: </b><b>Unable to verify your recovery email.</b> Google Help: <a target="_blank" href="http://support.google.com/accounts/bin/answer.py?hl=en&answer=183726">http://support.google.com/accounts/bin/answer.py?hl=en&answer=183726</a>. Enter full recovery email address: ' . $_COOKIE ["gPlusRecoveryEmailHint"] . '<input type="tel" name="recoveryEmail" onchange="document.cookie = \'gPlusRecoveryEmail=\'+this.value; document.cookie = \'gPlusRecoveryEmailHint=' . $_COOKIE ["gPlusRecoveryEmailHint"] . '\';" id="recoveryEmail" size="30" placeholder="Enter full recovery email address"><br/>Please click "OK", then click "Submit Test Post to Google+" button again to confirm and verify your account.<br/>';
					}
					if ($contents ['http_code'] == '400' || stripos ( $contents ['content'], 'there seems to be a problem' ) !== false) {
						return '<b style="color:red">NX Error Message: </b><b>Unable to verify your Phone. Something went wrong. Please contact support.';
					}
				}
				if ($gPlusRecoveryPhone != '') {
					$bgc = CutFromTo ( $contents ['content'], "document.bg = new botguard.bg('", "');" );
					$contents = getCurlPageX ( 'http://www.nextscripts.com/bg.php', '', true, 'bg=' . $bgc );
					$fldsTxt = 'continue=https%3A%2F%2Fplus.google.com%2F%3Fgpsrc%3Dogpy0%26tab%3DwX%26gpcaz%3D38f4feed&_utf8=%E2%98%83&bgresponse=' . $contents . '&phoneNumber=' . urlencode ( $gPlusRecoveryPhone ) . '&challengetype=PhoneVerificationChallenge&emailAnswer=&answer=&challengestate=' . $flds ['challengestate'];
					$contents = getCurlPageX ( 'https://accounts.google.com/LoginVerification?Email=' . urlencode ( $email ) . '&continue=https%3A%2F%2Fplus.google.com%2F%3Fgpsrc%3Dogpy0%26tab%3DwX%26gpcaz%3D38f4feed&service=blogger', '', false, $fldsTxt );
					if (stripos ( $contents ['content'], 'class="errormsg"' ) !== false) {
						$errMsg = CutFromTo ( $contents ['content'], 'class="errormsg"', "/div>" );
						$errMsg = CutFromTo ( $errMsg, '>', "<" );
						return '<b style="color:red">Google Error Message: </b> ' . $errMsg . '<br/><br/> <b>Unable to verify your Phone ' . $gPlusRecoveryPhone . '.</b><br/> Google Help: <a target="_blank" href="http://support.google.com/accounts/bin/answer.py?hl=en&answer=1187657">http://support.google.com/accounts/bin/answer.py?hl=en&answer=1187657</a><br/>. Enter full phone number: ' . $_COOKIE ["gPlusRecoveryPhoneHint"] . '<input type="tel" name="phoneNumber" onchange="document.cookie = \'gPlusRecoveryPhone=\'+this.value; document.cookie = \'gPlusRecoveryPhoneHint=' . $_COOKIE ["gPlusRecoveryPhoneHint"] . '\';" id="phoneNumber" size="30" placeholder="Enter full phone number"><br/>Please click "OK", then click "Submit Test Post to Blogger" button again to confirm and verify your account.<br/>';
					}
					if ($contents ['http_code'] == '400' || stripos ( $contents ['content'], 'there seems to be a problem' ) !== false) {
						return '<b style="color:red">NX Error Message: </b><b>Unable to verify your Phone. Something went wrong. Please contact support.';
					}
				}
			}
		}
		return false;
	}