Add new account from front page

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
saovry
Joomla! Explorer
Joomla! Explorer
Posts: 252
Joined: Sat Jan 08, 2011 3:52 pm

Add new account from front page

Post by saovry » Tue Oct 20, 2020 2:41 am

I have one question.

- I want to set some permission for account in my website that this account can add news account at front end and set group for each of them (public, registration, Authors, Publisher, Admin, Super...)....

What I need

1- School account can add students account and set group for students from front ned.
2- School account can add parents account and set group for parents from front ned.

Is there possible without super admin or administrator manage at backend...?

Please advise..

thank u...
Last edited by toivo on Sat Oct 24, 2020 5:46 am, edited 1 time in total.
Reason: mod note: moved from 3.x General Questions

User avatar
andypooz
Joomla! Guru
Joomla! Guru
Posts: 720
Joined: Sat Dec 30, 2006 3:03 pm
Location: London, UK
Contact:

Re: Add new account from front page

Post by andypooz » Fri Oct 23, 2020 12:58 pm

I've created solutions for custom projects that allow registered users to generate new accounts from the front end, but they are bespoke, and specific to the use case. You might want to look at Learning Management Systems https://extensions.joomla.org/tags/lms/ which may allow new user registrations by existing users from the front end, but I'm not sure. Trouble is, they probably come with a whole slew of other features that you may or may not want.
Out of interest, will your site have multiple school accounts each with their own students and parents or just a single school?
Andy Hickey
Bespoke Joomla Extension Developer
http://www.netamity.com

saovry
Joomla! Explorer
Joomla! Explorer
Posts: 252
Joined: Sat Jan 08, 2011 3:52 pm

Re: Add new account from front page

Post by saovry » Sat Oct 24, 2020 4:12 am

It is multiple school...
I don't plan to make online Cours what I need if the schools register on my site so I can set the school to Group Title (Admin, Author) any one of them and the school can register new user from end and set the group title for student, teacher and staffs (Admin, Author and Publisher) as they want without login back end.

Is there possible?

thank for your message...

User avatar
andypooz
Joomla! Guru
Joomla! Guru
Posts: 720
Joined: Sat Dec 30, 2006 3:03 pm
Location: London, UK
Contact:

Re: Add new account from front page

Post by andypooz » Sat Oct 24, 2020 3:25 pm

I can't think of anything that allows you to do that at the moment, but it'd be possible to developer custom solution that achieved this.
The reason why I asked if it was multi-school, is that presumably the rights of access of those students parents and staff needs to be specific to that school, rather than a student being able to access resources for any school. This really means creating new categories for each school, and user groups and access levels for each school and user level to access those categories of content- more tricky than you might have hoped. But again, possible.
I'm sorry, nothing like that exists at the moment to my knowledge, but maybe others will know of something.
Andy Hickey
Bespoke Joomla Extension Developer
http://www.netamity.com

annahersh
Joomla! Guru
Joomla! Guru
Posts: 713
Joined: Wed Aug 15, 2018 8:23 pm

Re: Add new account from front page

Post by annahersh » Sat Oct 24, 2020 10:59 pm

