Stud.IP  4.2 Revision
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 ()
 
- Public Member Functions inherited from SimpleORMap
 __construct ($id=null)
 
 __clone ()
 
 getRelationOptions ($relation)
 
 getTableMetadata ()
 
 hasAutoIncrementColumn ()
 
 setId ($id)
 
 getId ()
 
 getNewId ()
 
 toArray ($only_these_fields=null)
 
 toRawArray ($only_these_fields=null)
 
 toArrayRecursive ($only_these_fields=null)
 
 getValue ($field)
 
 getRelationValue ($relation, $field)
 
 getDefaultValue ($field)
 
 setValue ($field, $value)
 
 __get ($field)
 
 __set ($field, $value)
 
 __isset ($field)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 getIterator ()
 
 count ()
 
 isField ($field)
 
 isAdditionalField ($field)
 
 isAliasField ($field)
 
 isI18nField ($field)
 
 setData ($data, $reset=false)
 
 isNew ()
 
 isDeleted ()
 
 setNew ($is_new)
 
 getWhereQuery ()
 
 restore ()
 
 store ()
 
 triggerChdate ()
 
 delete ()
 
 isDirty ()
 
 isFieldDirty ($field)
 
 revertValue ($field)
 
 getPristineValue ($field)
 
 initRelation ($relation)
 
 resetRelation ($relation)
 
 cleanup ()
 

Static Public Member Functions

static detect ($request_type=null, $request_body=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, $request_body=null)
 
- Static Public Member Functions inherited from SimpleORMap
static tableScheme ($db_table)
 
static expireTableScheme ()
 
static find ($id)
 
static exists ($id)
 
static countBySql ($sql=1, $params=array())
 
static create ($data)
 
static build ($data, $is_new=true)
 
static buildExisting ($data)
 
static import ($data)
 
static findBySQL ($sql, $params=array())
 
static findOneBySQL ($where, $params=array())
 
static findThru ($foreign_key_value, $options)
 
static findEachBySQL ($callable, $sql, $params=array())
 
static findMany ($pks=array(), $order='', $order_params=array())
 
static findEachMany ($callable, $pks=array(), $order='', $order_params=array())
 
static findAndMapBySQL ($callable, $where, $params=array())
 
static findAndMapMany ($callable, $pks=array(), $order='', $order_params=array())
 
static deleteBySQL ($where, $params=array())
 
static toObject ($id_or_object)
 
static __callStatic ($name, $arguments)
 

Protected Member Functions

 before_store ()
 
- Protected Member Functions inherited from SimpleORMap
 _getId ($field)
 
 _setId ($field, $value)
 
 _getAdditionalValueFromRelation ($field)
 
 _setAdditionalValueFromRelation ($field, $value)
 
 _getAdditionalValue ($field)
 
 _setAdditionalValue ($field, $value)
 
 parseRelationOptions ($type, $name, $options)
 
 storeRelations ($only_these=null)
 
 deleteRelations ()
 
 initializeContent ()
 
 applyCallbacks ($type)
 
 registerCallback ($types, $cb)
 
 unregisterCallback ($types, $cb)
 
 cbAutoIncrementColumn ($type)
 
 cbAutoKeyCreation ()
 
 cbNotificationMapper ($cb_type)
 
 cbAfterInitialize ($cb_type)
 
 setSerializedValue ($field, $value)
 
 setI18nValue ($field, $value)
 
 cbI18N ($type)
 

Static Protected Member Functions

static configure ($config=[])
 
- Static Protected Member Functions inherited from Base
static configure ($config=[])
 
- Static Protected Member Functions inherited from SimpleORMap
static configure ($config=array())
 
static config ($key)
 

Additional Inherited Members

- Static Public Attributes inherited from SimpleORMap
static $schemes = null
 
- Protected Attributes inherited from Base
 $user = null
 
- Protected Attributes inherited from SimpleORMap
 $content = array()
 
 $content_db = array()
 
 $is_new = true
 
 $is_deleted = false
 
 $db_table = ''
 
 $db_fields = null
 
 $pk = null
 
 $default_values = array()
 
 $serialized_fields = array()
 
 $alias_fields = array()
 
 $i18n_fields = array()
 
 $additional_fields = array()
 
 $relations = array()
 
 $has_many = array()
 
 $has_one = array()
 
 $belongs_to = array()
 
 $has_and_belongs_to_many = array()
 
 $registered_callbacks = array()
 
 $known_slots = array()
 
 $notification_map = array()
 
 $additional_data = array()
 
 $getter_setter_map = array()
 
- Static Protected Attributes inherited from Base
static $known_types = array()
 
- Static Protected Attributes inherited from SimpleORMap
static $config = array()
 
static $reserved_slots = array('value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id')
 

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()

__construct (   $id = null)

SimpleORMap constructor, registers neccessary callbacks.

Here is the call graph for this function:

Member Function Documentation

◆ before_store()

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:

◆ configure()

static configure (   $config = [])
staticprotected

Configures the model.

Parameters
array$configConfiguration array

◆ detect()

static detect (   $request_type = null,
  $request_body = null 
)
static

Detects whether the request is authenticated via OAuth.

Parameters
mixed$request_typeType of request (optional; defaults to any)
mixed$request_bodyRequest body to use (optional, should be removed when Stud.IP requires PHP >= 5.6)
Returns
mixed Instance of self if authentication was detected, false otherwise
Here is the call graph for this function:

◆ getOAuthId()

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:
Here is the caller graph for this function:

◆ getServer()

static getServer ( )
static

Returns a singleton instance of the oauth server.

Returns
OAuthServer The server object

◆ grantAccess()

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()

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: