Stud.IP  3.1 Revision 48552
 All Data Structures Namespaces Files Functions Variables Groups Pages
OAuth Class Reference
Inheritance diagram for OAuth:
Inheritance graph
Collaboration diagram for OAuth:
Collaboration graph

Public Member Functions

 __construct ($id=null)
 grantAccess ($user_id=null)
 revokeAccess ($user_id=null)
- Public Member Functions inherited from Base
 __construct ($id=null, $user=null)
 getPermissions ()
 setUser ($user)
 hasUser ()
 getUser ()

Static Public Member Functions

static detect ($request_type=null)
static getServer ()
static getOAuthId ($user_id)
- Static Public Member Functions inherited from Base
static detect ()
static addType ($type, $class)
static removeType ($type)
static find ($id)
static findAll ()
static create ($type)
static detectConsumer ($type=null, $request_type=null)

Protected Member Functions

 before_store ()

Additional Inherited Members

- Protected Attributes inherited from Base
 $user = null
- Static Protected Attributes inherited from Base
static $known_types = array()

Detailed Description

OAuth consumer for the rest api

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL 2 or later
Since
Stud.IP 3.0

Constructor & Destructor Documentation

__construct (   $id = null)

SimpleORMap constructor, registers neccessary callbacks.

Member Function Documentation

before_store ( )
protected

"Before store" trigger. Creates a clone of the consumer in the tables for the vendor oauth library.

Here is the call graph for this function:

static detect (   $request_type = null)
static

Detects whether the request is authenticated via OAuth.

Parameters
mixed$request_typeType of request (optional; defaults to any)
Returns
mixed Instance of self if authentication was detected, false otherwise

Here is the call graph for this function:

static getOAuthId (   $user_id)
static

Maps a user to an oauth id. This is neccessary due to the fact that the oauth lib works with different ids than Stud.IP.

Parameters
String$user_idId of the user to get an oauth id for
Returns
String The mapped oauth id

Here is the call graph for this function:

static getServer ( )
static

Returns a singleton instance of the oauth server.

Returns
OAuthServer The server object

Here is the caller graph for this function:

grantAccess (   $user_id = null)

Grant oauth access for a user.

Parameters
mixed$user_idSpecific user id or null to default to the injected user
Exceptions
ExceptionIf no valid user is present

Here is the call graph for this function:

revokeAccess (   $user_id = null)

Revoke oauth access from a user.

Parameters
mixed$user_idSpecific user id or null to default to the injected user
Exceptions
ExceptionIf no valid user is present

Here is the call graph for this function:


The documentation for this class was generated from the following file: