In a system plugin I need to have two flags, one to check if there are more than one language in administration and another flag to check if a two factor authentication is needed.
Tried the following script and it is working, but I would like to know if there is a better/recommended way of doing it.
// Check more than 1 installed language jimport('joomla.language.helper'); $langs = JLanguageHelper::createLanguageList(null, JPATH_ADMINISTRATOR, false, true); $flagLang = (count($langs) > 1) ? true : false; // Check two factor authentication need FOFPlatform::getInstance()->importPlugin('twofactorauth'); $factor = FOFPlatform::getInstance()->runPlugins('onUserTwofactorIdentify', array()); $flagFactor = (!empty($factor)) ? true : false;