Fix 3rdparty paths, initialise OAuth in correct order

This commit is contained in:
Tom Needham 2012-08-01 10:21:33 +01:00
parent 9ec035e3d3
commit e7f7693b2f
1 changed files with 6 additions and 4 deletions

View File

@ -37,12 +37,13 @@ class OC_OAuth {
*/ */
private static function init(){ private static function init(){
// Include the libraries // Include the libraries
require_once(OC::$THIRDPARTYROOT.'3rdparty/oauth-php/library/OAuthServer.php'); require_once(OC::$THIRDPARTYROOT.'/3rdparty/oauth-php/library/OAuthServer.php');
require_once(OC::$THIRDPARTYROOT.'3rdparty/oauth-php/library/OAuthStore.php'); require_once(OC::$THIRDPARTYROOT.'/3rdparty/oauth-php/library/OAuthStore.php');
require_once(OC::$THIRDPARTYROOT.'/3rdparty/oauth-php/library/OAuthRequestVerifier.php');
// Initialise the OAuth store
self::$store = OAuthStore::instance('Session');
// Create the server object // Create the server object
self::$server = new OAuthServer(); self::$server = new OAuthServer();
// Initialise the OAuth store
self::$store = OAuthStore::instance('owncloud');
} }
/** /**
@ -109,6 +110,7 @@ class OC_OAuth {
* @return string|int * @return string|int
*/ */
public static function isAuthorised(){ public static function isAuthorised(){
self::init();
if(OAuthRequestVerifier::requestIsSigned()){ if(OAuthRequestVerifier::requestIsSigned()){
try{ try{
$req = new OAuthRequestVerifier(); $req = new OAuthRequestVerifier();