function connect($u,$p,$srv='GP'){ $sslverify = true; if ($this->debug) echo "[".$srv."] L to: ".$srv."<br/>\r\n";
     $err = nxsCheckSSLCurl('https://www.google.com'); if ($err!==false && $err['errNo']=='60') $sslverify = false;  
     if ($srv == 'GP') $lpURL = 'https://accounts.google.com/ServiceLogin?service=oz&continue=https://plus.google.com/?gpsrc%3Dogpy0%26tab%3DwX%26gpcaz%3Dc7578f19&hl=en-US'; 
     if ($srv == 'YT') $lpURL = 'https://accounts.google.com/ServiceLogin?service=oz&checkedDomains=youtube&checkConnection=youtube%3A271%3A1%2Cyoutube%3A69%3A1&continue=https://www.youtube.com/&hl=en-US';   
     if ($srv == 'BG') $lpURL = 'https://accounts.google.com/ServiceLogin?service=blogger&passive=1209600&continue=https://www.blogger.com/home&followup=https://www.blogger.com/home&ltmpl=start';
     $hdrsArr = $this->headers('https://accounts.google.com/'); $rep = nxs_remote_get($lpURL, array('headers' => $hdrsArr, 'httpversion' => '1.1', 'sslverify'=>$sslverify)); 
     if (is_nxs_error($rep)) {  $badOut = print_r($rep, true)." - ERROR X ="; return $badOut; } $ck = $rep['cookies']; $contents = $rep['body']; //if ($this->debug) prr($contents); 
     //## GET HIDDEN FIELDS
     $md = array(); $flds  = array();
     while (stripos($contents, '<input')!==false){ $inpField = trim(CutFromTo($contents,'<input', '>')); $name = trim(CutFromTo($inpField,'name="', '"'));
       if ( stripos($inpField, '"hidden"')!==false && $name!='' && !in_array($name, $md)) { $md[] = $name; $val = trim(CutFromTo($inpField,'value="', '"')); $flds[$name]= $val;}
       $contents = substr($contents, stripos($contents, '<input')+8);          
     } $flds['Email'] = $u; $flds['Passwd'] = $p;  $flds['signIn'] = 'Sign%20in'; $flds['PersistentCookie'] = 'yes'; $flds['rmShown'] = '1'; $flds['pstMsg'] = '1'; // $flds['bgresponse'] = $bg;
     //if ($srv == 'GP' || $srv == 'BG') $advSettings['cdomain']='google.com';
     //## ACTUAL LOGIN    
     $hdrsArr = $this->headers($lpURL, 'https://accounts.google.com', 'POST'); 
     $advSet = array('headers' => $hdrsArr, 'httpversion' => '1.1', 'timeout' => 45, 'redirection' => 0, 'cookies' => $ck, 'body' => $flds, 'sslverify'=>$sslverify);// prr($advSet);
     $rep = nxs_remote_post('https://accounts.google.com/ServiceLoginAuth', $advSet); if (is_nxs_error($rep)) {  $badOut = print_r($rep, true)." - ERROR 3="; return $badOut; } $ck = $rep['cookies']; //prr($rep);
     $unlockCaptchaMsg = "Your Google+ account is locked for the new applications to connect. Please follow this instructions to unlock it: <a href='http://www.nextscripts.com/support-faq/#q21' target='_blank'>http://www.nextscripts.com/support-faq/#q21</a> - Question #2.1.";
     if ($rep['response']['code']=='200' && !empty($rep['body'])) { $rep['body'] = str_ireplace('\'CREATE_CHANNEL_DIALOG_TITLE_IDV_CHALLENGE\': "Verify your identity"', "", $rep['body']);
         if (stripos($rep['body'],'class="error-msg"')!==false) return strip_tags(CutFromTo(CutFromTo($rep['body'],'class="error-msg"','/span>'), '>', '<'));
         if (stripos($rep['body'],'class="captcha-box"')!==false || stripos($rep['body'],'is that really you')!==false || stripos($rep['body'],'Verify your identity')!==false) return $unlockCaptchaMsg;
     }
     if ($rep['response']['code']=='302' && !empty($rep['headers']['location']) && stripos($rep['headers']['location'], 'ServiceLoginAuth')!==false) return 'Incorrect Username/Password ';
     if ($rep['response']['code']=='302' && !empty($rep['headers']['location']) && stripos($rep['headers']['location'], 'LoginVerification')!==false) return $unlockCaptchaMsg;
     if ($rep['response']['code']=='302' && !empty($rep['headers']['location']) && ( stripos($rep['headers']['location'], '/SmsAuth')!==false || stripos($rep['headers']['location'], '/SecondFactor')!==false)) return '<b style="color:#800000;">2-step verification is on.</b> <br/><br/> 2-step verification is not compatible with auto-posting. <br/><br/>Please see more here:<br/> <a href="http://www.nextscripts.com/blog/google-2-step-verification-and-auto-posting" target="_blank">Google+, 2-step verification and auto-posting</a><br/>'; 
     if ($rep['response']['code']=='302' && !empty($rep['headers']['location'])) { 
         if ($srv == 'BG') $rep['headers']['location'] = 'https://accounts.google.com/CheckCookie?checkedDomains=youtube&checkConnection=youtube%3A170%3A1&pstMsg=1&chtml=LoginDoneHtml&service=blogger&continue=https%3A%2F%2Fwww.blogger.com%2Fhome&gidl=CAA'; 
         if ($srv == 'YT') $rep['headers']['location'] = 'https://accounts.google.com/CheckCookie?hl=en-US&checkedDomains=youtube&checkConnection=youtube%3A271%3A1%2Cyoutube%3A69%3A1&pstMsg=1&chtml=LoginDoneHtml&service=oz&continue=https%3A%2F%2Fwww.youtube.com%2F&gidl=CAA';
         if ($srv == 'GP') $rep['headers']['location'] = 'https://accounts.google.com/CheckCookie?hl=en-US&checkedDomains=youtube&checkConnection=youtube%3A179%3A1&pstMsg=1&chtml=LoginDoneHtml&service=oz&continue=https%3A%2F%2Fplus.google.com%2F%3Fgpsrc%3Dogpy0%26tab%3DwX%26gpcaz%3Dc7578f19&gidl=CAA';           
       if ($this->debug) echo "[".$srv."] R to: ".$rep['headers']['location']."<br/>\r\n";  $hdrsArr = $this->headers($lpURL, 'https://accounts.google.com');
       $repLoc = $rep['headers']['location']; 
       $rep = nxs_remote_get($repLoc, array('headers' => $hdrsArr, 'redirection' => 0, 'httpversion' => '1.1', 'cookies' => $ck, 'sslverify'=>$sslverify));     
       if (!is_nxs_error($rep) && $srv == 'YT' && $rep['response']['code']=='302' && !empty($rep['headers']['location'])) { $repLoc = $rep['headers']['location'];             
         $rep = nxs_remote_get($repLoc, array('headers' => $hdrsArr, 'redirection' => 0, 'httpversion' => '1.1', 'cookies' => $ck, 'sslverify'=>$sslverify)); $ck = $rep['cookies'];                             
       } if (is_nxs_error($rep)) {  $badOut = print_r($rep, true)." - ERROR 4="; return $badOut; } $contents = $rep['body']; $rep['body'] = '';          
       //## BG Auth redirect          
       if ($srv != 'GP' && stripos($contents, 'meta http-equiv="refresh"')!==false) {$rURL = htmlspecialchars_decode(CutFromTo($contents,';url=','"')); 
         if ($this->debug) echo "[".$srv."] R to: ".$rURL."<br/>\r\n";  $hdrsArr = $this->headers($repLoc);// prr($hdrsArr);
         $rep = nxs_remote_get($rURL, array('headers' => $hdrsArr, 'redirection' => 0, 'httpversion' => '1.1', 'sslverify'=>$sslverify));//  prr($rep);
         if (is_nxs_error($rep)) {  $badOut = print_r($rep, true)." - ERROR 5="; return $badOut; } $ck = $rep['cookies'];
         if (!empty($rep['headers']['location'])) { $rURL = $rep['headers']['location'];
           $rep = nxs_remote_get($rURL, array('headers' => $hdrsArr, 'redirection' => 0, 'httpversion' => '1.1',  'cookies' => $ck, 'sslverify'=>$sslverify));
           if (is_nxs_error($rep)) {  $badOut = print_r($rep, true)." - ERROR 6="; return $badOut; }              
           if (!empty($rep['headers']['location'])) { $rURL = $rep['headers']['location']; 
             $rep = nxs_remote_get($rURL, array('headers' => $hdrsArr, 'redirection' => 0, 'httpversion' => '1.1',  'cookies' => $ck, 'sslverify'=>$sslverify)); 
             if (is_nxs_error($rep)) {  $badOut = print_r($rep, true)." - ERROR 7="; return $badOut; }
           } if (!empty($rep['headers']['location'])) $ck = $rep['cookies']; else $rep['cookies'] = $ck;
         } $ck = $rep['cookies'];  
       } $this->ck = $ck; return false;  
     } return 'Unexpected Error, Please contact support';  
 }
	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;
	}
