Login Tools - Add New User?

Issues related to the Login tools of WYSIWYG Web Builder.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/login_basics.html
http://www.wysiwygwebbuilder.com/login_tools.html

TIP:
A lot of information about the login tools can be found in the help/manual.
Also checkout the demo template that is include with the software.
Post Reply
peters
 
 
Posts: 64
Joined: Thu Sep 28, 2023 12:29 pm

Login Tools - Add New User?

Post by peters »

I am brand new to using WYSIWYG Web Builder and just recently purchased it and I am running the most recent version.18.4.0
I have a development server running Windows Server 2022 and have installed mySQL Version 8.1 and installed PHP version 8.2.10 also the most recent version.
I believe all is installed correctly as I can bring up a phpinfo.php page to show all the settings.
I added a user in mySQL called appusers with a password.
I created a Users table as per the sql-script found in Login Tools
CREATE TABLE `USERS` (
`id` int(10) NOT NULL auto_increment,
`username` varchar(50) NOT NULL,
`fullname` varchar(75) NOT NULL,
`password` varchar(50) NOT NULL,
`email` varchar(75) NOT NULL,
`active` int(1) NOT NULL,
`code` varchar(75),
`role` varchar(50),
`avatar` varchar(50),
PRIMARY KEY (`id`));
All this worked so far.

I know my setting are all good for mySQL and PHP because I installed PHPmyAdmin console and I can login with my appusers account and add records into the Users table.

I have gone through the Login Tools now 4 times this week and still have the following issues . . .

1. When I try to add a new user in the full name input for the "Sign up for a new account" Login Tools form, if I enter in John Doe for the full name I get a message back: "Fullname is not valid, please check and try again!"
However, if I enter in JohnDoe with no spaces in the entry all works find and the record is added into the mySQL User table.
So my question is: If you enter in someone's full name should you not be able to enter it in with spaces for the full name?
If the Login Tools are setup to only allow a full name with no spaces, how do you allow spaces in the user's full name?


2. My second issue is if I am using the Login Tools "Log in" form and enter in an invalid user id or password I am redirecting to another webpage in my project that simply says "Invalid User or Password Entered" and on this page I have 2 buttons: One to Try Again and one to Cancel with links in them to return to the Log in form or simply return back to my Index.html page.
I see that regardless of the web form I try to call if the user enters in incorrect login credentials going to my page saying Login Failed with the Try Again or Cancel buttons, when clicked the Login Tools take me always to the "Create a new user" Login Tools page.
Is this they way things work in Login Tools?

Like I said I am very new to WYSIWYG Web Builder so sorry if my questions seem things I should know!

Thanks for your time in advance for anyone that can share some insight into the Login Tools questions I posted here.

Pete,
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Tools - Add New User?

Post by Pablo »

1. You can modify the input validation via the 'validation pattern' property. See also the information about this in the help.

2. It is difficult to say anything meaningful about this without seeing your exact settings. The software has thousands of options and millions of possible combinations.
If you need help the please share a DEMO project. See also the forum rules.
peters
 
 
Posts: 64
Joined: Thu Sep 28, 2023 12:29 pm

Re: Login Tools - Add New User?

Post by peters »

Thanks very much for your quick reply, really appreciated.
OK, I am reading through all the docs on this and I missed the part where you can copy the Login Tools form to a non-static html representation and then go ahead and make the changes you wish. I was looking for these things in the property page of the Login Tools static form and wondering how you drilled down into one textbox, or button, etc. Now I see you convert the Login Tools form into code and then modify the code.
Sorry . . . I'm just leaning and this is my second day using the software. I am a developer so coding at the code level is no problems for me.
I think by converting the form to code I can do with as I wish, this resolves both my questions asked in this thread.
Again, thanks so much for your time.
I am kind of amazed at what this software can actually do!

Pete,
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Tools - Add New User?

Post by Pablo »

You do not have to convert the forum to code.
You can change the "validation pattern" in the properties of the signup form.

For example, to allow spaces use:

Code: Select all

/^[A-Za-z0-9-_!@$ ]{1,50}$/
instead of

Code: Select all

/^[A-Za-z0-9-_!@$]{1,50}$/
peters
 
 
Posts: 64
Joined: Thu Sep 28, 2023 12:29 pm

Re: Login Tools - Add New User?

Post by peters »

Many thanks,

I actually now have done things both ways. I create a form and modify the code and that worked.
Then I went back to a stock Login Tools form the "Signup" one and put in your validation pattern and that also works.

The only issue I have now is I tried to lookup in Help anything about the validation patterns, and there were 4-5 examples on patterns that forced hardened passwords, but I could not find any information on what the various components in the pattern do??
I entered validation pattern in Help and it returned no help information on this topic.

