Change your password tool

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
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

There is only the change password tool that does not accept my database when I want to edit it.
If you are not an advised user then I strongly recommend to put all pages in the same folder and use the same settings (= same database) for all pages.
At least until you have everything wrong.
Do I have to create a file with the same name as my database in the folder where I want to put the tool change password?
No, there should only be one database.
I don't know where to look for it. Please, understand that I don't know anything about programming
Menu -> Page -> Page HTML.
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

I put all the pages in one folder, the "members" folder. Then I created a page where I put the tool "change password" with the same database. I tried to edit the database, but I still have the same error. I put a tool at random, and I manage to edit the database without problem. So there is only this "password tool" that doesn't work. Is not this another problem? Is not it because I'm using a flat file database?
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

How are you trying to edit the database?
Are you sure the settings are the same as for the other tools?
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

I do not touch any settings. I just take the tools as it is given in the software and I just replace the name of the database by the name of mine. For all tools, I can edit my database locally, except for the "change your password's tool". This is where I do not understand, even when I create a page at the root of the site and I put the tool on this page.
I am editing the database by clicking on the "edit database" button of each tool.
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

But, why are you trying to edit the database specially here?
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Because it's one of two ways I know. Editing it locally and then updating in the server, seems easier than logging in every time in the online admin session. If there is a better method, tell me.
Yhank you
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

But why in the 'password recovery' tool?

Isn't is more locally to do it in the Admin tool?
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Ok, I understood for more security. I will do it now through the admin tool. Thanks.

However my problem is still not fixed because this "change your password" tool does not work, no matter where I put the page, while all other tools work without problem. So I still do not know how to give my friends the ability to change their passwords if they wish. Pity
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

Are there any errors when you call the page?
What are your settings?
What is the generated PHP code?
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Pablo wrote: Mon Jul 23, 2018 9:40 am Are there any errors when you call the page?
What are your settings?
What is the generated PHP code?
Hello Pablo,
I was very busy these last months ... My apologies... I come back to this problem of changing password in the member area.
Nothing has been changed in the original tool. I just put the flatfile database
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

Are there any errors when you call the page?
What are your settings?
What is the generated PHP code?
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Hi Pablo,

- Are there any errors when you call the page? NO, i have checked
- What are your settings? I did not put any personal settings. I just took the program tool and just replaced the database with the site database, then I tried to edit the database to see if it works, it's where I have the following message: "the database is not found on the server!
- What is the generated PHP code? I do not understand because the page is in php, but the code of the tool is in html. Should I give the code of the page once the tool "change password" placed in?
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

I have the following message: "the database is not found on the server!
This indicates that the file is not in the excepted location.
Please make sure the database is in the right folder.
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

The problem is that the database works very well with all other tools except that of "change password", so it's not a problem of location. This is what I do not understand.
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

