Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor changes to 500px

  • Loading branch information...
commit 1f666b3bb6a3414504f9115733f76090777b3629 1 parent fc4b2f4
hybridauth authored
Showing with 20 additions and 36 deletions.
  1. +20 −36 additional-providers/hybridauth-500px/Providers/px500.php
View
56 additional-providers/hybridauth-500px/Providers/px500.php
@@ -1,8 +1,8 @@
-<?php session_start();
+<?php
/*!
* HybridAuth
-* http://hybridauth.sourceforge.net | https://github.com/hybridauth/hybridauth
-* (c) 2009-2011 HybridAuth authors | hybridauth.sourceforge.net/licenses.html
+* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/
/**
@@ -36,31 +36,31 @@ function getUserProfile()
try{
$response = $this->api->get( 'users' );
- //$p = print_r($profile);
- $this->user->profile->identifier = (property_exists($response->user,'id'))?$response->user->id:"";
- $this->user->profile->displayName = (property_exists($response->user,'username'))?$response->user->username:"";
- $this->user->profile->description = (property_exists($response->user,'about'))?$response->user->about:"";
- $this->user->profile->firstName = (property_exists($response->user,'firstname'))?$response->user->firstname:"";
- $this->user->profile->lastName = (property_exists($response->user,'lastname'))?$response->user->lastname:"";
- $this->user->profile->photoURL = (property_exists($response->user,'userpic_url'))?$response->user->userpic_url:"";
- $this->user->profile->profileURL = (property_exists($response->user,'domain'))?("http://".$response->user->domain):"";
- $this->user->profile->webSiteURL = (property_exists($response->user->contacts,'website'))?$response->user->contacts->website:"";
- $this->user->profile->city = (property_exists($response->user,'city'))?$response->user->city:"";
- $this->user->profile->region = (property_exists($response->user,'state'))?$response->user->state:"";
- $this->user->profile->country = (property_exists($response->user,'country'))?$response->user->country:"";
+
+ $this->user->profile->identifier = (property_exists($response->user,'id'))?$response->user->id:"";
+ $this->user->profile->displayName = (property_exists($response->user,'username'))?$response->user->username:"";
+ $this->user->profile->description = (property_exists($response->user,'about'))?$response->user->about:"";
+ $this->user->profile->firstName = (property_exists($response->user,'firstname'))?$response->user->firstname:"";
+ $this->user->profile->lastName = (property_exists($response->user,'lastname'))?$response->user->lastname:"";
+ $this->user->profile->photoURL = (property_exists($response->user,'userpic_url'))?$response->user->userpic_url:"";
+ $this->user->profile->profileURL = (property_exists($response->user,'domain'))?("http://".$response->user->domain):"";
+ $this->user->profile->webSiteURL = (property_exists($response->user->contacts,'website'))?$response->user->contacts->website:"";
+ $this->user->profile->city = (property_exists($response->user,'city'))?$response->user->city:"";
+ $this->user->profile->region = (property_exists($response->user,'state'))?$response->user->state:"";
+ $this->user->profile->country = (property_exists($response->user,'country'))?$response->user->country:"";
+
if(property_exists($response->user,'sex')){
if($response->user->sex>0){
$this->user->profile->gender = ($response->user->sex==1)?"male":"female";
}
}
- return $this->user->profile;
-
- throw new Exception($p);
+
+ return $this->user->profile;
}
catch( Exception $e ){
throw new Exception( "User profile request failed! {$this->providerId} returned an error while requesting the user profile.", 6 );
- }
-
+ }
+
return $this->user->profile;
}
@@ -97,20 +97,4 @@ function setUserStatus( $status )
// because 500px users can also get an additional Upload Key to upload pictures
// refer to http://developers.500px.com/docs/upload-post for now
}
-
- /**
- * load the current logged in user contacts list from the IDp api client
- */
- function getUserContacts()
- {
- throw new Exception( "Provider does not support this feature.", 8 );
- }
-
- /**
- * return the user activity stream
- */
- function getUserActivity( $stream )
- {
- throw new Exception( "Provider does not support this feature.", 8 );
- }
}
Please sign in to comment.
Something went wrong with that request. Please try again.