private function reflashToken()
{
if (empty($this->m_cfg['username']) || empty($this->m_cfg['password'])) {
return;
}
$this->m_reflash_cookie = tmpDir('reflashsina.cookie');
if (!file_exists($this->m_reflash_cookie)) {
touch($this->m_reflash_cookie);
}
$loginResult = $this->curlLoginSina($this->m_cfg['username'], $this->m_cfg['password']);
if (!$loginResult) {
return $loginResult;
}
$callbackUrl = callbackUrl('sina');
$o = new SaeTOAuthV2($this->m_cfg['key'], $this->m_cfg['secret']);
$authorizeURL = $o->getAuthorizeURL($callbackUrl);
$ch = curl_init($authorizeURL);
$option = array();
$option[CURLOPT_FOLLOWLOCATION] = 1;
$option[CURLOPT_RETURNTRANSFER] = 1;
$option[CURLOPT_COOKIEJAR] = $this->m_reflash_cookie;
$option[CURLOPT_COOKIEFILE] = $this->m_reflash_cookie;
$option[CURLOPT_HTTPHEADER] = array('Accept-Language: zh-cn', 'Connection: Keep-Alive', 'Cache-Control: no-cache');
$option[CURLOPT_USERAGENT] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)";
curl_setopt_array($ch, $option);
curl_exec($ch);
curl_close($ch);
unlink($this->m_reflash_cookie);
}