Permalink
Browse files

update oneid.php to fix missing self::

  • Loading branch information...
1 parent e2cc610 commit cef838ae886c1177dbfe3774177e48a5247e6a17 @brianpkennedy brianpkennedy committed Apr 1, 2013
Showing with 16 additions and 20 deletions.
  1. +15 −19 examples/oneid_demo/oneid.php
  2. +1 −1 oneid.php
@@ -1,16 +1,14 @@
<?php
-
+/**
+ * OneID's API functions
+ *
+ * @copyright Copyright 2012 by OneID
+ */
class OneID {
/**
- * OneID's API functions
- *
- * @copyright Copyright 2012 by OneID
- */
-
- /**
- * @var string DEFAULT_ATTRIBUTES_REQUESTED The default attributes which the OneID Sign In button would request : user's first name, last name, and email address.
+ *
+ * The default attributes which the OneID Sign In button would request : user's first name, last name, and email address.
*/
-
const DEFAULT_ATTRIBUTES_REQUESTED = "personal_info[email] personal_info[first_name] personal_info[last_name]";
/**
@@ -31,22 +29,17 @@ class OneID {
/**
*
- * @var
- * @ignore
+ * @var type
*/
private $oneid_api_id;
/**
*
* @var type
- * @ignore
*/
private $oneid_api_key;
-
/**
*
* @var string $oneid_server URL for OneID helper keychain
- * @ignore
- *
*/
private $oneid_server;
@@ -151,20 +144,23 @@ function response() {
* Loads the OneID login button on a web page using javascript
*
* @param string $callback_url the web page that gets called after a successful
- * login. Immediately passed to LoginChallenge
+ * login.
* @param string $attr string of correctly formatted user attributes
- * Immediately passed to LoginChallenge
+ *
+ * @param string $auth_level string of what level of authentication you require for this sign on
+ *
* @return string javascript-ready code which loads the OneID login button
*/
- function draw_signin_button($callback_url, $attr = DEFAULT_ATTRIBUTES_REQUESTED) {
+ function draw_signin_button($callback_url, $attr = self::DEFAULT_ATTRIBUTES_REQUESTED, $auth_level="ON") {
/**
* You could also put this javascript in your front end templates yourself.
*/
$params = json_encode(
array(
"challenge" => array(
"attr" => $attr, // OneID attributes to create an account here
- "callback" => $callback_url
+ "callback" => $callback_url,
+ "auth_level" => $auth_level
)
)
);
View
@@ -151,7 +151,7 @@ function response() {
*
* @return string javascript-ready code which loads the OneID login button
*/
- function draw_signin_button($callback_url, $attr = DEFAULT_ATTRIBUTES_REQUESTED, $auth_level="ON") {
+ function draw_signin_button($callback_url, $attr = self::DEFAULT_ATTRIBUTES_REQUESTED, $auth_level="ON") {
/**
* You could also put this javascript in your front end templates yourself.
*/

0 comments on commit cef838a

Please sign in to comment.