fixed greateUser logic to use the admin and site creation modes in correct way. Fixed language import issue that cause header mismatching. Added the option to add header values to the custom-custom fields.
This commit is contained in:
@ -1876,20 +1876,22 @@ class Interpretation extends Fields
|
||||
. "\$lang->load(\$extension, \$base_dir, \$language_tag, \$reload);";
|
||||
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
|
||||
. " Load the correct user model.";
|
||||
$method[] = $this->_t(2) . "if (\$mode == 1)";
|
||||
$method[] = $this->_t(2) . "{";
|
||||
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
|
||||
. " Load the backend-user model";
|
||||
$method[] = $this->_t(3)
|
||||
. "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/com_users', 'Users');";
|
||||
$method[] = $this->_t(2) . "}";
|
||||
$method[] = $this->_t(2) . "else";
|
||||
$method[] = $this->_t(2) . "if (\$mode == 1) //" . $this->setLine(__LINE__)
|
||||
. " 1 = Site Registrations";
|
||||
$method[] = $this->_t(2) . "{";
|
||||
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
|
||||
. " Load the user site-registration model";
|
||||
$method[] = $this->_t(3)
|
||||
. "\$model = self::getModel('registration', JPATH_ROOT. '/components/com_users', 'Users');";
|
||||
$method[] = $this->_t(2) . "}";
|
||||
$method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__)
|
||||
. " 0 = Admin Registration";
|
||||
$method[] = $this->_t(2) . "{";
|
||||
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
|
||||
. " Load the backend-user model";
|
||||
$method[] = $this->_t(3)
|
||||
. "\$model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/com_users', 'Users');";
|
||||
$method[] = $this->_t(2) . "}";
|
||||
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
|
||||
. " Check if we have params/config";
|
||||
$method[] = $this->_t(2) . "if (self::checkArray(\$params))";
|
||||
@ -1921,16 +1923,14 @@ class Interpretation extends Fields
|
||||
$method[] = $this->_t(3) . "'block' => 0 );";
|
||||
$method[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
|
||||
. " Added details based on mode";
|
||||
$method[] = $this->_t(2) . "if (\$mode == 1)";
|
||||
$method[] = $this->_t(2) . "if (\$mode == 1) //". $this->setLine(__LINE__)
|
||||
. " 1 = Site-registration mode";
|
||||
$method[] = $this->_t(2) . "{";
|
||||
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
|
||||
. " Site-registration mode";
|
||||
$method[] = $this->_t(3) . "\$data['email1'] = \$credentials['email'];";
|
||||
$method[] = $this->_t(2) . "}";
|
||||
$method[] = $this->_t(2) . "else";
|
||||
$method[] = $this->_t(2) . "else //" . $this->setLine(__LINE__)
|
||||
. " 0 = Admin-registration mode";
|
||||
$method[] = $this->_t(2) . "{";
|
||||
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
|
||||
. " Admin-registration mode";
|
||||
$method[] = $this->_t(3) . "\$data['email'] = \$credentials['email'];";
|
||||
$method[] = $this->_t(3) . "\$data['registerDate'] = JFactory::getDate()->toSql();";
|
||||
$method[] = $this->_t(2) . "}";
|
||||
@ -1943,7 +1943,7 @@ class Interpretation extends Fields
|
||||
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
|
||||
. " Set random password when empty password was submitted,";
|
||||
$method[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
|
||||
. " and we are using the site-registration mode";
|
||||
. " when using the 1 = site-registration mode";
|
||||
$method[] = $this->_t(3) . "\$credentials['password'] = self::randomkey(8);";
|
||||
$method[] = $this->_t(3) . "\$credentials['password2'] = \$credentials['password'];";
|
||||
$method[] = $this->_t(2) . "}";
|
||||
|
@ -57,7 +57,7 @@ abstract class ComponentbuilderHelper
|
||||
/**
|
||||
* Array of php fields Allowed (16)
|
||||
**/
|
||||
public static $phpFieldArray = array('', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'x');
|
||||
public static $phpFieldArray = array('', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'x', 'HEADER');
|
||||
|
||||
/**
|
||||
* The global params
|
||||
@ -2965,7 +2965,15 @@ abstract class ComponentbuilderHelper
|
||||
$script['setdata'][] = self::_t(3) . "\$jinput = JFactory::getApplication()->input;";
|
||||
$script['setdata'][] = self::_t(3) . "foreach(\$target_headers as \$header)";
|
||||
$script['setdata'][] = self::_t(3) . "{";
|
||||
$script['setdata'][] = self::_t(4) . "\$data['target_headers'][\$header] = \$jinput->getString(\$header, null);";
|
||||
$script['setdata'][] = self::_t(4) . "if ((\$column = \$jinput->getString(\$header, false)) !== false ||";
|
||||
$script['setdata'][] = self::_t(5) . "(\$column = \$jinput->getString(strtolower(\$header), false)) !== false)";
|
||||
$script['setdata'][] = self::_t(4) . "{";
|
||||
$script['setdata'][] = self::_t(5) . "\$data['target_headers'][\$header] = \$column;";
|
||||
$script['setdata'][] = self::_t(4) . "}";
|
||||
$script['setdata'][] = self::_t(4) . "else";
|
||||
$script['setdata'][] = self::_t(4) . "{";
|
||||
$script['setdata'][] = self::_t(5) . "\$data['target_headers'][\$header] = null;";
|
||||
$script['setdata'][] = self::_t(4) . "}";
|
||||
$script['setdata'][] = self::_t(3) . "}";
|
||||
$script['setdata'][] = self::_t(3) . "// set the data";
|
||||
$script['setdata'][] = self::_t(3) . "if(isset(\$package['dir']))";
|
||||
|
Reference in New Issue
Block a user