Well i have gone round and round and round.... so i thought i would ask... π
I have been trying to capture the user default_2fa value but all i get is an empty object
My code is:
$config_item = [];
$config_item = new ConfigItem();
$thestaff_id = (int) $staff->ht['staff_id'];
$user_default_2fa = ConfigItem::getConfigsByNamespace('staff.'.$thestaff_id, 'default_2fa');
echo "<pre>";
echo "hello"; //as a test output
echo "<br>";
//echo $user_default_2fa;
print_r($config_item);
exit;
and my results are:
hello
ConfigItem Object
(
[ht] => Array
(
)
[dirty] => Array
(
)
[__new__] => 1
[__deleted__] =>
[__deferred__] => Array
(
)
)
Why cant i get any object values? I am working inside of profile.inc.php
The same command is in ajax.staff.php on line 317
if i call something in class ConfigItem which is in the same file class.config.php i get a valid object with data.
?? baffled
I may have to write a new class to get away from the section/namespace BS..
Here is what i am trying to do.. this is a new function i added
function getUserDefault2fa($staffid, $column)
{
if(!empty($staffid))
{
$sql="SELECT `value` FROM ".$this->table." WHERE $column = $staffid AND `key` = 'default_2fa'";
if (($res=db_query($sql, false)) && db_num_rows($res))
{
return db_result($res);
}
}//close if not empty staffid
return false;
}//close function getUserDefault2fa