Example #3
0
        function NS_SNAP_ShowPageTop()
        {
            global $nxs_snapAvNts, $nxs_snapThisPageUrl, $nxsOne, $nxs_plurl, $nxs_isWPMU, $nxs_skipSSLCheck;
            $nxsOne = '';
            $cstIt = 0;
            $options = $this->nxs_options;
            if ($_GET['page'] == 'NextScripts_SNAP.php' && isset($_GET['do']) && $_GET['do'] == 'h') {
                nxs_do_this_hourly();
                die;
            }
            if ($_GET['page'] == 'NextScripts_SNAP.php' && isset($_GET['do']) && $_GET['do'] == 'q') {
                nxs_do_post_from_query();
                die;
            }
            if (function_exists('nxs_doSMAS5')) {
                $rf = new ReflectionFunction('nxs_doSMAS5');
                $cstIt++;
                $rff = $rf->getFileName();
            }
            $nxsOne = NextScripts_SNAP_Version;
            if (defined('NXSAPIVER')) {
                $nxsOne .= " (<span id='nxsAPIUpd'>API</span> Version: " . NXSAPIVER . ")";
            }
            ?>
           <div style="float:right; padding-top: 10px; padding-right: 10px;">
              <div style="float:right; text-align: center;"><a target="_blank" href="http://www.nextscripts.com"><img src="<?php 
            echo $nxs_plurl;
            ?>
img/Next_Scripts_Logo2.1-HOR-100px.png"></a><br/>
              <a style="font-weight: normal; font-size: 16px; line-height: 24px;" target="_blank" href="http://www.nextscripts.com/support">[<?php 
            _e('Contact support', 'social-networks-auto-poster-facebook-twitter-g');
            ?>
]</a> 
              <?php 
            if (!$options['isMA']) {
                ?>
<br/> <span style="color:#800000;"><?php 
                _e('Ready to to Upgrade to Multiple Accounts Edition<br/> and get Google+ and Pinterest Auto-Posting?', 'social-networks-auto-poster-facebook-twitter-g');
                ?>
</span>
              <?php 
                if (function_exists('nxsDoLic_ajax')) {
                    ?>
 <br/><a style="font-weight: normal; font-size: 12px; line-height: 24px;" target="_blank" id="showLic" href="#">[<?php 
                    _e('Enter your Activation Key', 'social-networks-auto-poster-facebook-twitter-g');
                    ?>
]</a>&nbsp;&nbsp;&nbsp;&nbsp; <?php 
                }
                ?>
              <a target="_blank" href="http://www.nextscripts.com/social-networks-auto-poster-for-wp-multiple-accounts#getit">[<?php 
                _e('Get It here', 'social-networks-auto-poster-facebook-twitter-g');
                ?>
]</a>  <?php 
            }
            ?>
              </div>
              <div id="showLicForm"><span class="nxspButton bClose"><span>X</span></span><div style="position: absolute; right: 10px; top:10px; font-size: 34px; font-weight: lighter;"><?php 
            _e('Activation', 'social-networks-auto-poster-facebook-twitter-g');
            ?>
</div>
              <br/><br/>
              <h3><?php 
            _e('Multiple Accounts Edition and Google+ and Pinterest Auto-Posting', 'social-networks-auto-poster-facebook-twitter-g');
            ?>
</h3><br/><?php 
            _e('You can find your key on this page', 'social-networks-auto-poster-facebook-twitter-g');
            ?>
: <a href="http://www.nextscripts.com/mypage">http://www.nextscripts.com/mypage</a>
                <br/><br/> <?php 
            _e('Enter your Key', 'social-networks-auto-poster-facebook-twitter-g');
            ?>
:  <input name="eLic" id="eLic"  style="width: 50%;"/>
                <input type="button" class="button-primary" name="eLicDo" onclick="doLic();" value="Enter" />
                <br/><br/><?php 
            _e('Your plugin will be automatically upgraded', 'social-networks-auto-poster-facebook-twitter-g');
            ?>
. <?php 
            wp_nonce_field('doLic', 'doLic_wpnonce');
            ?>
              </div>              
           </div> 

                    
           <div class=wrap><h2><?php 
            _e('Next Scripts: Social Networks Auto Poster Options', 'social-networks-auto-poster-facebook-twitter-g');
            ?>
</h2> <?php 
            _e('Plugin Version', 'social-networks-auto-poster-facebook-twitter-g');
            ?>
: <span style="color:#008000;font-weight: bold;"><?php 
            echo $nxsOne;
            ?>
</span> <?php 
            if ($options['isMA']) {
                ?>
 [Pro - Multiple Accounts Edition]&nbsp;&nbsp;<?php 
            } else {
                ?>
           <span style="color:#800000; font-weight: bold;">[Single Accounts Edition]</span>
           <?php 
                if (!$nxs_isWPMU) {
                    ?>
            - <a target="_blank" href="http://www.nextscripts.com/social-networks-auto-poster-for-wp-multiple-accounts"><?php 
                    _e('Get', 'social-networks-auto-poster-facebook-twitter-g');
                    ?>
 PRO - Multiple Accounts Edition</a><br/><br/>
            
           <?php 
                    _e('Here you can setup "Social Networks Auto Poster".', 'social-networks-auto-poster-facebook-twitter-g');
                    ?>
<br/> <?php 
                    _e('You can start by clicking "Add new account" button and choosing the Social Network you would like to add.', 'social-networks-auto-poster-facebook-twitter-g');
                }
            }
            ?>
<br/> 
           <?php 
            $disabled_functions = @ini_get('disable_functions');
            if (!function_exists('curl_init')) {
                echo "<br/><b style='font-size:16px; color:red;'>Error: No CURL Found</b> - <i style='font-size:12px; color:red;'>Social Networks AutoPoster needs the CURL PHP extension. Please install it or contact your hosting company to install it.</i><br/><br/>";
            }
            if (stripos($disabled_functions, 'curl_exec') !== false) {
                echo "<br/><b style='font-size:16px; color:red;'>curl_exec function is disabled in php.ini</b> - <i style='font-size:12px; color:red;'>Social Networks AutoPoster needs the CURL PHP extension. Please enable it or contact your hosting company to enable it.</i><br/><br/>";
            }
            if (!empty($rff) && stripos($rff, "'d code") === false) {
                $options[chr(75) . $cstIt] = $cstIt;
                update_option($this->dbOptionsName, $options);
                $this->nxs_options = $options;
            }
            if (!isset($options['skipSSLSec'])) {
                $err = nxsCheckSSLCurl('https://www.google.com');
                if ($err !== false && $err['errNo'] == '60') {
                    $nxs_skipSSLCheck = true;
                    $options['skipSSLSec'] = true;
                } else {
                    $nxs_skipSSLCheck = false;
                    $options['skipSSLSec'] = false;
                }
                update_option($this->dbOptionsName, $options);
                $this->nxs_options = $options;
            }
            /*
            if ((defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE==true) || (defined('MULTISITE') &&  MULTISITE==true) ) { 
                echo "<br/><br/><br/><b style=\"font-size:16px; color:red;\">Sorry, we do not support Multiuser Wordpress at this time</b>"; return; 
            }
            */
            ?>
           
<?php 
            if (function_exists('yoast_analytics')) {
                $plgnsLink = nxs_get_admin_url() . '/plugins.php';
                ?>
  <div class="error" id="message"><p><strong><?php 
                _e('You have Google Analytics Plugin installed and activated.', 'social-networks-auto-poster-facebook-twitter-g');
                ?>
</strong> <?php 
                _e('This plugin hijacks the authorization workflow.', 'social-networks-auto-poster-facebook-twitter-g');
                ?>
 
  <?php 
                printf(__('Please temporary <a href="%s">deactivate</a> Google Analytics plugin, do all authorizations and then activate it back.', 'social-networks-auto-poster-facebook-twitter-g'), $plgnsLink);
                ?>
</div>
<?php 
            }
        }
	function doConnectToGooglePlus2($email, $pass) {
		global $nxs_gCookiesArr, $gPlusRecoveryEmail, $gPlusRecoveryPhone;
		$nxs_gCookiesArr = array ();
		$advSettings = 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 );
			}
		}
		$err = nxsCheckSSLCurl ( 'https://accounts.google.com/ServiceLogin' );
		if ($err !== false && $err ['errNo'] == '60')
			$advSettings ['noSSLSec'] = true;
		$contents = getCurlPageX ( 'https://accounts.google.com/ServiceLogin?service=oz&continue=https://plus.google.com/?gpsrc%3Dogpy0%26tab%3DwX%26gpcaz%3Dc7578f19&hl=en-US', '', 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;
				$mids .= "&" . $name . "=" . $val;
			}
		}
		$flds ['Email'] = $email;
		$flds ['Passwd'] = $pass;
		$flds ['signIn'] = 'Sign%20in';
		$fldsTxt = build_http_query ( $flds );
		$advSettings ['cdomain'] = 'google.com';
		// ## ACTUAL LOGIN
		$contents = getCurlPageX ( 'https://accounts.google.com/ServiceLoginAuth', '', false, $fldsTxt, false, $advSettings ); // prr($contents);
		
		if (stripos ( $contents ['url'], 'https://accounts.google.com/ServiceLoginAuth' ) !== false && stripos ( $contents ['content'], '<span color="red">' ) !== false)
			return CutFromTo ( $contents ['content'], '<span color="red">', '</span>' );
		
		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 || stripos ( $contents ['content'], 'CaptchaChallengeOptionContent' ) !== 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 ['url'], 'google.com/SmsAuth' ) !== false)
			return '<b style="color:#800000;">2-step verification in on.</b> <br/><br/> 2-step verification is not compatible with auto-posting. <br/><br/>Please see more here:<br/> <a href="http://www.nextscripts.com/blog/google-2-step-verification-and-auto-posting" target="_blank">Google+, 2-step verification and auto-posting</a><br/>';
		
		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'], "Confirm my recovery email address:" ) !== false)
						$recEm = trim ( CutFromTo ( $contents ['content'], "Confirm my recovery email address:", "</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>" . '        
        Enter full recovery email address: <input type="tel" name="recoveryEmail" onchange="document.cookie = \'gPlusRecoveryEmail=\'+this.value;document.cookie = \'gPlusRecoveryEmailHint=' . $recEm . '\';" 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/>';
				} 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 Google+" 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=https%3A%2F%2Fplus.google.com%2F%3Fgpsrc%3Dogpy0%26tab%3DwX%26gpcaz%3D38f4feed&_utf8=%E2%98%83&bgresponse=' . $contents . '&phoneNumber=&challengetype=RecoveryEmailChallenge&emailAnswer=' . urlencode ( $gPlusRecoveryEmail ) . '&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=oz', '', 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=oz', '', 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 Google+" button again to confirm and verify your account.<br/>';
					}
					// prr($contents);
					
					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;
	}