Public Member Functions | Static Public Member Functions | Private Attributes
c_comdef_user Class Reference

This class handles BMLT users. One instance is created for each user on the server. More...

List of all members.

Public Member Functions

 UpdateToDB ($is_rollback=false, $new_login=null, $new_pass=null)
 Updates or adds this instance to the database.
 DeleteFromDB_NoRecord ()
 Deletes this instance from the database without creating a change record.
 DeleteFromDB ()
 Deletes this instance from the database, and creates a change record.
 RestoreFromDB ()
 Updates this instance to the current values in the DB (replacing current values of the instance).
 __construct ($in_parent_obj, $in_id_bigint, $in_user_level_tinyint, $in_email_address_string, $in_login_string, $in_password_string, $in_lang_enum, $in_name_string, $in_description_string, $in_last_access=null)
 The initial setup call for the class. If you send in values, the object will set itself up to use them.
 IsEnabled ()
 Returns true if the user is enabled (levels 1-3)
 GetID ()
 Accessor - Returns the user ID as an integer.
 SetID ($in_user_id_bigint)
 Accessor - Sets the user ID as an integer.
 GetUserLevel ()
 Accessor - Returns the user level as an integer.
 SetUserLevel ($in_user_level_tinyint)
 Accessor - Sets the user level. Attempts to set the user level to 1 for users other than User 1 will fail.
 GetEmailAddress ()
 Accessor - Returns the user email address.
 SetEmailAddress ($in_email_address_string)
 Accessor - Sets the user email address.
 GetLogin ()
 Accessor - Returns the user login.
 SetLogin ($in_login_string)
 Accessor - Sets the userlogin.
 IsUser ($in_login_string, $in_password_string, $in_pw_raw=false)
 See if this is the given user by login and password.
 GetPassword ()
 Accessor - Returns the user password, in encrypted form.
 SetPassword ($in_password_string)
 Accessor - Sets the password, as an encrypted string.
 SetNewPassword ($in_password_unencrypted_string)
 Accessor - Sets the password, encrypting it.
 GetLastAccess ()
 Accessor - Gets the last access time.
 SetLastAccess ($in_time=null)
 Simply sets the last access time to now.
 SerializeObject ()
 Returns a storable serialization of the object, as a string.
 UserCanEdit ($in_user_object=null)
 Test to see if a user is allowed to edit an instance (change the data).

Static Public Member Functions

static UnserializeObject ($in_parent, $serialized_string)
 This takes the serialized table, and instantiates a new object from it.

Private Attributes

 $_id_bigint = null
 An integer, containing the unique ID of this user.
 $_user_level_tinyint = null
 An integer, containing the user level.
 $_email_address_string = null
 A string, containing the user's email address.
 $_login_string = null
 A string, containing the user's login ID.
 $_password_string = null
 A string, containing the user's encrypted password.
 $_last_access = null
 A time date, indicating the last time the user was active. This will be useful for administration.

Detailed Description

This class handles BMLT users. One instance is created for each user on the server.


Constructor & Destructor Documentation

c_comdef_user::__construct ( in_parent_obj,
in_id_bigint,
in_user_level_tinyint,
in_email_address_string,
in_login_string,
in_password_string,
in_lang_enum,
in_name_string,
in_description_string,
in_last_access = null 
)

The initial setup call for the class. If you send in values, the object will set itself up to use them.

Parameters:
in_parent_objA reference to the parent object for this object
in_id_bigintInteger. The ID of the user
in_user_level_tinyintThe user level (an integer).

Values:

  • (1) Server Administrator -There can only be one. The user ID is always 1. This administrator can edit all aspects of the server.
  • (2) Service Body Administrator -There can only be one per Service Body A Service Body Administrator can edit all meetings from the Service Body that assigns the user as its administrator. This user can also assign other Service Body Administrators or Editors as users able to edit meetings belonging to the Service Body. A Service Body Administrator can also edit Service Body information. NOTE: A Service Body Administrator only has extra rights when assigned to a specific Service Body. If assigned as an Editor on another Service Body, they do not have rights beyond those of an Editor.
  • (3) Editor -There can be many. An Editor is assigned by a Service Body Administrator to edit meetings for that Service Body. They can only edit meetings; not users or Service Bodies. Making a user an editor (or a Service Body Administrator) doesn't automatically give them any rights. They must first be assigned to a Service Body, either by the Server Administrator (Service Body Administrators), or by a Service Body Administrator (Editors).
  • (4) User Disabled.
  • (5) Observer -There can be many. This user cannot make changes, but can see visibility 0 data items in meetings for the Service bodies to which it has been attached..
    Parameters:
    in_email_address_stringA string, containing the user's email address.
    in_login_stringA string, containing the user's login.
    in_password_stringA string, containing the user's password, in encrypted form.
    in_lang_enumAn enum/string, with the user's language.
    in_name_stringA string, containing the readble name for the user.
    in_description_stringA string, containing a description of the user.
    in_last_accessAn epoch time, indicating the last access of this user (Optional).

