phpDocumentor Developer
[ class tree: Developer ] [ index: Developer ] [ all elements ]

Class: User

Source Location: /core/User.php

Class User

Class Overview

This class represents a known CAT User (i.e. an institution and/or federation adiministrator).

Located in /core/User.php [line 33]



		
				Author(s):
		
		
		
Information Tags:

Properties

Methods

[ Top ]
Property Summary
string   $identifier   This variable holds the user's persistent identifier. This is not a real name; it is just an opaque handle as was returned by the authentication source. It is comparable to an eduPersonTargetedId value (and may even be one).

[ Top ]
Method Summary
User   __construct()   Class constructor. The required argument is a user's persistent identifier as was returned by the authentication source.
void   addAttribute()   This function adds a new attribute to the user. The attribute is stored persistently in the database immediately; however the priv_attributes array is not updated. To see the new attributes via getAttributes(), re-instantiate the object.
array   beginFlushAttributes()   This function deletes most attributes in this profile immediately, and marks the rest (file-based attributes) for later deletion.
void   commitFlushAttributes()   This function deletes attributes from the database by their database row ID. Its typical (only) use is to take the return of beginFlushAttribute() and delete the attributes in there. It only deletes rows which actually belong to the instantiated user.
array   getAttributes()   This function retrieves the known attributes of the user from the private member priv_attributes.
boolean   isFederationAdmin()   This function checks whether a user is a federation administrator. When called without argument, it only checks if the user is a federation administrator of *any* federation. When given a parameter (ISO shortname of federation), it checks if the user administers this particular federation.
boolean   isSuperadmin()   This function tests if the current user has been configured as the system superadmin, i.e. if the user is allowed to execute the 112365365321.php script
void   sendMailToUser()  

[ Top ]
Properties
string   $identifier [line 57]

This variable holds the user's persistent identifier. This is not a real name; it is just an opaque handle as was returned by the authentication source. It is comparable to an eduPersonTargetedId value (and may even be one).

API Tags:
Access:  public


[ Top ]
Methods
Constructor __construct  [line 64]

  User __construct( string $user_id  )

Class constructor. The required argument is a user's persistent identifier as was returned by the authentication source.

Parameters:
string   $user_id:  User Identifier as per authentication source

API Tags:
Access:  public


[ Top ]
addAttribute  [line 150]

  void addAttribute( type $attr_name, type $attr_value  )

This function adds a new attribute to the user. The attribute is stored persistently in the database immediately; however the priv_attributes array is not updated. To see the new attributes via getAttributes(), re-instantiate the object.

Parameters:
type   $attr_name:  name of the attribute to add
type   $attr_value:  value of the attribute to add

API Tags:
Access:  public


[ Top ]
beginFlushAttributes  [line 170]

  array beginFlushAttributes( )

This function deletes most attributes in this profile immediately, and marks the rest (file-based attributes) for later deletion.

The typical usage is to call this function, then determine which of the file-based attributes were not selected for deletion by the user, and then delete those that were by calling commitFlushAttributes. Read-only attributes, like "user:fedadmin" are left untouched.


API Tags:
Return:  list of row id's of file-based attributes which weren't deleted (to be consumed by commitFlushAttributes)
Access:  public


[ Top ]
commitFlushAttributes  [line 186]

  void commitFlushAttributes( array $tobedeleted  )

This function deletes attributes from the database by their database row ID. Its typical (only) use is to take the return of beginFlushAttribute() and delete the attributes in there. It only deletes rows which actually belong to the instantiated user.

Parameters:
array   $tobedeleted:  array of database rows which are to be deleted

API Tags:
Access:  public


[ Top ]
getAttributes  [line 130]

  array getAttributes( [string $option_name = 0]  )

This function retrieves the known attributes of the user from the private member priv_attributes.

The attributes are not taken "fresh" from the database; this is a performance optimisation. The function's single parameter $option_name is optional - if specified, it only returns the attributes of the given type. Otherwise, all known attributes are returned.

Parameters:
string   $option_name:  name of the option whose values are to be returned

API Tags:
Return:  of attributes
Access:  public


[ Top ]
isFederationAdmin  [line 200]

  boolean isFederationAdmin( [string $federation = 0]  )

This function checks whether a user is a federation administrator. When called without argument, it only checks if the user is a federation administrator of *any* federation. When given a parameter (ISO shortname of federation), it checks if the user administers this particular federation.

Parameters:
string   $federation:  optional: federation to be checked

API Tags:
Return:  TRUE if the user is federation admin, FALSE if not
Access:  public


[ Top ]
isSuperadmin  [line 222]

  boolean isSuperadmin( )

This function tests if the current user has been configured as the system superadmin, i.e. if the user is allowed to execute the 112365365321.php script


API Tags:
Return:  TRUE if the user is a superadmin, FALSE if not
Access:  public


[ Top ]
sendMailToUser  [line 226]

  void sendMailToUser( $subject, $content  )

Parameters:
   $subject: 
   $content: 

API Tags:
Access:  public


[ Top ]

Documentation generated on Thu, 16 Apr 2015 10:26:08 +0000 by phpDocumentor 1.4.4