saovry wrote:
Tue Oct 20, 2020 2:41 am
this account can add news account at front end and set group for each of them
You can achieve this with a from construction extension (https://extensions.joomla.org/tags/forms/) that will map to #__users and #__user_usergroup_map DB tables to insert the entry. Such an ext will allow creation of all the fields to mimic the user registration form and set the group level.

I use RSForm Pro to get this done, other folks use Breezing Forms Pro.

saovry
Joomla! Explorer
Joomla! Explorer
Posts: 252
Joined: Sat Jan 08, 2011 3:52 pm

Re: Add new account from front page

Post by saovry » Sun Oct 25, 2020 3:29 pm

annahersh wrote:
Sat Oct 24, 2020 10:59 pm
saovry wrote:
Tue Oct 20, 2020 2:41 am
this account can add news account at front end and set group for each of them
You can achieve this with a from construction extension (https://extensions.joomla.org/tags/forms/) that will map to #__users and #__user_usergroup_map DB tables to insert the entry. Such an ext will allow creation of all the fields to mimic the user registration form and set the group level.

I use RSForm Pro to get this done, other folks use Breezing Forms Pro.
Screen Shot 2020-10-25 at 10.24.40 PM.png
Is there to display Group Level in there because school (admin) can register new user and set group level in the same.
I still learning on RSForm... Could you explain me more?

thank u...
You do not have the required permissions to view the files attached to this post.

User avatar
mandville
Joomla! Master
Joomla! Master
Posts: 15002
Joined: Mon Mar 20, 2006 1:56 am
Location: The Girly Side of Joomla in Sussex

Re: Add new account from front page

Post by mandville » Sun Oct 25, 2020 3:50 pm

HU2HY- Poor questions = Poor answer
Un requested Help PM's will be reported, added to the foe list and possibly just deleted
{VEL Team Leader}{TM Auditor }{ Showcase & Security forums Moderator}

annahersh
Joomla! Guru
Joomla! Guru
Posts: 713
Joined: Wed Aug 15, 2018 8:23 pm

Re: Add new account from front page

Post by annahersh » Sun Oct 25, 2020 7:37 pm

saovry wrote:
Sun Oct 25, 2020 3:29 pm
Is there to display Group Level in there because school (admin) can register new user and set group level in the same.
The form builder does not include specific fields for user registration, you'll need to create them. However it will import an XML file that has such field instructions defined populate the fields along with DB insert coding. You may be able to find those files at the developer's website.

Here is an example of the DB processing code that is published at the rsjoomla site. Follow the links submitted by @mandville

Registration form

Code: Select all

if (isset($_POST['form']['username']))  
{  
    jimport('joomla.user.helper');
    $database =& JFactory::getDBO();  
    $fullname = $_POST['form']['firstname']." ".$_POST['form']['lastname'];  
    $email = $_POST['form']['email'];  
    $username = $_POST['form']['username'];  
    $password = $_POST['form']['password'];  
    $salt = JUserHelper::genRandomPassword(32); 
    $crypt = JUserHelper::getCryptedPassword($password, $salt); 
    $password = $crypt.":".$salt; 
    $database->setQuery("SELECT `id` FROM #__users WHERE `username`='".$username."'");  
    $database->query();  
    if ($database->getNumRows() > 0) die('This username is already taken. Please press back and try a different username.');  
    $database->setQuery("INSERT INTO #__users (`name`, `username`, `email`, `password`, `usertype`, `block`, `sendEmail`, `registerDate`, `lastvisitDate`, `activation`, `params`) VALUES('".$fullname."', '".$username."', '".$email."', '".$password."', 'Registered', 0, 0, now(), now(), '', '')");  
    $database->query();  
    $userid = $database->insertid();  
    $database->setQuery("INSERT INTO #__user_usergroup_map (`user_id`, `group_id`) VALUES ('".$userid."', 2)");  
    $database->query();
}

if (isset($_POST['form']['User_Name'])) 
{ 
    $database =& JFactory::getDBO(); 
    $firstname = $_POST['form']['First_Name'];
    $lastname = $_POST['form']['Last_Name'];
    $fullname = $_POST['form']['First_Name'] . ' ' . $_POST['form']['Last_Name'];
    $email = $_POST['form']['email']; 
    $username = $_POST['form']['User_Name']; 
    $password = $_POST['form']['Password']; 
    $database->setQuery("SELECT `id` FROM #__users WHERE `username`='".$username."'"); 
    $database->query(); 
 
    if ($database->getNumRows() > 0) die('This username is already taken. Please press back and try a different username.'); 
    $database->setQuery("INSERT INTO #__users (`name`, `username`, `email`, `password`, `usertype`, `block`, `sendEmail`, `registerDate`, `lastvisitDate`, `activation`, `params`) VALUES('".$fullname."', '".$username."', '".$email."', '".md5($password)."', 'Registered', 0, 0, now(), now(), '', '')"); 
    $database->query();
 
    $userid = $database->insertid(); 
    $database->setQuery("INSERT INTO #__user_usergroup_map 
    (`user_ID`, `group_ID`) 
    VALUES 
    ('".$userid."', 2)"); 
    $database->query();
 
} 

//<code>
 
// Adapted from user registration bind function here: http://api.joomla.org/__filesource/fsource_Joomla-Framework_User_joomlauseruser.php.html#a490
 
// PLACEHOLDER - If logged in, dont show registration form
 
jimport('joomla.user.helper'); // not sure if this line is needed or not
$array = $_POST['form'];
 
// PLACEHOLDER - Check to see if the user is new or not, if new proceed, else display error
 
// If no password provided create the encrypted password
if (empty($array['password'])) {
	$array['password']  = JUserHelper::genRandomPassword();
	$array['password2'] = $array['password'];
}
 
// PLACEHOLDER - Display error if passwords do not match (can also do with javascript)
 
$salt  = JUserHelper::genRandomPassword(32);
$crypt = JUserHelper::getCryptedPassword($array['password'], $salt);
$array['password'] = $crypt.':'.$salt;
 
// Set the registration timestamp
$now =& JFactory::getDate();
$registerDate = $now->toMySql(); // not sure if this is correct syntax
 
// PLACEHOLDER - Check that username is not greater than 150 characters (can also do with javascript)
 
// PLACEHOLDER - Check that password is not greater than 100 characters (can also do with javascript)
 
// PLACEHOLDER - Routine to save data to jos_user and/or other tables
 
//</code>


Post Reply

Return to “Extensions for Joomla! 3.x”