Custom phpmyfaq 3.0.6

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
dmmario
Posts: 8
Joined: Thu Nov 12, 2020 4:37 pm

Custom phpmyfaq 3.0.6

Post by dmmario » Wed Dec 02, 2020 10:07 am

I need to pass a fixed pwd . In the old version I added this line of code but now with the new version it doesn't work, what can I do?
I am writing to you the addition I made at the time
thanks

?php

$controllo=$_GET['controllo'];


/**
* This is the main public frontend page of phpMyFAQ. It detects the browser's
* language, gets and sets all cookie, post and get informations and includes
* the templates we need and set all internal variables to the template
* variables. That's all.
*etc etc etc-.....


//
// Authenticate current user
//
if($controllo <> NULL)
{
//$faqusername =$_GET['name'];
//$faqpassword = $_GET['password'];
$faqusername =$_GET['user'];
$faqpassword = 'Privio200';//$_GET['password'];
}
else
{
$faqusername = PMF_Filter::filterInput(INPUT_POST, 'faqusername', FILTER_SANITIZE_STRING);
$faqpassword = PMF_Filter::filterInput(INPUT_POST, 'faqpassword', FILTER_SANITIZE_STRING);
}

//$faqusername = PMF_Filter::filterInput(INPUT_POST, 'faqusername', FILTER_SANITIZE_STRING);
//$faqpassword = PMF_Filter::filterInput(INPUT_POST, 'faqpassword', FILTER_SANITIZE_STRING);

etc etc etc ......

Thorsten
Posts: 15150
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Custom phpmyfaq 3.0.6

Post by Thorsten » Thu Dec 03, 2020 7:53 am

Hi,

which version did you use before? 2.9?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

dmmario
Posts: 8
Joined: Thu Nov 12, 2020 4:37 pm

Re: Custom phpmyfaq 3.0.6

Post by dmmario » Thu Dec 03, 2020 9:01 am

Hi Thorsten

Yes, the old version is 2.9
I'll explain better.
I upgraded to the new version 3.0.6 with php 7.3
We have an intranet in the office. The user logs in with his credentials and inside there is a "FAQ" link pointing to the server where phpmyfaq is installed. With the old version by inserting that code at the top the user found himself in phpmyfaq already logged in, without entering any credentials. With the new version this code does not work but I am still interested in this function.

Bye

Thorsten
Posts: 15150
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Custom phpmyfaq 3.0.6

Post by Thorsten » Thu Dec 03, 2020 5:34 pm

Hi,

can you please send me your patched version by email to thorsten AT phpmyfaq DOT de?

Thanks!

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

dmmario
Posts: 8
Joined: Thu Nov 12, 2020 4:37 pm

Re: Custom phpmyfaq 3.0.6

Post by dmmario » Thu Dec 03, 2020 6:54 pm

Hi, I just added those strings to the index.php file

Thorsten
Posts: 15150
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Custom phpmyfaq 3.0.6

Post by Thorsten » Fri Dec 04, 2020 7:28 am

Hi,

what value do you use for the URL parameter "controllo"? Just https://www.example.org/faq/index.php?controllo ?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist

dmmario
Posts: 8
Joined: Thu Nov 12, 2020 4:37 pm

Re: Custom phpmyfaq 3.0.6

Post by dmmario » Fri Dec 04, 2020 8:52 am

after checking the username of the person who has just logged into the intranet
I gave all users the same pwd which is Privio200 of the variable faqpassword


index.php?user=john.smith&controllo=a&m_cWindowName=main

dmmario
Posts: 8
Joined: Thu Nov 12, 2020 4:37 pm

Re: Custom phpmyfaq 3.0.6

Post by dmmario » Fri Dec 04, 2020 2:50 pm

Solved.

Thank you

Post Reply