Skip to content

Commit 71d02ce

Browse files
author
Andjelko Horvat
committed
authtwitter: use SimpleSAML_Configuration::loadFromArray (related to #587).
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3293 44740490-163a-0410-bde0-09ae8108e29a
1 parent a7a9f4b commit 71d02ce

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

modules/authtwitter/lib/Auth/Source/Twitter.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,10 @@ public function __construct($info, $config) {
3838
/* Call the parent constructor first, as required by the interface. */
3939
parent::__construct($info, $config);
4040

41-
if (!array_key_exists('key', $config))
42-
throw new Exception('Twitter authentication source is not properly configured: missing [key]');
43-
44-
$this->key = $config['key'];
45-
46-
if (!array_key_exists('secret', $config))
47-
throw new Exception('Twitter authentication source is not properly configured: missing [secret]');
48-
49-
$this->secret = $config['secret'];
50-
51-
// require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/extlibinc/facebook.php');
41+
$configObject = SimpleSAML_Configuration::loadFromArray($config, 'authsources[' . var_export($this->authId, TRUE) . ']');
5242

43+
$this->key = $configObject->getString('key');
44+
$this->secret = $configObject->getString('secret');
5345
}
5446

5547

@@ -127,5 +119,3 @@ public function finalStep(&$state) {
127119
}
128120

129121
}
130-
131-
?>

0 commit comments

Comments
 (0)