Login tool USERS LOG

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
User avatar
wwonderfull
 
 
Posts: 1584
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Login tool USERS LOG

Post by wwonderfull »

@pablo
Image
the tool "Login" has an option on the section Logging named Mysql Table Name just like the database information has. But this one has the value USERS_LOG. It is clearly written that it wants the table name. Should it be the exact same table name which the signup information table has or would it be something separate?

And what is the use of it and what does it do. Nothing much in detail I found about this option if you could elaborate kindly.
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

The log is a different table, it should not have the same as the users table.
User avatar
wwonderfull
 
 
Posts: 1584
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Login tool USERS LOG

Post by wwonderfull »

Pablo wrote: Mon Aug 14, 2023 4:50 pm The log is a different table, it should not have the same as the users table.
Does that mean I need to create another table in the database for it?
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

Correct, because you cannot have different a record format in the same table.
User avatar
wwonderfull
 
 
Posts: 1584
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Login tool USERS LOG

Post by wwonderfull »

Amazing set of tools @pablo. One of the best creative part which I like is the Convert to Form feature. Editing the php along with wwb's input elements and styling and stuffs are just perfect. Best of both worlds for basic and advanced users.

Thanks for guiding :)
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

Good day.
Please tell me what columns the user log table "USERS_LOG" should have.
Thank you in advance
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

This is documented in the help (F1).
Login Tools -> Login -> Logging
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

Good afternoon Pablo.
What should be done so that the administration section starts accepting data entered in Cyrillic.
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

mysql INNO DB does not offer pure "utf8", those options are without Cyrillic
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

The Login admin is Unicode compatible by default.
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

Is it possible to log user termination? Perhaps it is displayed somewhere, and it is possible to receive this information in the database
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

to make it more clear what I need, I will explain.
We need dynamic information about who is online right now on the site.
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

No, the logout cannot be logged.
The main reason for this is because there is no reliable way to undermine when the user is logged out.
For example, the user can close the browser or the session can expire. There is no way detect this on the server side.
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

thanks, I'll try to chat with the server staff
User avatar
BaconFries
 
 
Posts: 5932
Joined: Thu Aug 16, 2007 7:32 pm

Re: Login tool USERS LOG

Post by BaconFries »

We need dynamic information about who is online right now on the site.
See the following url look for extensions by SUB. Note they may or may not still good to use for all help with the pist at the extension post/thread.
viewtopic.php?t=19209
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

Pablo wrote: Tue Aug 29, 2023 11:11 am The Login admin is Unicode compatible by default.
Good day Pablo.
I have been dealing with registration for a few days, and this is what I came to the conclusion.
The generated page for user registration has UTF-8 encoding and no UTF8_unicode, so it cannot work with Cyrillic!!!
What can be done to use Cyrillic???
Database and tables support UTF8_unicode_ci.
This really needs to be fixed somehow.
Maybe you can send what can be added to the html code of the page to fix it

https://xn--80a7ah.xn--j1amh/pomilka_avtorizatsii.php
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

Pablo wrote: Tue Aug 29, 2023 11:11 am The Login admin is Unicode compatible by default.
Good day.
The page generated by the program has only UTF8 encoding, and there is no UTF8_unicode
https://xn--80a7ah.xn--j1amh/pomilka_avtorizatsii.php
Because of this, no form works normally with Cyrillic, and mysql Connector, when the page tries to transfer data to the server, a coding conflict occurs.
Alternatively, you can send a corrected file that can be replaced in the installation and the page will already be generated with UTF8_unicode, or send what to add to the html on the page to correct this.
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

I think there is a misunderstand: UTF8 = unicode. There is no character set 'utf8_unicode.' for forms.
https://www.w3schools.com/tags/att_form ... harset.asp
So, the form code is correct.

Also, I am sure Cyrillic is supported because it used by many other users.
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

Pablo wrote: Wed Aug 30, 2023 2:13 pm I think there is a misunderstand: UTF8 = Unicode. There is no character set 'utf8_unicode.' for forms.
https://www.w3schools.com/tags/att_form ... harset.asp
So, the form code is correct.

Also, I am sure Cyrillic is supported because it used by many other users.
Everything is fine with the browser, but I was talking about the database server, which is strictly related to this, possibly for security reasons.
I draw your attention to the fact that the issue is mutual understanding between the database server and the registration form.
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

