Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once __DIR__ . '/db_connect.php';
- $type = '0';
- $username = 'username';
- $password = 'pass';
- $name = 'john';
- $mobile = '9090909090';
- $email = 'abc@gmail.com';
- $alias = strtr($name, array (' ' => '-'));
- define( '_JEXEC', 1 );
- define('JPATH_BASE', dirname(__FILE__) );
- define( 'DS', DIRECTORY_SEPARATOR );
- require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
- require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
- $app = JFactory::getApplication('site');
- $app->initialise();
- require_once(JPATH_BASE.DS.'components'.DS.'com_users'.DS.'models'.DS.'registration.php');
- $lang = JFactory::getLanguage();
- $extension = 'com_users';
- $base_dir = JPATH_SITE;
- $language_tag = 'en-GB';
- $reload = true;
- $lang->load($extension, $base_dir, $language_tag, $reload);
- $model = new UsersModelRegistration();
- jimport('joomla.mail.helper');
- jimport('joomla.user.helper');
- $block = '0';
- $sendEmail = '0';
- $activation = '1';
- $data = array( 'username' => $username,
- 'name' => $name,
- 'email1' => $email,
- 'password1' => $password, // First password field
- 'password2' => $password, // Confirm password field
- 'sendEmail' => $sendEmail,
- 'activation' => $activation,
- 'mobile' => $mobile,
- 'groups' =>array("2","10"));
- $response = $model->register($data);
- echo $data['mobile'];
- $mobile = null; // line 60 at root/libraries/joomla/user/user.php
- <field
- name="mobile"
- type="text"
- description="COM_USERS_DESIRED_USERNAME"
- filter="mobile"
- label="COM_USERS_REGISTER_USERNAME_LABEL"
- message="COM_USERS_REGISTER_USERNAME_MESSAGE"
- size="30" />
- public function register()
- <?php
- define('_JEXEC', 1);
- define('JPATH_BASE', __DIR__);
- define('DS', DIRECTORY_SEPARATOR);
- /* Required Files */
- require_once(JPATH_BASE . DS . 'includes' . DS . 'defines.php');
- require_once(JPATH_BASE . DS . 'includes' . DS . 'framework.php');
- $app = JFactory::getApplication('site');
- $app->initialise();
- require_once(JPATH_BASE . DS . 'components' . DS . 'com_users' . DS . 'models' . DS . 'registration.php');
- //not necessary
- //require_once(JPATH_BASE.DS.'libraries'.DS.'joomla'.DS.'application'.DS.'component'.DS.'helper.php';
- $model = new UsersModelRegistration();
- jimport('joomla.mail.helper');
- jimport('joomla.user.helper');
- $language = JFactory::getLanguage();
- $language->load('com_users', JPATH_SITE);
- $type = '0';
- $username = 'username';
- $password = 'pass';
- $name = 'john';
- $mobile = '9090909090';
- $email = 'abc@gmail.com';
- $alias = strtr($name, array(' ' => '-'));
- $username = 'adam';
- $name = 'adam24';
- $email = 'adam@mailinator.com';
- $password = 'adam';
- $block = '0';
- $sendEmail = '0';
- $activation = '1';
- $data = array('username' => $username,
- 'name' => $name,
- 'email1' => $email,
- 'password1' => $password, // First password field
- 'password2' => $password, // Confirm password field
- 'sendEmail' => $sendEmail,
- 'activation' => $activation,
- 'mobile' => $mobile,
- 'groups' => array("2", "10"));
- $response = $model->register($data);
- echo $data['mobile'];
- echo $model->register($data);
- if (version_compare(PHP_VERSION, '5.3.1', '<')) {
- die('Your host needs to use PHP 5.3.1 or higher to run this version of Joomla!');
- }
- ?>
- <!-- db result -->
- <tr>
- <th>id</th>
- <th>name</th>
- <th>username</th>
- <th>email</th>
- <th>password</th>
- <th>block</th>
- <th>sendEmail</th>
- <th>registerDate</th>
- <th>lastvisitDate</th>
- <th>activation</th>
- <th>params</th>
- <th>lastResetTime</th>
- <th>resetCount</th>
- <th>otpKey</th>
- <th>otep</th>
- <th>requireReset</th>
- <th>mobile</th>
- </tr>
- <tr>
- <td>382</td>
- <td>adam24</td>
- <td>adam</td>
- <td>adam@mailinator.com</td>
- <td>$2y$10$CWsR0Ab9AZNvze2l/2Teiek3mzZ3EqyxnAzuYcv9CTaMCeSud5pza</td>
- <td>1</td>
- <td>0</td>
- <td>2015-10-26 22:16:16</td>
- <td>NULL</td>
- <td>fa37ff46e1be16c6029723c395c0f156</td>
- <td>{}</td>
- <td>NULL</td>
- <td>0</td>
- <td></td>
- <td></td>
- <td>0</td>
- <td>9090909090</td>
- </tr>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement