This class handles BMLT users. One instance is created for each user on the server. More...
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. | |
This class handles BMLT users. One instance is created for each user on the server.
| 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.
| in_parent_obj | A reference to the parent object for this object |
| in_id_bigint | Integer. The ID of the user |
| in_user_level_tinyint | The user level (an integer). |
Values:
| in_email_address_string | A string, containing the user's email address. |
| in_login_string | A string, containing the user's login. |
| in_password_string | A string, containing the user's password, in encrypted form. |
| in_lang_enum | An enum/string, with the user's language. |
| in_name_string | A string, containing the readble name for the user. |
| in_description_string | A string, containing a description of the user. |
| in_last_access | An epoch time, indicating the last access of this user (Optional). |
| c_comdef_user::DeleteFromDB | ( | ) |
Deletes this instance from the database, and creates a change record.
| a | PDOException 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.
| a | PDOException if there is a problem. |
| c_comdef_user::GetEmailAddress | ( | ) |
Accessor - Returns the user email address.
| c_comdef_user::GetID | ( | ) |
Accessor - Returns the user ID as an integer.
| c_comdef_user::GetLastAccess | ( | ) |
Accessor - Gets the last access time.
| c_comdef_user::GetLogin | ( | ) |
Accessor - Returns the user login.
| c_comdef_user::GetPassword | ( | ) |
Accessor - Returns the user password, in encrypted form.
| c_comdef_user::GetUserLevel | ( | ) |
Accessor - Returns the user level as an integer.
| c_comdef_user::IsEnabled | ( | ) |
Returns true if the user is enabled (levels 1-3)
| 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.
| in_login_string | A string, containing the user's login. |
| in_password_string | A string, containing the user's password, in encrypted form, or unencrypted, if $in_pw_raw is true. |
| in_pw_raw | A 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).
| a | PDOException 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.
Implements i_comdef_serialized.
| c_comdef_user::SetEmailAddress | ( | $ | in_email_address_string | ) |
Accessor - Sets the user email address.
| in_email_address_string | A string, containing the user's email address. |
| c_comdef_user::SetID | ( | $ | in_user_id_bigint | ) |
Accessor - Sets the user ID as an integer.
| in_user_id_bigint | An integer, with the user ID. |
| c_comdef_user::SetLastAccess | ( | $ | in_time = null | ) |
Simply sets the last access time to now.
| in_time | An epoch time. If not provided, now is used. |
| c_comdef_user::SetLogin | ( | $ | in_login_string | ) |
Accessor - Sets the userlogin.
| in_login_string | A string, containing the user's login. |
| c_comdef_user::SetNewPassword | ( | $ | in_password_unencrypted_string | ) |
Accessor - Sets the password, encrypting it.
| in_password_unencrypted_string | A string, containing the user's password, in unencrypted form. |
| c_comdef_user::SetPassword | ( | $ | in_password_string | ) |
Accessor - Sets the password, as an encrypted string.
| in_password_string | A 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.
| in_user_level_tinyint | The user level (an integer). |
Values:
| static c_comdef_user::UnserializeObject | ( | $ | in_parent, |
| $ | serialized_string | ||
| ) | [static] |
This takes the serialized table, and instantiates a new object from it.
| in_parent | The parent object. |
| serialized_string | A 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.
| a | PDOException if there is a problem. |
| is_rollback | If true, this is a rollback operation. |
| new_login | This 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_pass | This 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).
| in_user_object | A 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.
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.7.4