/^[A-Za-z0-9-_!@$ ]{1,50}$/
I am looking at the pattern you posted above.
/^ is what the starting point of the pattern?
Inside the first set of [ ] I suspect these are ranges, so I am interpreting this to mean allow capital letters A to Z
and lower-case letters a to z
any number from 0 to 9
Allow the below listed characters:
dash -
underscore _
exclamations !
at signs @
dollar signs $
blank space and then close this with the ending ]

The second set of numbers inside the { } I am guessing means:
can accept characters 1 to 50
So blank would error out and a string > that 50 would error out.
and is $/ what ends the validation pattern string?

Is this correct and where do I find detailed information on this string pattern?

Pete,
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Tools - Add New User?

Post by Pablo »

First note that this is not specific to WYSIWYG Web Builder. This is standard regular expression functionality of PHP.
Unfortunately, I cannot teach how to write your own regular expressions. The reason why this option was added it to give you more control over the generated code.
But there are many websites about this topic. For example: https://www.w3schools.com/php/php_regex.asp
peters
 
 
Posts: 64
Joined: Thu Sep 28, 2023 12:29 pm

Re: Login Tools - Add New User?

Post by peters »

Got it!

Like I mentioned I am new to Web Builder, so I was looking through the Web Builder Help to find out the pattern string format explanations.
This is my first-time using PHP for scripting, as I have been for the past 15 years using only JavaScript.
I was not aware that the validation pattern was a PHP standard. Now I know that, so much appreciated.

This is a resource you may wish to look at . . .
https://codepal.ai/regex-generator
It is a web-based AI pattern generator for creating Regex string patterns.
It is free and seems to work very well.
I entered in Email and the AI returned: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
I entered in US phone number and the AI returned: ^(\+\d{1,2}\s?)?(\()?(\d{3})(?(2)\))[-.\s]?(\d{3})[-.\s]?(\d{4})$
Have not tested the patterns yet!

ps... The emailer system in Web Builder sure saves a lot of time in generating event specific emails. Really like it!

Pete,
egonolsen30
 
 
Posts: 9
Joined: Tue Nov 14, 2023 8:27 am

Re: Login Tools - Add New User?

Post by egonolsen30 »

Hi all,

when setting up the sign up form there is indeed a validation pattern. But that is only for the email and username if i understood correctly.
Anyhow. To allow ü, ö, ä in Names, which is quite common in some countries, the pattern in the php file,

Code: Select all

    } elseif (!preg_match("/^[A-Za-z0-9-_!@$.' &]{1,50}$/", $newfullname)) {
        $error_message = 'Vor oder Nachname enthält ungültge Zeichen';
has to be changed to:

Code: Select all

    } elseif (!preg_match("/^[A-Za-z0-9-_!@$.' &üöä]{1,50}$/", $newfullname)) {
        $error_message = 'Vor oder Nachname enthält ungültge Zeichen';
Then also People with üöä in their names can register. Or is there a better solution? Since there is no coming back to wwb after amending the php.

Regards
Egon
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Tools - Add New User?

Post by Pablo »

You can set the validation pattern via the "validation pattern" property, there is no need to edit the code manually.
Also, if you really want to edit the PHP manually, then you can convert the signup form to a standard form. Then you can edit the PHP code via the HTML object.
egonolsen30
 
 
Posts: 9
Joined: Tue Nov 14, 2023 8:27 am

Re: Login Tools - Add New User?

Post by egonolsen30 »

yes but the field validation pattern in the sign up form tool changes only the pattern for the user name. The pattern for the fullname field stays unchanged in the generated php:

if (!preg_match("/^[A-Za-z0-9-_!@$.' &]{1,50}$/", $newfullname))
{
$error_message = 'Fullname is not valid, please check and try again!';
}
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Tools - Add New User?

Post by Pablo »

The pattern also changes the full name validation.
Are you using the latest version?
egonolsen30
 
 
Posts: 9
Joined: Tue Nov 14, 2023 8:27 am

Re: Login Tools - Add New User?

Post by egonolsen30 »

sure. I only now tryed out. I changed the validation pattern in wwb and then opened the created php file. There the validation pattern for the fullname field is unchanged.
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Tools - Add New User?

Post by Pablo »

You do not have to edit the PHP file!

Are you using the latest version?

Do you have a DEMO project?
egonolsen30
 
 
Posts: 9
Joined: Tue Nov 14, 2023 8:27 am

Re: Login Tools - Add New User?

Post by egonolsen30 »

demo would be easy to set up. If you place the sign-up form on a site, change the validation pattern and the publish. Try to put in a name in fullname field with ü, ö or ä (which were included in the pattern earlier), then you see it trows an error.
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Tools - Add New User?

Post by Pablo »

It works for me.

Are you using the latest version?
egonolsen30
 
 
Posts: 9
Joined: Tue Nov 14, 2023 8:27 am

Re: Login Tools - Add New User?

Post by egonolsen30 »

18.0.1
i bought it this week
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login Tools - Add New User?

Post by Pablo »

The current version is 18.4.2

You can download the update here:
https://www.wysiwygwebbuilder.com/download.html
Post Reply