public function init($args) { parent::init($args); $args = is_array($args) ? $args : array(); if (!isset($args['CONSUMER_KEY'], $args['CONSUMER_SECRET']) || strlen($args['CONSUMER_KEY'])==0 || strlen($args['CONSUMER_SECRET'])==0) { throw new Exception("Twitter Consumer key and secret not set"); } $this->consumer_key = $args['CONSUMER_KEY']; $this->consumer_secret = $args['CONSUMER_SECRET']; }
public function init($args) { parent::init($args); $args = is_array($args) ? $args : array(); if (!isset($args['DOMAIN']) || strlen($args['DOMAIN'])==0) { throw new Exception("Google Apps Domain not set"); } $this->domain = $args['DOMAIN']; if (isset($args['OAUTH']) && $args['OAUTH']) { if (!isset($args['CONSUMER_KEY'], $args['CONSUMER_SECRET'])) { throw new Exception("Consumer Key and secret must be set when OAuth is on"); } $this->oauth = true; $this->consumer_key = $args['CONSUMER_KEY']; $this->consumer_secret = $args['CONSUMER_SECRET']; } }
public function init($args) { parent::init($args); $args = is_array($args) ? $args : array(); if (!isset($args['CONSUMER_KEY'], $args['CONSUMER_SECRET'])) { $args['CONSUMER_KEY']='anonymous'; $args['CONSUMER_SECRET']='anonymous'; } $this->consumer_key = $args['CONSUMER_KEY']; $this->consumer_secret = $args['CONSUMER_SECRET']; }
public function init($args) { parent::init($args); $args = is_array($args) ? $args : array(); if (isset($args['GOOGLE_REQUIRE_LOGIN'])) { $this->requireLogin = $args['GOOGLE_REQUIRE_LOGIN']; } if (isset($args['OPENID_REALM'])) { if (!preg_match("@^https?://@", $args['OPENID_REALM'])) { throw new Exception("Invalid OpenID realm {$args['OPENID_REALM']}. Realm must be a full url"); } $this->realm = $args['OPENID_REALM']; } if (isset($args['OAUTH_CONSUMER_KEY'], $args['OAUTH_CONSUMER_SECRET'])) { $this->consumer_key = $args['OAUTH_CONSUMER_KEY']; $this->consumer_secret = $args['OAUTH_CONSUMER_SECRET']; if (!isset($args['GOOGLE_SCOPE'])) { throw new Exception("GOOGLE_SCOPE parameter must be specified"); } elseif (!is_array($args['GOOGLE_SCOPE'])) { throw new Exception("GOOGLE_SCOPE parameter is not an array"); } $this->scope = $args['GOOGLE_SCOPE']; $this->oauth = true; } }