From 9ffa0b7d86a17e5951c8171a6147f1daecaa1a52 Mon Sep 17 00:00:00 2001 From: Amigo <49749100+aamigo@users.noreply.github.com> Date: Tue, 11 Jun 2019 17:06:32 +0200 Subject: [PATCH] Updated 024 How to integrate the Create User Helper Method in your Components (markdown) --- ...Create-User-Helper-Method-in-your-Components.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/024-How-to-integrate-the-Create-User-Helper-Method-in-your-Components.md b/024-How-to-integrate-the-Create-User-Helper-Method-in-your-Components.md index 77b3457..67c9d1b 100644 --- a/024-How-to-integrate-the-Create-User-Helper-Method-in-your-Components.md +++ b/024-How-to-integrate-the-Create-User-Helper-Method-in-your-Components.md @@ -1,4 +1,4 @@ -HOW TO INTEGRATE THE CREATE USER HELPER METHOD IN YOUR COMPONENTS +# HOW TO INTEGRATE THE CREATE USER HELPER METHOD IN YOUR COMPONENTS Hi. I would like to give you a quick tutorial or demonstration on how to use the user creation method or function in your component. What is the user creation function? [00:00:18](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m18s) It is basically a part of code's helper function that gets added to the helper class. @@ -13,6 +13,14 @@ Here is quite a few users, there it is create user. As you can see this is a pub ### Expert Field -There is a admin view called experts. It's in this view that I would actually like the option for someone to create a user. Let me first demonstrate how it works. I would go to expertdatabase and click on experts. Let's click on new. So you would see there is a [00:04:55](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m55s) field called expert which you can select users within a specific group. I will also explain some of that more later. But underneath there is this button create user. If you click on it, it basically has a pop-up where in you enter a user name. I am just going to say 'Testing123' as the username. [00:05:26](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m26s) And as the password, there we go, got the user name. So everything is testing123. If I click create, it basically has this nice effect where it is busy creating it, setting it up, sending out the email, doing all of that for you. And once it's done it lets you know that the user was created successfully and the login details was e-mailed to the user. Then it says here ready to select. [00:06:05](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m05s) You can now select testing123 that you just created from the user list in the above field. Simply click on the blue user icon. Click here and you can type in that testing123 click search. There is the user created and we click enter. You see that it basically used a very strange conversion here. Basically converting the username away from the numbers. Now you can you can fix that by clicking edit. [00:06:40](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m40s) +There is a admin view called experts. It's in this view that I would actually like the option for someone to create a user. Let me first demonstrate how it works. I would go to expertdatabase and click on experts. Let's click on new. So you would see there is a [00:04:55](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m55s) field called expert which you can select users within a specific group. I will also explain some of that more later. But underneath there is this button create user. If you click on it, it basically has a pop-up where in you enter a user name. I am just going to say 'Testing123' as the username. [00:05:26](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m26s) And as the password, there we go, got the user name. So everything is testing123. If I click create, it basically has this nice effect where it is busy creating it, setting it up, sending out the email, doing all of that for you. And once it's done it lets you know that the user was created successfully and the login details was e-mailed to the user. Then it says here ready to select. [00:06:05](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m05s) You can now select testing123 that you just created from the user list in the above field. Simply click on the blue user icon. Click here and you can type in that testing123 click search. There is the user created and we click enter. You see that it basically used a very strange conversion here. Basically converting the username away from the numbers. Now you can you can fix that by clicking edit.[00:06:40](https://www.youtube.com/watch?v=ckFakaQintegrated user now that is connected to an expert90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m40s) Then changing it to 123 and say save the update. Clearly my little application doesn't want to allow you to use any numbers in the user name. That's not the point. The point is that we have this integrated user now that is connected to an expert. If you were to click there again, you can still select it, but once you select it, you can't create a new expert and select that user again. So it's basically one profile connecting to one user to set up a expert. [00:07:24](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m24s) So that's the feature I'm using it for there is different ways that I have implemented this. + +Let me show you another one. Obviously you realise I'm using a lot of JavaScript on this page. I will show you some of that JavaScript but for the most part you need to write that yourself. For example over here I wrote this job tracking extension. Let's say we want to create a new job order, then I can say whether it's a new client or a existing. If it is an existing I simply select from this list. [00:08:04](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m04s) If it's new I click here(A new Client) I can enter all the details of the user and when I click save, it creates the user, stores the data in the user table, not in the job order table. Deletes all these values, that the job order table never stores any user values in the relation of this job order of course. And so that's another way that I have implemented. If we were to close this out, open a client, a new one. You would see it's basically it's the same values. [00:08:44](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m44s) So that's another way that we integrated this whole user integration. So there are really many different ways to this. The way I have done it I've just listen to my clients expectation. What I really would like to see and how they would like it to work, then simply make it happen that way. I personally prefer the Ajax way much more. It just seems to me easier. + +### Make Use Of The Ajax Concept + +So let me illustrate some of or let me show you some of the code that I used to do that. [00:09:26](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m26s) So we are back in the experts view. As I've done before I previously, in other tutorials explained how to make use of the Ajax concept within Component Builder. Now for those of you that like to understand what's going on let me give you a quick runover at the code level. Within every component that makes use of Ajax, a model, and a controller is created. The controller is named Ajax.json.php and the model is named [00:10:04](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m04s) Ajax. Let me open the model, let me also open the controller. As you can see the controller basic fires off the register tasks within the construct method. And then it adds the tasks into a switch, and tries to run the task. Also in [00:10:31](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m31s) the model it gets the model Ajax, and then runs the method that basically corresponds to the task. And so that is how it runs. + +It uses the Joomla's default filtering method in the way that it gets values that are being posted. And then value dates that those values actually are there. Then sends the values over to the model. [00:11:05](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m05s) Now that's looking at it from a code side. If you look at the model it simply shows you various methods. Some of them are protected, and some of them are public. Those(getcreateuserfields) are usually the ones that gets called from the controller once the Ajax gets the verification level and it's verified. Here is the createuser class. [00:11:31](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m31s) We first check whether this user, (now this is custom script I mean this I wrote custom, component build does not write this) so basically when you go back to the user interface, you will see that if I scroll down here, create user fields, then there's create user. You see that I wrote this right here, and that basically gets placed into the model. [00:12:07](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m07s) So that's the Ajax method. In that Ajax input I annotate the specific tasks, the task name, and specific variables, and again the method name. ??? -And then changing it to 123 and say save the update Does not want to allow that. So clearly my little application doesn't wanna allow you to use actually any numbers in the user name,.That's not the point The point is that we have this integrated user now that is connected to an expert And if you were to click there again You can still selected ok but once you select it once you can't create a new expert And select that user again So it's basically one profile connecting to one user To set up a expert [00:07:24](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m24s) So that's the feature I'm using it for there is different ways that I have implemented this let me show you another one Obviously you realise I'm using a lot of JavaScript on this page I will show you some of that JavaScript but That yourself Ok let me just get out of here for Example over here I wrote this job tracking Extension And let's say we want to create a new job order then I can say whether it's a new client or a existing if it is an existing I Simply select from this list [00:08:04](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m04s) If it's new I click here I can enter all the details of the user and when I click save It Creates the user Stores the data in the user table not in the job order table deletes all these values So did the job order table never stores any user values in the relation of this job order of course And so that's another way that I have implemented so if we were to close this out And where to open a client A new one You would see it's basically it's the same values And [00:08:44](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m44s) Everything is the same So that's another way that we integrated this whole User integration So there are really many different ways to this The way I have done it I've just listen to my clients expectation What I really would like to see and how they would like it to work And then simply Make It Happen that way I personally I prefer the Ajax Way much more It's it's just seems to me easier So let me illustrate some of or let me show you some of the code that I used to do that [00:09:26](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m26s) Ok so we back in The Experts View As I've done before I previously in other tutorials explained how to make use of the Ajax concept Within Component Builder Now for those of you that like to understand what's going on let me give you a quick runover At the code level Within every component that makes use of Ajax A model and a controller is created The controller is named Ajax.json.php and the model is named [00:10:04](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m04s) Ajax Ok let me open the model And also let me open The controller As you can see the controller basic fires off The register tasks within the construct method And then it adds the tasks Into a switch And tries to run the task basically Also in [00:10:31](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m31s) The model it It Gets the model Ajax And then runs the method that basically corresponds to the task And so that is how It runs It uses the Joomlas default Filtering Method in the way that it gets values that are being posted And then value dates that those values actually are there Then sends the values over to the model [00:11:05](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m05s) Now that's looking at it from a code side so if you look at the model It simply shows you Various methods Some of them are protected And some of them are public and those are usually the ones That gets called from the controller once the Ajax gets the Verification level and it's Verified So here is the create user class [00:11:31](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m31s) Basically We first check Whether this user now this is custom script I mean this I wrote custom component build does not write this so Basically when you go back to the user interface You see that If I scroll down here create user fields And then there's great user You see that I wrote this right here And that basically gets placed into the model [00:12:07](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m07s) So that's the Ajax method here I simply in that Ajax input I annotate the specific tasks The task name And specific variables And again the method name You could have different method names from task names and What should be validated whether it's integer, float or whatever And if there's no value What is the value by Default So this is where you set up there basically the controllers information [00:12:39](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m39s) And then here your customised these write your script so basically create user gets data and seems from what view is it then validates with this current login user has the permission To actually The Experts area Then it Converts the data because it's a json set of datasets that I'm sending across So that we can see if it's an array does some other checks So you can see I'm still here I'm using that [00:13:17](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m17s) Global helper Class and methods Here are number of custom methods obviously that That is available in that class to go through it we just added in there as freebies and And you wanna always see the Need of them but I'm using them often And even if you have with Improvements on those methods please make a pull request and we'll make those changes Then you over here once we've Become very sure that we've got enough data on the right data We basically get that same method and we need to create user [00:13:55](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m55s) Get result And if it's not the correct result we deal with it accordingly And if it is the correct result we create Add the user to the user group That's something that the user does not that you create user does not do So we Then have a user group setup [00:14:17](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m17s) And Basically in the component And we get that user group Set into the correct User Group This is a return message If it's an error or whether it's a Success So down here is the error message So if it's if it's successful this is what we do if it's unsuccessful this is what we do [00:14:45](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m45s) And so that's just a quick look I mean obviously we can pause this video and Look at What I have done And then here is getUser when the page loads initially we get the id get the data packs it into some html And sends it off So This is the PHP side obviously We we do this create user and then there is a ajax [00:15:16](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m16s) Site right in Javascript So In the JavaScript when the page loads Would you get user with the user ID We get the user ID from the field And then it loads that data that you saw If you if you looked no this is the wrong place Basically shows you that is the data it loads And that data can be edited Except over here [00:15:51](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m51s) You cannot add numbers in the username but you can do that and it will update it as you see and will say that is updated it Obviously if there is a Error with the email already used or something it will also give you an error And this is all part of how we basically have setup the JavaScript Ok we can scroll down to So I've just added to Javascript to the view file And here is get user the server side and there is the the function [00:16:24](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m24s) I have two functions usually one that sort of deals with Waiting and then eventually setting up the data into the The View And here's one making the call so this is how you call structure would usually look In index. php ?option = your components name And the task which Must go to the Ajax controller And then this is the task [00:16:54](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m54s) And you then here can stipulate what format you would like the result set returned in if you Want the result set returned the raw which in sometime sometimes is the case There is if you look here There is a raw Variable You can just set the raw variable to true Then it will give you the results set just Like that without Braces around them [00:17:23](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m23s) Or a call back or anything You see when you make calls from JavaScript It usually Wants this call back to be added If you make calls from other JavaScript libraries you might just want the braces around it But if you want it raw which also is often the case you just add the variable raw to the URL = true and then end up passing it back to you with this So that's a little heads up on Ajax function so [00:17:56](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m56s) the format must json that's Important Ok and always use a token Have the token on the page this token is necessary To prevent cross site scripting of course I usually add the token to the page Through the Java oh sorry php So there is a place down here if you scroll down where is it I just remembered remembered [00:18:28](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m28s) If you are working in a backend The backend the backend and the admin area you don't need to have the token its get added to the page dynamically Since we Basically parsed the JavaScript Areas And if we see token we actually know oh token is to be there and we add the token for you Where is the front end you must actually literally add the token There was just too many reasons for us Not to do the Automation in the front end so but you could literally change to the variable name as well [00:19:03](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m03s) To something of your choice Where is now it's just token it's backend it's more secure ok so You need to always add a token To the request and check whether the token is there if it's not that it wouldn't make a request at all Ok so I was looking at another function there Ok so that's simply how we create a user And integrate the user concept within this component I hope that was helpful I realize if you not that fluent in programming in JavaScript Or in jQuery [00:19:41](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m41s) As well as in PHP This might not fully resolved your questions Like I said where the beginning of these tutorials I wasn't planning on making a component that is Very easy to use but rather a Component that is very powerful to use And leaving it up to you to decide how to implement This user integration Is really the most powerful way of doing it At least we are adding the the class with which you can create the user And again even there you can go look at that class [00:20:20](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m20s) If you feel my implementation is a little you know needs some Inprovement You can either shoot me a mail or you could Take For this component Builder on GitHub Pull down to your own repository Make the changes push it back And The place inside Of component builder where this class is constructed [00:20:47](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m47s) is obviously Within The compilers files. Now the compiler Has Has quite a few files and you need to do do a search So you basically go to component Builder go to helper and then Use the compiler And here is all its files So do a search in here [00:21:09](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m09s) For the function Create user you could you know just search for that and I'm sure you're fine it and it is in that area where you need to make the adaptation and the changes because it's dynamically added It is not it can't be edited like right in the script it needs to be edit in the function where we add it Just go search those functions [00:21:38](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m38s) Thank you for watching That's how you create users and connect them to your components Obviously there is much more to say but I'm afraid this will get way too long like most of my tutorials get to long I want to keep it this this way and trying to make it shorter hope you enjoyed that +You could have different method names from task names. What should be validated, whether it's integer, float or whatever. And if there's no value, what is the value by default. So this is where you set up there basically the controllers information. [00:12:39](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m39s) And then here your customisely write your script. So basically create user gets data and seems from what view is it, then validates with this current login user has the permission to the experts area. Then it converts the data because it's a json set of datasets that I'm sending across. Checks whether it's an array, does some other checks. So you can see I'm still here I'm using that [00:13:17](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m17s) Global helper Class and methods. Here are number of custom methods obviously that is available in that class. Go through it. We just add it in there as freebies and you want to always see the need of them but I'm using them ofte.n And even if you have with Improvements on those methods please make a pull request and we'll make those changes Then you over here once we've Become very sure that we've got enough data on the right data We basically get that same method and we need to create user [00:13:55](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m55s) Get result And if it's not the correct result we deal with it accordingly And if it is the correct result we create Add the user to the user group That's something that the user does not that you create user does not do So we Then have a user group setup [00:14:17](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m17s) And Basically in the component And we get that user group Set into the correct User Group This is a return message If it's an error or whether it's a Success So down here is the error message So if it's if it's successful this is what we do if it's unsuccessful this is what we do [00:14:45](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m45s) And so that's just a quick look I mean obviously we can pause this video and Look at What I have done And then here is getUser when the page loads initially we get the id get the data packs it into some html And sends it off So This is the PHP side obviously We we do this create user and then there is a ajax [00:15:16](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15rm16s) Site right in Javascript So In the JavaScript when the page loads Would you get user with the user ID We get the user ID from the field And then it loads that data that you saw If you if you looked no this is the wrong place Basically shows you that is the data it loads And that data can be edited Except over here [00:15:51](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m51s) You cannot add numbers in the username but you can do that and it will update it as you see and will say trhat is updated it Obviously if there is a Error with the email already used or something it will also give you an error And this is all part of how we basically have setup the JavaScript Ok we can scroll down to So I've just added to Javascript to the view file And here is get user the server side and there is the the function [00:16:24](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m24s) I have two functions usually one that sort of deals with Waiting and then eventually setting up the data into the The View And here's one making the call so this is how you call structure would usually look In index. php ?option = your components name And the task which Must go to the Ajax controller And then this is the task [00:16:54](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m54s) And you then here can stipulate what format you would like the result set returned in if you Want the result set returned the raw which in sometime sometimes is the case There is if you look here There is a raw Variable You can just set the raw variable to true Then it will give you the results set just Like that without Braces around them [00:17:23](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m23s) Or a call back or anything You see when you make calls from JavaScript It usually Wants this call back to be added If you make calls from other JavaScript libraries you might just want the braces around it But if you want it raw which also is often the case you just add the variable raw to the URL = true and then end up passing it back to you with this So that's a little heads up on Ajax function so [00:17:56](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h17m56s) the format must json that's Important Ok and always use a token Have the token on the page this token is necessary To prevent cross site scripting of course I usually add the token to the page Through the Java oh sorry php So there is a place down here if you scroll down where is it I just remembered remembered [00:18:28](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h18m28s) If you are working in a backend The backend the backend and the admin area you don't need to have the token its get added to the page dynamically Since we Basically parsed the JavaScript Areas And if we see token we actually know oh token is to be there and we add the token for you Where is the front end you must actually literally add the token There was just too many reasons for us Not to do the Automation in the front end so but you could literally change to the variable name as well [00:19:03](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m03s) To something of your choice Where is now it's just token it's backend it's more secure ok so You need to always add a token To the request and check whether the token is there if it's not that it wouldn't make a request at all Ok so I was looking at another function there Ok so that's simply how we create a user And integrate the user concept within this component I hope that was helpful I realize if you not that fluent in programming in JavaScript Or in jQuery [00:19:41](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h19m41s) As well as in PHP This might not fully resolved your questions Like I said where the beginning of these tutorials I wasn't planning on making a component that is Very easy to use but rather a Component that is very powerful to use And leaving it up to you to decide how to implement This user integration Is really the most powerful way of doing it At least we are adding the the class with which you can create the user And again even there you can go look at that class [00:20:20](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m20s) If you feel my implementation is a little you know needs some Inprovement You can either shoot me a mail or you could Take For this component Builder on GitHub Pull down to your own repository Make the changes push it back And The place inside Of component builder where this class is constructed [00:20:47](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h20m47s) is obviously Within The compilers files. Now the compiler Has Has quite a few files and you need to do do a search So you basically go to component Builder go to helper and then Use the compiler And here is all its files So do a search in here [00:21:09](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m09s) For the function Create user you could you know just search for that and I'm sure you're fine it and it is in that area where you need to make the adaptation and the changes because it's dynamically added It is not it can't be edited like right in the script it needs to be edit in the function where we add it Just go search those functions [00:21:38](https://www.youtube.com/watch?v=ckFakaQ90JY&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h21m38s) Thank you for watching That's how you create users and connect them to your components Obviously there is much more to say but I'm afraid this will get way too long like most of my tutorials get to long I want to keep it this this way and trying to make it shorter hope you enjoyed that