I was not able to find any information that makes this statement valid:
The generated page for user registration has UTF-8 encoding and no UTF8_unicode, so it cannot work with Cyrillic!!!
Also, the PHP code is enabling Unicode support for mysql statements.
I draw your attention to the fact that the issue is mutual understanding between the database server and the registration form.
What do you mean by this?

If you need further assistance then please describe what the exact problem is with Cyrillic. Is there an error?
How is the mysql connector related to the USER LOG and Login Admin?
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

Many varieties of UTF8 are used on servers - that's how they look there, not UTF-8.
The fact is that when you form a database and tables in them, it is not possible to specify exactly UTF-8, there it is possible to select a large number of UTF8 serels from the drop-down lists_........_.......
and among them UTF8_unicode_ci is not simply UTF8 or UTF8_unicode.
Perhaps because of this, a data transfer conflict occurs.
When setting up the database and tables under UTF8_unicode_ci, they probably do not want to accept a request in which UTF-8 is written
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

I think you are mixing up HTML with MySQL encoding.
For HTML forms the character set is 'utf-8', there is no 'UTF8_unicode' for HTML forms!

If you think the problem is related to the database then you will have to change it in the databases configuration (on the server side).

But again: what is the exact problem? Is there an error?
How is this related to USERS LOG and the MySQL connector?
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

Good morning Pablo.
The whole paradox of the situation is that when you correct the data through the Administrator form or add new ones, everything works very well, and only when you need to send the user registration form to the user, the Cyrillic alphabet is not perceived for some reason.
Everything you answer to me is good and true, but it does not solve the problem.
In my opinion, when a request to change data is made from the administrator's form, it is connected to the database and only then everything works on a working connection.
When the user registration form is filled out, it is not yet connected to the database and the connection starts after clicking the button. At this moment, the database does not understand the coding sent to it and refuses to accept it. For what specific reason, I may be wrong, but it is most likely a different reading of the mysql and html code, as you correctly wrote that they are different.
Do the experiment yourself and make sure that the problem exists. It won't take much time. only experiment on real hosting, and not on a server on the same computer.
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

In my opinion, when a request to change data is made from the administrator's form, it is connected to the database and only then everything works on a working connection.
So, the Login admin works? Then what is the problem exactly?
When the user registration form is filled out, it is not yet connected to the database and the connection starts after clicking the button.
Isn't that how all HTML forms work? HTML is stateless, there is no continue connection with the database.
At this moment, the database does not understand the coding sent to it and refuses to accept it.
Where does it stop working?
What is the error message?
How is the MySQL connector related to this?
Do the experiment yourself and make sure that the problem exists.
I have extensively tested this for many years. on my different serves with help of other users. If I was aware of any issues then I would have already fixed it (as I do with all repored issues).
If you want me to solve this, then you will first have to explain to me what does not work.
Until now you only wrote that it does not work, but you did not describe what it is that does not work.

Can you please answer all my questions?
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

I explain what is not working.
When the user name and full name fields are filled in the user registration form, this information is not saved in the table, and when these fields are filled in Latin, everything is saved.
I use google translate, so you may not understand my problem. I'm sorry this annoys you.
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

Are you referring to the sign up form?

