26 defined(
'LGV_DBF_CATCHER' ) or die ( 'Cannot Execute Directly' );
28 CO_Config::require_extension_class('tco_collection.interface.php');
29 require_once(CO_Config::db_class_dir().'/co_main_db_record.class.php');
42 if ( !defined(
'LGV_LANG_CATCHER') ) {
43 define(
'LGV_LANG_CATCHER', 1);
80 $login_id = isset($this->
tags()[0]) ? intval($this->
tags()[0]) : 0;
83 $my_login_object = $this->
get_access_object()->get_single_security_record_by_id($login_id);
86 $this->_login_object = $my_login_object;
124 $in_db_result = NULL,
126 $in_tags_array = NULL
129 $this->_container = Array();
130 $this->_login_object = NULL;
132 parent::__construct($in_db_object, $in_db_result, $in_owner_id, $in_tags_array);
134 $this->class_description =
"This is a 'Collection' Class for Users.";
145 $ret = parent::load_from_db($in_db_result);
147 $this->class_description =
"This is a 'Collection' Class for Users.";
175 return (intval($this->
tags()[0]) > 0);
195 public function is_god() {
196 $tags = $this->
tags();
198 return isset($tags) && is_array($tags) &&
count($tags) && (0 < intval($tags[0])) && (intval($tags[0]) == CO_Config::god_mode_id());
206 if (!$this->
is_god() && !isset($this->_login_object)) {
210 return $this->
is_god() || (isset($this->_login_object) && ($this->_login_object instanceof
CO_Login_Manager));
219 public function set_tags( $in_tags_array
223 if (isset($in_tags_array) && is_array($in_tags_array) &&
count($in_tags_array) && (11 >
count($in_tags_array))) {
226 $tag0 = intval($in_tags_array[0]);
227 if ($this->
get_access_object()->god_mode() || ((isset($id_pool) && is_array($id_pool) &&
count($id_pool) && ((0 == $tag0) || in_array($tag0, $id_pool))))) {
228 $ret = parent::set_tags($in_tags_array);
241 public function set_tag( $in_tag_index,
246 $in_tag_index = intval($in_tag_index);
251 if ($this->
get_access_object()->god_mode() || ((isset($id_pool) && is_array($id_pool) &&
count($id_pool) && ((0 <= $in_tag_index) || in_array(intval($in_tag_value), $id_pool))))) {
252 $ret = parent::set_tag($in_tag_index, $in_tag_value);
266 return isset($this->_tags[1]) ? $this->_tags[1] :
'';
277 return $this->
set_tag(1, $in_surname);
287 return isset($this->_tags[2]) ? $this->_tags[2] :
'';
298 return $this->
set_tag(2, $in_middle_name);
308 return isset($this->_tags[3]) ? $this->_tags[3] :
'';
319 return $this->
set_tag(3, $in_given_name);
329 return isset($this->_tags[4]) ? $this->_tags[4] :
'';
340 return $this->
set_tag(4, $in_prefix);
350 return isset($this->_tags[5]) ? $this->_tags[5] :
'';
361 return $this->
set_tag(5, $in_suffix);
371 return isset($this->_tags[6]) ? $this->_tags[6] :
'';
382 return $this->
set_tag(6, $in_nickname);
394 public function set_login( $in_login_id_integer
396 $ret = parent::user_can_write();
397 $in_login_id_integer = intval($in_login_id_integer);
403 $tag0 = (0 == $in_login_id_integer) ? NULL : strval(intval($in_login_id_integer));
405 $ret = $this->
set_tag(0, $tag0);
408 $this->_login_object = NULL;
431 $ret = parent::get_lang();
433 if (!isset($this->context[
'lang'])) {
436 $ret = $login_object->get_lang();
450 $delete_login_object_too =
false
454 $user_items_to_delete = $this->
children();
456 foreach ($user_items_to_delete as $child) {
457 if ($child->user_can_write()) {
458 $child->delete_from_db();
464 if ($delete_login_object_too) {
467 if (isset($login_object) && $login_object->user_can_write()) {
468 $login_object->delete_from_db();
469 $this->error = $login_object->error;
473 return parent::delete_from_db();
if(!defined( 'LGV_LANG_CATCHER'))
if(isset($g_lang_override) && $g_lang_override &&file_exists(CO_Config::lang_class_dir().'/'. $g_lang_override.'.php')) $lang_file
$_login_object
The Security DB COBRA login instance associated with this user.
set_surname( $in_surname)
set_login( $in_login_id_integer)
set_tags( $in_tags_array)
set_middle_name( $in_middle_name)
load_from_db( $in_db_result)
set_tag( $in_tag_index, $in_tag_value)
set_nickname( $in_nickname)
set_given_name( $in_given_name)
__construct( $in_db_object=NULL, $in_db_result=NULL, $in_owner_id=NULL, $in_tags_array=NULL)
count( $is_recursive=false)
static $user_error_code_invalid_class
static $user_error_code_invalid_id
static $user_error_code_user_not_authorized
static $user_error_name_invalid_class
static $user_error_name_user_not_authorized
static $user_error_name_invalid_id
static $user_error_desc_invalid_id
static $user_error_desc_invalid_class
static $user_error_desc_user_not_authorized
This class provides a general error report, with file, method and error information.