示例#1
0
 /**
  * Logs in to a magical dice account given the username and password
  *
  * @param string $username  Username of account
  * @param string $password  Password assigned to account
  *
  * @return bool 
  */
 public function login($username, $password)
 {
     // enable header mode
     Fetch::showPageHeaders();
     // request params
     $params = 'user_name=' . $username . '&user_password='******'user_name') !== false) {
         // PHPSESSID
         $this->_cookie .= Fetch::getPageCookie($loginResponse, 'PHPSESSID');
         // Username
         $this->_cookie .= Fetch::getPageCookie($loginResponse, 'user_name');
         // Password
         $this->_cookie .= Fetch::getPageCookie($loginResponse, 'user_password');
         // Analytics
         $this->_cookie .= Fetch::getPageCookie($loginResponse, '_ga');
         // Cloudflare
         $this->_cookie .= Fetch::getPageCookie($loginResponse, '__cfduid');
         // logged in
         return true;
     }
     return false;
 }