Member Function Documentation

c_comdef_user::DeleteFromDB ( )

Deletes this instance from the database, and creates a change record.

Returns:
true if successful, false, otherwise.
Exceptions:
aPDOException if there is a problem.

Implements i_comdef_db_stored.

c_comdef_user::DeleteFromDB_NoRecord ( )

Deletes this instance from the database without creating a change record.

Returns:
true if successful, false, otherwise.
Exceptions:
aPDOException if there is a problem.
c_comdef_user::GetEmailAddress ( )

Accessor - Returns the user email address.

Returns:
a string, containing the user email address.
c_comdef_user::GetID ( )

Accessor - Returns the user ID as an integer.

Returns:
an integer, containing the user ID.
c_comdef_user::GetLastAccess ( )

Accessor - Gets the last access time.

Returns:
an epoch time that contains the last access time.
c_comdef_user::GetLogin ( )

Accessor - Returns the user login.

Returns:
a string, containing the user login.
c_comdef_user::GetPassword ( )

Accessor - Returns the user password, in encrypted form.

Returns:
a string, containing the user password, as an encrypted hash.
c_comdef_user::GetUserLevel ( )

Accessor - Returns the user level as an integer.

Returns:
an integer, containing the user level. Values:
  • (1) Server Administrator -There can only be one. The user ID is always 1. This administrator can edit all aspects of the server.
  • (2) Service Body Administrator -There can only be one per Service Body A Service Body Administrator can edit all meetings from the Service Body that assigns the user as its administrator. This user can also assign other Service Body Administrators or Editors as users able to edit meetings belonging to the Service Body. A Service Body Administrator can also edit Service Body information. NOTE: A Service Body Administrator only has extra rights when assigned to a specific Service Body. If assigned as an Editor on another Service Body, they do not have rights beyond those of an Editor.
  • (3) Editor -There can be many. An Editor is assigned by a Service Body Administrator to edit meetings for that Service Body. They can only edit meetings; not users or Service Bodies. Making a user an editor (or a Service Body Administrator) doesn't automatically give them any rights. They must first be assigned to a Service Body, either by the Server Administrator (Service Body Administrators), or by a Service Body Administrator (Editors).
  • (4) User Disabled.
  • (5) Observer -User can see private data in meetings for which it is authorized.
c_comdef_user::IsEnabled ( )

Returns true if the user is enabled (levels 1-3)

Returns:
a Boolean. true if enabled, false if not.
c_comdef_user::IsUser ( in_login_string,
in_password_string,
in_pw_raw = false 
)

See if this is the given user by login and password.

The login is case-insensitive, but the password is not.

Returns:
true, if so, false if not.
Parameters:
in_login_stringA string, containing the user's login.
in_password_stringA string, containing the user's password, in encrypted form, or unencrypted, if $in_pw_raw is true.
in_pw_rawA Boolean, true if the password has not been encrypted.
c_comdef_user::RestoreFromDB ( )

Updates this instance to the current values in the DB (replacing current values of the instance).

Exceptions:
aPDOException if there is a problem.

Implements i_comdef_db_stored.

c_comdef_user::SerializeObject ( )

Returns a storable serialization of the object, as a string.

This is only used for the changes, as the serialized string may not be easily searched.

Returns:
a string, containing the table array, in serialized form.

Implements i_comdef_serialized.

c_comdef_user::SetEmailAddress ( in_email_address_string)

Accessor - Sets the user email address.

Parameters:
in_email_address_stringA string, containing the user's email address.
c_comdef_user::SetID ( in_user_id_bigint)

Accessor - Sets the user ID as an integer.

Parameters:
in_user_id_bigintAn integer, with the user ID.
c_comdef_user::SetLastAccess ( in_time = null)

Simply sets the last access time to now.

Parameters:
in_timeAn epoch time. If not provided, now is used.
c_comdef_user::SetLogin ( in_login_string)

Accessor - Sets the userlogin.

Returns:
true if successful, and false if not.
Parameters:
in_login_stringA string, containing the user's login.
c_comdef_user::SetNewPassword ( in_password_unencrypted_string)

Accessor - Sets the password, encrypting it.

