Create new Joomla User using an External PHP Script

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
User avatar
razor7
Joomla! Explorer
Joomla! Explorer
Posts: 374
Joined: Wed Aug 24, 2005 2:06 pm
Location: Argentina
Contact:

Create new Joomla User using an External PHP Script

Post by razor7 » Mon Sep 29, 2014 10:13 pm

Hi, I need to create new Joomla Users using an external PHP file that receives some POST vars for user creation.

I know how to set up Joomla Framework but lack of knowledge to create new user API functions. Is that possible?

Anyone knows some tutorial or example to follow? (I know I can dig on com_users, but looking something more explicit)

Thanks in advise!
Visit http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more! http://www.mgscreativa.com/contenidos/i ... Itemid=214

iextensions
I've been banned!
Posts: 1498
Joined: Fri Jul 12, 2013 5:37 pm
Contact:

Re: Create new Joomla User using an External PHP Script

Post by iextensions » Tue Sep 30, 2014 2:17 am

- when you install joomla, you have com_users to create and manage users
- if you use external script to create user, you can insert into database of joomla site.
Then user can login joomla. Is that your ideas?

User avatar
razor7
Joomla! Explorer
Joomla! Explorer
Posts: 374
Joined: Wed Aug 24, 2005 2:06 pm
Location: Argentina
Contact:

Re: Create new Joomla User using an External PHP Script

Post by razor7 » Tue Sep 30, 2014 12:03 pm

Hi iextensions!

Yes that's what I want, but instead of inserting the user directly in DB, I want to use Joomla! logic and methods to create and persist a new JUser object.

How can that be acheived?

Thanks!
Last edited by razor7 on Tue Sep 30, 2014 2:51 pm, edited 1 time in total.
Visit http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more! http://www.mgscreativa.com/contenidos/i ... Itemid=214

iextensions
I've been banned!
Posts: 1498
Joined: Fri Jul 12, 2013 5:37 pm
Contact:

Re: Create new Joomla User using an External PHP Script

Post by iextensions » Tue Sep 30, 2014 1:36 pm

not understand your idea.... if you don't want to store in joomla user table, why you want to use it in joomla site?
If want to know the object from joomla, you can check joomla document.

User avatar
razor7
Joomla! Explorer
Joomla! Explorer
Posts: 374
Joined: Wed Aug 24, 2005 2:06 pm
Location: Argentina
Contact:

Re: Create new Joomla User using an External PHP Script

Post by razor7 » Tue Sep 30, 2014 2:49 pm

Hi iextensions, will try to be clear.

I have a script that will receive new user POST data, that script will instanciate the Joomla framework and there is where I need to populate a new JUser objet to persist all the POST data given by an external API.

I want to use the JUser object because I want to execute the password creation methods and its store method to persist the object.

I need some extra info on how to use the JUser object to correctly create a new user, because I want to avoid doing reverse ingeneering on the com_users code.

Thanks in advise!
Visit http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more! http://www.mgscreativa.com/contenidos/i ... Itemid=214


User avatar
razor7
Joomla! Explorer
Joomla! Explorer
Posts: 374
Joined: Wed Aug 24, 2005 2:06 pm
Location: Argentina
Contact:

Re: Create new Joomla User using an External PHP Script

Post by razor7 » Thu Oct 09, 2014 12:13 pm

Great!

Digging a little more I found that VirtueMart Joomla Extension does exactly whay I need to investigate at user registration. It creates a new JUser instance and persists all needed data, and after that, It creates the VM user instance and persists it.

Thanks a lot for the comments!
Visit http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more! http://www.mgscreativa.com/contenidos/i ... Itemid=214


Locked

Return to “General Questions/New to Joomla! 2.5”