Code: Select all
$mosConfig_live_site = JURI::base(true);
Code: Select all
$mosConfig_sitename = $mainframe->getCfg('sitename');
$mosConfig_mailfrom = $mainframe->getCfg('mailfrom');
$mosConfig_fromname = $mainframe->getCfg('fromname');
Locating the parameters from Global Configuration for user registration.
I found it easier to create an ini file to access the variables instead of using an array. Not sure if there are any performance issues.
Code: Select all
$table =& JTable::getInstance('component');
$table->loadByOption( 'com_users' );
# create an ini file - easier to access the variables
file_put_contents("tmp/params.ini", $table->params);
$params = parse_ini_file("tmp/params.ini");
# delete the file
unlink("tmp/params.ini");
$mosConfig_allowUserRegistration = $params['allowUserRegistration'];
$mosConfig_useractivation = $params['useractivation'];
Code: Select all
$my =& JFactory::getUser();
// $my->id now becomes
$my->get('id');