Returns:
a string, containing the encrypted password. Returns null if none was provided.
Parameters:
in_password_unencrypted_stringA string, containing the user's password, in unencrypted form.
c_comdef_user::SetPassword ( in_password_string)

Accessor - Sets the password, as an encrypted string.

Parameters:
in_password_stringA string, containing the user's password, in encrypted form.
c_comdef_user::SetUserLevel ( in_user_level_tinyint)

Accessor - Sets the user level. Attempts to set the user level to 1 for users other than User 1 will fail.

Returns:
true if successful, false otherwise.
Parameters:
in_user_level_tinyintThe user level (an integer).

Values:

  • (1) Server Administrator -There can only be one. The user ID is always 1. This administrator can edit all aspects of the server.
  • (2) Service Body Administrator -There can only be one per Service Body A Service Body Administrator can edit all meetings from the Service Body that assigns the user as its administrator. This user can also assign other Service Body Administrators or Editors as users able to edit meetings belonging to the Service Body. A Service Body Administrator can also edit Service Body information. NOTE: A Service Body Administrator only has extra rights when assigned to a specific Service Body. If assigned as an Editor on another Service Body, they do not have rights beyond those of an Editor.
  • (3) Editor -There can be many. An Editor is assigned by a Service Body Administrator to edit meetings for that Service Body. They can only edit meetings; not users or Service Bodies. Making a user an editor (or a Service Body Administrator) doesn't automatically give them any rights. They must first be assigned to a Service Body, either by the Server Administrator (Service Body Administrators), or by a Service Body Administrator (Editors).
  • (4) User Disabled.
  • (5) Observer -User can see private data in meetings for which it is authorized.
static c_comdef_user::UnserializeObject ( in_parent,
serialized_string 
) [static]

This takes the serialized table, and instantiates a new object from it.

Returns:
a new instance of c_comdef_user, set up according to the serialized data passed in.
Parameters:
in_parentThe parent object.
serialized_stringA string containing the serialized data.

Implements i_comdef_serialized.

Referenced by c_comdef_change::GetAfterObject(), and c_comdef_change::GetBeforeObject().

c_comdef_user::UpdateToDB ( is_rollback = false,
new_login = null,
new_pass = null 
)

Updates or adds this instance to the database.

Returns:
true if successful, false, otherwise.
Exceptions:
aPDOException if there is a problem.
Parameters:
is_rollbackIf true, this is a rollback operation.
new_loginThis is a new login (Due to the self-checking, we can't set our own login before this). If it is null, no new password will be set.
new_passThis is a new password (Due to the self-checking, we can't set our own pass before this). If it is null, no new password will be set.
c_comdef_user::UserCanEdit ( in_user_object = null)

Test to see if a user is allowed to edit an instance (change the data).

Returns:
true, if the user is allowed to edit, false, otherwise.
Parameters:
in_user_objectA reference to a c_comdef_user object, for the user to be validated. If null, or not supplied, the server current user is tested.

Implements i_comdef_auth.


Member Data Documentation

c_comdef_user::$_email_address_string = null [private]

A string, containing the user's email address.

c_comdef_user::$_id_bigint = null [private]

An integer, containing the unique ID of this user.

c_comdef_user::$_last_access = null [private]

A time date, indicating the last time the user was active. This will be useful for administration.

c_comdef_user::$_login_string = null [private]

A string, containing the user's login ID.

c_comdef_user::$_password_string = null [private]

A string, containing the user's encrypted password.

c_comdef_user::$_user_level_tinyint = null [private]

An integer, containing the user level.

Values:

  • (1) Server Administrator -There can only be one. The user ID is always 1. This administrator can edit all aspects of the server.
  • (2) Service Body Administrator -There can only be one per Service Body A Service Body Administrator can edit all meetings from the Service Body that assigns the user as its administrator. This user can also assign other Service Body Administrators or Editors as users able to edit meetings belonging to the Service Body. A Service Body Administrator can also edit Service Body information. NOTE: A Service Body Administrator only has extra rights when assigned to a specific Service Body. If assigned as an Editor on another Service Body, they do not have rights beyond those of an Editor.
  • (3) Editor -There can be many. An Editor is assigned by a Service Body Administrator to edit meetings for that Service Body. They can only edit meetings; not users or Service Bodies. Making a user an editor (or a Service Body Administrator) doesn't automatically give them any rights. They must first be assigned to a Service Body, either by the Server Administrator (Service Body Administrators), or by a Service Body Administrator (Editors).
  • (4) User Disabled.
  • (5) Observer -There can be many. This user cannot make changes, but can see visibility 0 data items in meetings for the Service bodies to which it has been attached..

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Enumerations