Maybe the "change password" page is in another folder?
What is the PHP code of the page?
What is the location of the page?
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Pablo wrote: Fri Mar 29, 2019 4:44 pm Maybe the "change password" page is in another folder?
Yes, it's in another folder, but when I put any other tool in the same folder on the page of this member, it works without problems with the same database
Pablo wrote: Fri Mar 29, 2019 4:44 pm What is the PHP code of the page?
<?php
if (session_id() == "")
{
session_start();
}
if (session_id() == "")
{
session_start();
}
if (!isset($_SESSION['username']))
{
header('Location: ./../../pages/pageno.php');
exit;
}
if (isset($_SESSION['expires_by']))
{
$expires_by = intval($_SESSION['expires_by']);
if (time() < $expires_by)
{
$_SESSION['expires_by'] = time() + intval($_SESSION['expires_timeout']);
}
else
{
unset($_SESSION['username']);
unset($_SESSION['expires_by']);
unset($_SESSION['expires_timeout']);
header('Location: ./../../pages/pageno.php');
exit;
}
}
$users = array("kether");
if (!in_array($_SESSION['username'], $users))
{
header('Location: ./../../pages/pageno.php');
exit;
}
if (session_id() == "")
{
session_start();
}
$error_message = "";
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['form_name']) && $_POST['form_name'] == 'changepassword')
{
$database = 'osaok.php';
$success_page = '';
if (!isset($_SESSION['username']))
{
$error_message = 'Not logged in!';
}
else
if (filesize($database) == 0)
{
$error_message = 'User database not found!';
}
else
{
$password_value = md5($_POST['password']);
$newpassword = md5($_POST['newpassword']);
$confirmpassword = md5($_POST['confirmpassword']);
$username_value = $_SESSION['username'];
if ($newpassword != $confirmpassword)
{
$error_message = 'The confirm new password must match the new password entry';
}
else
if (!preg_match("/^[A-Za-z0-9_!@$]{1,50}$/", $newpassword))
{
$error_message = 'New password is not valid, please check and try again!';
}
else
{
$items = file($database, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach($items as $line)
{
list($username, $password) = explode('|', trim($line));
if ($username_value == $username)
{
if ($password_value != $password)
{
$error_message = 'Old password is not valid!';
break;
}
}
}
if (empty($error_message))
{
$file = fopen($database, 'w');
foreach($items as $line)
{
$values = explode('|', trim($line));
if ($username_value == $values[0])
{
$values[1] = $newpassword;
$line = '';
for ($i=0; $i < count($values); $i++)
{
if ($i != 0)
$line .= '|';
$line .= $values[$i];
}
}
fwrite($file, $line);
fwrite($file, "\r\n");
}
fclose($file);
header('Location: '.$success_page);
exit;
}
}
}
}
?>
Pablo wrote: Fri Mar 29, 2019 4:44 pm What is the location of the page?
http://www.orsaf.be/membres/115/pages/compte.php

Thanks a lot for your help
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

The database is configured as:
'osaok.php'

This means that it should be is the same folder as the page.

Your page is here:
http://www.orsaf.be/membres/115/pages/compte.php

So, the database should be here:
http://www.orsaf.be/membres/115/pages/osaok.php

According to the server, the file does not exists in this folder.
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Pablo wrote: Fri Mar 29, 2019 5:31 pm So, the database should be here:
http://www.orsaf.be/membres/115/pages/osaok.php

According to the server, the file does not exists in this folder.
This is a member area where each member has their own pages and redirects. When I put any tool (login, password, registration, etc.) on this page of this member, everything works perfectly when I edit the database. There is only this tool "change password" that gives the error message that the database was not found on the server, etc. I put the database where you indicated, but I still have the same error message when i edit the database
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

The page seems to be referring to itself. This is not correct, the browser will go into an endless loop.

Code: Select all

header('Location: ./../../pages/pageno.php');
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Pablo wrote: Fri Mar 29, 2019 9:36 pm The page seems to be referring to itself. This is not correct, the browser will go into an endless loop.

Code: Select all

header('Location: ./../../pages/pageno.php');
This page is not a problem. This is a personalized redirect page. All members have that. The problem is really only with this tool "change password". I can take a blank page and I put all the tools, and they work without any problem with the database, except the tool "change the password". I can edit the database locally with all the tools except with the "change password".
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

I'm sorry, but there must be an error in the logic of the page.

Firstly, it looks like you have added a 'protected page' object., so this mean that the page cannot be reached until you login.
If the user is not logged, he will be redirect to
./../../pages/pageno.php -> http://www.orsaf.be/membres/pageno.php
This page does not seem to exist.

I really think you should simplify your folder structure and make sure all files are in the correct folders.
Based on the HTML code I currently do not see any logic in it.
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Pablo wrote: Sat Mar 30, 2019 11:44 am I'm sorry, but there must be an error in the logic of the page.

Firstly, it looks like you have added a 'protected page' object., so this mean that the page cannot be reached until you login.
I think if there was an error on the page, all the tools would not work. But all work except "change the password". Actually, the member must be connected. My problem is not there! Sideways, everything is working properly
Pablo wrote: Sat Mar 30, 2019 11:44 am If the user is not logged, he will be redirect to
./../../pages/pageno.php -> http://www.orsaf.be/membres/pageno.php
This page does not seem to exist.
Actually! The member will be redirect to this page "pageno.php", and this page exists. it's a redirect page in which each member is redirected to his own page. Everything works perfectly.
Pablo wrote: Sat Mar 30, 2019 11:44 am I really think you should simplify your folder structure and make sure all files are in the correct folders.
Based on the HTML code I currently do not see any logic in it.
OK but i think I do not get it right: my database is "osaok.php" (flat file). When I create, for example, a new blank page and I put all tools (login, forgotten password, register, edit the profile and change the password), ALL tools work without problem with the database, except the tool "change password". When I say that all tools work well, it means that I can edit the database locally from all the tools. When I am logged in and want to change my password through the "change password" tool, which is on my "account.php" page, I am redirected to the landing page, but the word page is not changed!
Even when I create a blank page at the root of the site, and for which I have not made any configuration, this tool still does not work and I have the same error message, while all others work. With all other tools I can edit the database without problems, except with this one ...
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

ALL tools work without problem with the database, except the tool "change password".
Maybe this tools has different settings?

Note that all login tools must be on a separate page.
From the help:
It is strongly advised to use only one form per page to prevent conflicts between the scripts.

Also note that I cannot exactly see what you have done based on the code only.
To be able to say anything meaningful about this, I need the project file.
See also: viewtopic.php?f=10&t=82134
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Hi,
Here is the link of my .wbs project.
http://www.orsaf.be/test-pablo/test-pablo.wbs

I put 3 different tools: login, change the password and recover the password. In the 3 tools, there is the same database "test.php", which is in flat file. When I edit the database with the tools "connect" and "recover password", it works without any problem. But when I want to edit the database with the tool "change password", I have an error message. I did not put any personal configuration. I just created my database.
What I want, is that each member can change his password from his space that will contain the tool "change the password".
Thanks for the help
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

I'm sorry, but the implementation is not correct. Each form should be on a different page.
Also, note that you are using an older version. The login tools have many improvement in recent versions.
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Pablo wrote: Sun Mar 31, 2019 1:46 pm I'm sorry, but the implementation is not correct. Each form should be on a different page.
Also, note that you are using an older version. The login tools have many improvement in recent versions.
OK pablo, I will update to migrate to version 14 in April. But if it was a question of updating the tool or the program, should not the other tools have the same problem?
I put the tool in a single page, the "test" page, but the problem persists. Is it still an implementation problem?
If you could check the 3 tools that I put on the same page, by editing the database, you would have found that, only with the tool "change the password", we can not edit the database.
Here is the new link for the .wbs project. Can you, please, verify it?
http://www.orsaf.be/test-pablo/test-pablo.wbs
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

Here is the image of the message error
Image
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

But if it was a question of updating the tool or the program, should not the other tools have the same problem?
There have been many changes/fixes since version 12.0.0, so the issue may have been addressed in one of these updates.
Please install the latest version first, to make sure this has not already been fixed.
Here is the new link for the .wbs project. Can you, please, verify it?
http://www.orsaf.be/test-pablo/test-pablo.wbs
It works for me, after putting 'test.php' on the server.
Tested with version 14.3.3
kether
 
 
Posts: 28
Joined: Sun Oct 22, 2017 11:34 am

Re: Change your password tool

Post by kether »

OK. I'm going to update to the version 14 this week. Thank you very much for your help and your availability. How to put the subject "resolved"?
User avatar
Pablo
 
Posts: 21508
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Change your password tool

Post by Pablo »

Did you try if it works for you in WB14?
User avatar
BaconFries
 
 
Posts: 5316
Joined: Thu Aug 16, 2007 7:32 pm

Re: Change your password tool

Post by BaconFries »

Before being marked as resolved have you tried with WWB 14?
Post Reply