Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <?php
  2. define( '_JEXEC', 1 );
  3. define('JPATH_BASE', dirname(__FILE__) );
  4. define( 'DS', DIRECTORY_SEPARATOR );
  5.  
  6. /* Required Files */
  7. require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
  8. require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
  9.  
  10. $app = JFactory::getApplication('site');
  11. $app->initialise();
  12.  
  13. require_once(JPATH_BASE.DS.'components'.DS.'com_users'.DS.'models'.DS.'registration.php');
  14. //not necessary
  15. //require_once(JPATH_BASE.DS.'libraries'.DS.'joomla'.DS.'application'.DS.'component'.DS.'helper.php';
  16.  
  17. $model = new UsersModelRegistration();
  18. jimport('joomla.mail.helper');
  19. jimport('joomla.user.helper');
  20.  
  21. $language = JFactory::getLanguage();
  22. $language->load('com_users', JPATH_SITE);
  23.  
  24. $username = 'adam';
  25. $name = 'adam24';
  26. $email = 'adam@mailinator.com';
  27. $password = 'adam';
  28. $data = array( 'username' => $username,
  29. 'name' => $name,
  30. 'email1' => $email,
  31. 'password1' => $password, // First password field
  32. 'password2' => $password, // Confirm password field
  33. 'block' => 0 );
  34.  
  35. echo $model->register($data);
  36.  
  37. if (version_compare(PHP_VERSION, '5.3.1', '<')) {
  38. die('Your host needs to use PHP 5.3.1 or higher to run this version of Joomla!');
  39. }
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement