Question October 15, 2020, 02:00:55 PM Hello everyone, I am new to PHPRAD, I would like to know if there is a way to prevent a new one from registering as administrator for an application.Thank you Quote Selected
Re: Question Reply #1 – October 15, 2020, 03:54:28 PM @Josito please add the following code to your registration page in Page Event -> Action Before AddCode: [Select]$modeldata['role'] = 'Enter the default role you want to assign to a registered user';and replace role with the name of your role field in the user table. After you generate your project, you can then locate this file app\views\partials\index\register.php and remove the field from it, that's all. Quote Selected
Re: Question Reply #2 – October 15, 2020, 07:27:23 PM Thank you for your answer, I am new and I confess that I did not understand your answer well. It is simply a small application to register the participants of a poultry show. There are already exhibitors, veterinarians of the judges and me as administrator and I would like to prevent a new participant from registering as administrator and having full rights also on the application. Is there a simple way to find a solution? Thanks again Quote Selected
Re: Question Reply #3 – October 16, 2020, 07:05:08 PM @Josito please provide your TeamViewer detail so that I can help you with that, its a simple solution. Quote Selected
Re: Question Reply #4 – October 17, 2020, 02:42:10 PM Hello willwin and thank you, studying your code I have the impression that the one who will register will have a default role and will not be able to register under anything other than the default role. I would like him to be able to choose between exhibitor, judge, vet ect but not administrator. I don't know if it will be possible. Thank you for your answers Quote Selected
Re: Question Reply #5 – October 18, 2020, 02:38:41 PM @Josito that is possible, the same code above should work with a little tweaking.please add the following code to your registration page in Page Event -> Action Before AddCode: [Select]if(strtolower($modeldata['role']) == 'administrator'){ $modeldata['role'] = 'Enter the default role you want to assign to a registered user'; // Or you can cancel the registration}and replace the role with the name of your role field in the user table. Quote Selected