8 * This source file is subject to the new BSD license that is bundled
9 * with this package in the file LICENSE.txt.
10 * It is also available through the world-wide-web at this URL:
11 * http://framework.zend.com/license/new-bsd
12 * If you did not receive a copy of the license and are unable to
13 * obtain it through the world-wide-web, please send an email
14 * to license@zend.com so we can send you a copy immediately.
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
25 * @see Zend_Gdata_App_CaptchaRequiredException
27 require_once 'Zend/Gdata/App/AuthException.php';
32 * Class to represent an exception that occurs during the use of ClientLogin.
33 * This particular exception happens when a CAPTCHA challenge is issued. This
34 * challenge is a visual puzzle presented to the user to prove that they are
35 * not an automated system.
40 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
41 * @license http://framework.zend.com/license/new-bsd New BSD License
43 class Zend_Gdata_App_CaptchaRequiredException extends Zend_Gdata_App_AuthException
46 * The Google Accounts URL prefix.
48 const ACCOUNTS_URL = 'https://www.google.com/accounts/';
51 * The token identifier from the server.
55 private $captchaToken;
58 * The URL of the CAPTCHA image.
65 * Constructs the exception to handle a CAPTCHA required response.
67 * @param string $captchaToken The CAPTCHA token ID provided by the server.
68 * @param string $captchaUrl The URL to the CAPTCHA challenge image.
70 public function __construct($captchaToken, $captchaUrl) {
71 $this->captchaToken = $captchaToken;
72 $this->captchaUrl = Zend_Gdata_App_CaptchaRequiredException::ACCOUNTS_URL . $captchaUrl;
73 parent::__construct('CAPTCHA challenge issued by server');
77 * Retrieves the token identifier as provided by the server.
81 public function getCaptchaToken() {
82 return $this->captchaToken;
86 * Retrieves the URL CAPTCHA image as provided by the server.
90 public function getCaptchaUrl() {
91 return $this->captchaUrl;