In that case, for security reason by default the user name can only be ASCII.
The "Validation Pattern" property specifies a regular expression (https://regexr.com/) to validate the username.
This may be useful if you want to support non-ASCII usernames.
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

The object is the user registration form and the Full name field in it.
I remind you that it does not allow the user to enter Cyrillic data in the Full name field.
I will be very grateful if you can provide me with step-by-step instructions on how to make it possible for the user to fill in the Cyrillic Full name field in the registration form
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

I will be very grateful if you can provide me with step-by-step instructions on how to make it possible for the user to fill in the Cyrillic Full name field in the registration form
By default, the input validation only allows ASCII for security reasons. Thus prevents malicious code from being inserted.
Regular expression:

Code: Select all

 /^[A-Za-z0-9-_!@$]{1,50}$/
If you want to accept different characters then you will have to update the "validation pattern" property
Note that this is not specific to WWB.
But you can create your own regular expressions on this website:
https://regexr.com/

Or else:
https://www.google.com/search?q=preg_ma ... characters
User avatar
BaconFries
 
 
Posts: 5932
Joined: Thu Aug 16, 2007 7:32 pm

Re: Login tool USERS LOG

Post by BaconFries »

First of all Pablo has always tried to assist/help you so please be thankful of that. When using Google to translate words get lost in translation this is not his fault but that of the translation.

I have been following this and have to agree with him that he is only trying to do his best. When you ask for help it is always best to provide as much information as possible so that help is given to you from him or other user(s).

To carry on from his reply regarding validation and regexr ( regular expressions) use see the following url that you can try to use. Note both links are for information only and I cannot guarantee they will work for you.
How to use regex in html5 attribute for Cyrillic letters?
See also
Only Cyrillic input text form
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

Good day.
something incomprehensible began to happen with the form - Sign up for a new account.
Adding a new user for some reason happens with ID=0, and the next user is no longer registered because an error occurs when trying to duplicate an ID.
I understand that I did something in the settings, and that I don't understand.
Please help to understand.
Oleksandr
 
 
Posts: 156
Joined: Fri Aug 11, 2023 10:03 am

Re: Login tool USERS LOG

Post by Oleksandr »

Sorry to bother you, found a mistake
Azz
 
 
Posts: 8
Joined: Sat Jan 04, 2025 1:17 am

Re: Login tool USERS LOG

Post by Azz »

Hola, feliz año nuevo, Pablo!

Llei la documentacion, pero sigo sin poder resolver mi pequeño problema con el USERS_LOG.
Todo me funciona perfectamente, con el (utf8_ unicode_ci) al registrar un usuario nuevo, i las demas funciones de Login Tools menos el Users Log.

Pues se trata de que simplemente no hace nada. No añade ninguna informacion al USERS_LOG (En mi caso es USERSLOG sin la barra vaja_)
Pero todo lo demas funciona correctamente, USERS, CMS_, etc. Ya lo comprobe.

Aqui añado las fotos donde se puede ver que "cyrillic" funciona en USERS, se añaden usuarios nuevos, pero USERSLOG sigue vacio, por esta razon creo que no tiene nada que ver con el UTF8_UNICODE_CI :

Image

Image

Image

Image

Image

Image

Tambien por si a caso lo converti en FORM para ver el HTML, quizas asi se podra localizar la razon de todo esto:

Code: Select all

<?php
$PHPSESSION$if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['form_name']) && $_POST['form_name'] == 'loginform')
{
   $success_page = './main.php';
   $error_page = './err.html';
   $mysql_server = 'localhost';
   $mysql_username = 'root';
   $mysql_password = '';
   $mysql_database = 'radarza';
   $mysql_table = 'USERS';
   $crypt_pass = md5($_POST['password']);
   $found = false;
   $db_email = '';
   $db_fullname = '';
   $db_username = '';
   $db_role = '';
   $db_avatar = '';
   $session_timeout = 600;
   $log_date = date("Y-m-d");
   $log_time = date("G:i:s");
   $log_ip_address = $_SERVER['REMOTE_ADDR'];
   $log_user_agent = str_replace(',', ';', $_SERVER['HTTP_USER_AGENT']);
   $log_referrer = (isset($_SESSION['referrer']) ? $_SESSION['referrer'] : $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']);
   $db = mysqli_connect($mysql_server, $mysql_username, $mysql_password);
   if (!$db)
   {
      die('Failed to connect to database server!<br>'.mysqli_error($db));
   }
   mysqli_select_db($db, $mysql_database) or die('Failed to select database<br>'.mysqli_error($db));
   mysqli_set_charset($db, 'utf8');
   $sql = "SELECT * FROM ".$mysql_table." WHERE username = '".mysqli_real_escape_string($db, $_POST['username'])."'";
   $result = mysqli_query($db, $sql);
   if ($data = mysqli_fetch_array($result))
   {
      if ($crypt_pass == $data['password'] && $data['active'] != 0)
      {
         $found = true;
         $db_email = $data['email'];
         $db_fullname = $data['fullname'];
         $db_username = $data['username'];
         $db_role = $data['role'];
         $folder = substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/') + 1);
         $db_avatar = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$folder" . "avatars/" . $data['avatar'];
         $sql = "INSERT USERSLOG (`username`,`date`,`time`,`ip_address`,`user_agent`,`referrer`,`status`) VALUES ('$db_username','$log_date','$log_time','$log_ip_address','$log_user_agent','$log_referrer', 'SUCCESS')";
         mysqli_query($db, $sql);
      }
      else
      {
         $username = mysqli_real_escape_string($db, $_POST['username']);
         $sql = "INSERT USERSLOG (`username`,`date`,`time`,`ip_address`,`user_agent`,`referrer`,`status`) VALUES ('$username','$log_date','$log_time','$log_ip_address','$log_user_agent','$log_referrer', 'FAILED')";
         mysqli_query($db, $sql);
      }
   }
   mysqli_close($db);
   if ($found == false)
   {
      header('Location: '.$error_page);
      exit;
   }
   else
   {
      $_SESSION['email'] = $db_email;
      $_SESSION['fullname'] = $db_fullname;
      $_SESSION['username'] = $db_username;
      $_SESSION['role'] = $db_role;
      $_SESSION['avatar'] = $db_avatar;
      $_SESSION['expires_by'] = time() + $session_timeout;
      $_SESSION['expires_timeout'] = $session_timeout;
      $rememberme = isset($_POST['rememberme']) ? true : false;
      if ($rememberme)
      {
         setcookie('username', $db_username, time() + 3600*24*30);
         setcookie('password', $_POST['password'], time() + 3600*24*30);
      }
      header('Location: '.$success_page);
      exit;
   }
}
$username = isset($_COOKIE['username']) ? $_COOKIE['username'] : '';
$password = isset($_COOKIE['password']) ? $_COOKIE['password'] : '';
?>
Que se puede hacer para que USERSLOG funcione?
Muchas gracias!
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

Are there any errors in the server PHP log?
Azz
 
 
Posts: 8
Joined: Sat Jan 04, 2025 1:17 am

Re: Login tool USERS LOG

Post by Azz »

Todays error log:
2025/01/04 17:10:04 [notice] 13680#13300: signal process started
2025/01/04 17:10:35 [error] 3668#684: *7 CreateFile() "C:\Winginx/home/azradarza/public_html/favicon.ico" failed (2: The system cannot find the file specified), client: 127.0.0.1, server: azradarza, request: "GET /favicon.ico HTTP/1.1", host: "azradarza", referrer: "http://azradarza/"
2025/01/04 17:10:41 [error] 3668#684: *7 "C:\Winginx/home/azradarza/public_html/avatars/index.php" is not found (3: The system cannot find the path specified), client: 127.0.0.1, server: azradarza, request: "GET /avatars/ HTTP/1.1", host: "azradarza", referrer: "http://azradarza/main.php"
2025/01/04 17:10:56 [error] 3668#684: *12 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /index.php?db=radarza&table=USERSLOG&target=sql.php HTTP/1.1", upstream: "fastcgi://[::1]:9071", host: "localhost:81"
2025/01/04 17:12:07 [error] 3668#684: *7 FastCGI sent in stderr: "PHP Warning: mail(): Failed to connect to mailserver at &quot;localhost&quot; port 25, verify your &quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set() in C:\Winginx\home\azradarza\public_html\signup.php on line 161" while reading response header from upstream, client: 127.0.0.1, server: azradarza, request: "POST /signup.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9071", host: "azradarza", referrer: "http://azradarza/signup.php"
2025/01/04 17:12:14 [error] 3668#684: *7 "C:\Winginx/home/azradarza/public_html/avatars/index.php" is not found (3: The system cannot find the path specified), client: 127.0.0.1, server: azradarza, request: "GET /avatars/ HTTP/1.1", host: "azradarza", referrer: "http://azradarza/main.php"
2025/01/04 17:12:23 [error] 3668#684: *7 "C:\Winginx/home/azradarza/public_html/avatars/index.php" is not found (3: The system cannot find the path specified), client: 127.0.0.1, server: azradarza, request: "GET /avatars/ HTTP/1.1", host: "azradarza", referrer: "http://azradarza/editacc.php"
2025/01/04 17:12:40 [error] 3668#684: *34 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /index.php?ajax_request=1&recent_table=1&no_debug=true&_nocache=1735999959175523572 HTTP/1.1", upstream: "fastcgi://[::1]:9071", host: "localhost:81"
User avatar
Pablo
 
Posts: 23435
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Login tool USERS LOG

Post by Pablo »

I do not think this is the correct log. You will need the PHP error log.
Azz
 
 
Posts: 8
Joined: Sat Jan 04, 2025 1:17 am

Re: Login tool USERS LOG

Post by Azz »

Hello, finally I solved this problem, just changing localhost program, for other. Now MySQL logging users works perfect! Thank you for attention :)
Post Reply