Additional Inherited Members | |
Public Attributes inherited from A_CO_DB | |
$access_object | |
$class_description | |
$error | |
$table_name | |
Protected Member Functions inherited from A_CO_DB | |
_create_read_security_predicate () | |
_create_write_security_predicate () | |
_create_security_predicate ( $write=false) | |
Protected Attributes inherited from A_CO_DB | |
$_pdo_object | |
$_existing_record_objects | |
This is the base class for the security database. It assumes that it will have logins and Security ID table rows.
Definition at line 39 of file co_security_db.class.php.
CO_Security_DB::__construct | ( | $in_pdo_object, | |
$in_access_object = NULL |
|||
) |
This is the initializer.
$in_pdo_object | The PDO instance for this database. |
$in_access_object | The access object (if any) for this login. |
Reimplemented from A_CO_DB.
Definition at line 45 of file co_security_db.class.php.
CO_Security_DB::add_personal_token_from_current_login | ( | $in_to_id, | |
$in_id | |||
) |
This adds a personal token, from one record, to the IDs of another record. This is a somewhat dangerous call, as it does not use a security predicate. That's deliberate, as we need to be able to change the security IDs of an item without necessarily being allowed to affect it.
$in_to_id | The ID of the object we are affecting. |
$in_id | The ID (personal token) to be added. |
Definition at line 119 of file co_security_db.class.php.
References A_CO_DB\execute_query().
CO_Security_DB::count_all_login_objects_with_access | ( | $in_security_token | ) |
You give a security ID, and you will get a count of all login objects that have that token in their list (or are of that ID).
This is not restricted, and will count logins that we don't otherwise know about.
It does not count the "God" admin, which always has access.
$in_security_token | An integer, with the requested security token. |
Definition at line 835 of file co_security_db.class.php.
References A_CO_DB\execute_query().
CO_Security_DB::get_all_login_ids | ( | ) |
This returns all of the login IDs in the database.
This should only be called from the ID fetcher in the access class, as it does not do a security predicate.
Definition at line 374 of file co_security_db.class.php.
References A_CO_DB\execute_query().
Referenced by is_this_a_login_id().
CO_Security_DB::get_all_login_objects | ( | $and_write = false | ) |
This is a security-vetted search for all login objects (visible to the current user).
$and_write | If true, then we only want ones we have write access to. |
Definition at line 710 of file co_security_db.class.php.
References A_CO_DB\_create_security_predicate(), A_CO_DB\_instantiate_record(), and A_CO_DB\execute_query().
CO_Security_DB::get_all_login_objects_with_access | ( | $in_security_token, | |
$and_write = false |
|||
) |
You give a security ID, and you will get all login objects that have that token in their list (or are of that ID).
This is restricted to use security vetting, so only logins visible to the current login.
$in_security_token | An integer, with the requested security token. |
$and_write | If true, then we only want ones we have write access to. |
Definition at line 755 of file co_security_db.class.php.
References A_CO_DB\_create_security_predicate(), A_CO_DB\_instantiate_record(), and A_CO_DB\execute_query().
CO_Security_DB::get_all_personal_ids_except_for_id | ( | $in_id = 0 | ) |
This returns just the "personal" IDs for ALL logins, EXCEPT for the given ID.
This should only be called from the ID fetcher in the access class, as it does not do a security predicate.
$in_id | The integer ID of the row we want exempted. If not specified, then all IDs are returned. |
Definition at line 247 of file co_security_db.class.php.
References A_CO_DB\execute_query().
Referenced by is_this_a_personal_id().
CO_Security_DB::get_all_tokens | ( | ) |
This returns the entire list of IDs in the Security Database.
It should only ever be called by the "God" admin.
Definition at line 494 of file co_security_db.class.php.
References A_CO_DB\execute_query().
CO_Security_DB::get_all_user_objects_with_access | ( | $in_security_token | ) |
You give a security ID, and you will get an array, with the user objects, associated with login objects that have that token in their list (or are of that ID).
This is security restricted, and will not return users that we don't otherwise know about.
$in_security_token | An integer, with the requested security token. |
Definition at line 878 of file co_security_db.class.php.
References A_CO_DB\$access_object, and A_CO_DB\execute_query().
CO_Security_DB::get_all_visible_logins | ( | ) |
This is an extremely simple function that gets the ID, Login ID (string), and name of logins visible to the current login. It's goal is to be extremely fast and result in a relatively small response.
Definition at line 517 of file co_security_db.class.php.
References A_CO_DB\_create_read_security_predicate(), and A_CO_DB\execute_query().
CO_Security_DB::get_credentials_by_api_key | ( | $in_api_key | ) |
This is a special "raw" function for getting login credentials from an API key.
$in_api_key | The API Key of the element. |
Definition at line 573 of file co_security_db.class.php.
References A_CO_DB\_instantiate_record(), and A_CO_DB\execute_query().
CO_Security_DB::get_initial_record_by_id | ( | $in_id | ) |
This is a very "raw" function that should ONLY be called from a special check from the access class.
It has no security screening, as this is just for checking.
$in_id | The ID of the element. |
Definition at line 604 of file co_security_db.class.php.
References A_CO_DB\_instantiate_record(), and A_CO_DB\execute_query().
CO_Security_DB::get_initial_record_by_login_id | ( | $in_login_id | ) |
This is a very "raw" function that should ONLY be called from the access instance __construct() method (or a special check from the access class).
It is designed to fetch the current login object from its string login ID, so we can extract the id.
It has no security screening, as it needs to be called before the security screens can be put into place.
$in_login_id | The login ID of the element. |
Definition at line 549 of file co_security_db.class.php.
References A_CO_DB\_instantiate_record(), and A_CO_DB\execute_query().
CO_Security_DB::get_logins_that_have_any_of_my_ids | ( | ) |
This returns IDs that have our personal IDs.
Definition at line 293 of file co_security_db.class.php.
References A_CO_DB\execute_query().
CO_Security_DB::get_logins_with_personal_ids | ( | ) |
This returns IDs that have personal IDs. This only works for the God admin.
Definition at line 341 of file co_security_db.class.php.
References A_CO_DB\execute_query().
CO_Security_DB::get_multiple_records_by_login_id | ( | $in_login_id_array, | |
$and_write = false |
|||
) |
This is a security-screened multiple login fetcher.
Definition at line 647 of file co_security_db.class.php.
References A_CO_DB\_create_security_predicate(), A_CO_DB\_instantiate_record(), and A_CO_DB\execute_query().
Referenced by get_single_record_by_login_id().
CO_Security_DB::get_personal_ids_for_id | ( | $in_id | ) |
This returns just the "personal" IDs for the given ID.
This should only be called from the ID fetcher in the access class, as it does not do a security predicate.
$in_id | The integer ID of the row. |
Definition at line 208 of file co_security_db.class.php.
References A_CO_DB\execute_query().
CO_Security_DB::get_security_ids_for_id | ( | $in_id, | |
$no_personal | |||
) |
This returns just the security IDs (including the item ID, itself) for the given ID.
This should only be called from the ID fetcher in the access class, as it does not do a security predicate.
$in_id | The integer ID of the row. |
$no_personal | This is optional. If we DO NOT want personal tokens included, this should be set to true. |
Definition at line 63 of file co_security_db.class.php.
References A_CO_DB\execute_query().
CO_Security_DB::get_single_record_by_login_id | ( | $in_login_id, | |
$and_write = false |
|||
) |
This is a security-screened method to fetch a single instance of a record object, based on its ID.
$in_login_id | The login ID of the requested login object. |
$and_write | If this is true, then we need the item to be modifiable. |
Definition at line 627 of file co_security_db.class.php.
References get_multiple_records_by_login_id().
CO_Security_DB::i_have_all_ids | ( | $in_id | ) |
This method will check a given security record (indicated by its ID), and make sure that we have COMPLETE access to it. This means that we check ALL the ids, as well as the record's write (not read) token.
This is not "security-vetted," in order to make sure that we are looking at the complete record.
$in_id | This is the ID of the record to check. |
Definition at line 460 of file co_security_db.class.php.
References A_CO_DB\execute_query().
CO_Security_DB::is_this_a_login_id | ( | $in_id | ) |
This checks an ID, to see if it is a login ID.
$in_id | The ID we are checking. Must be greater than 1. |
Definition at line 436 of file co_security_db.class.php.
References get_all_login_ids().
CO_Security_DB::is_this_a_personal_id | ( | $in_id | ) |
This checks an ID, to see if it is a personal ID.
$in_id | The ID we are checking. Must be greater than 1. |
Definition at line 415 of file co_security_db.class.php.
References get_all_personal_ids_except_for_id().
CO_Security_DB::remove_personal_token_from_this_login | ( | $in_to_id, | |
$in_id | |||
) |
This removes a personal token, from one record. This is a somewhat dangerous call, as it does not use a security predicate. That's deliberate, as we need to be able to change the security IDs of an item without necessarily being allowed to affect it.
$in_to_id | The ID of the object we are affecting. |
$in_id | The ID (personal token) to be removed. |
Definition at line 160 of file co_security_db.class.php.
References A_CO_DB\execute_query().