PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 2024 → In reference to this
In reference to this
Started by Carlos, Oct., 20 2021 5:20 PM - 4 replies
Registered member
37 messages
Posted on October, 20 2021 - 5:20 PM
Good morning

And thank you for your help in advance.

In reference to this

//if ExtractString(SysEnvironment("85658"),2,"=") <> "443" then
// ScriptDisplay(PageAddress("",paSECURE))
//end


I finished my WebDev Application successfully installed in my webdev application server under my
Microsoft SQL 2016 Database, which is installed also under a Windows Server 2016.

So, I use:
A WebDev Application developed with WebDev 24
A Windows WebDev Application Server Version 24
A Microsoft Windows SQL Database 2016
A Microsoft Windows 2016 Server

The above line of codes mainly function as far I am concerned is to activate the SSL functionality to the application,
that is when the user types www.Yourwebsite.com instead of showing HTTP: it converts it into a secure connection HTTPS:

So in my windows 2016 server, the SSL Certificate was installed properly and also functioning properly.

Now
These are the problems I am having with the above reference Lines of codes

First, if I make those lines active in my Initialization code of the first page of the Application, I need to deactivate it
every time I need to run a test in my Development machine IDE, if I don't do that, the application will not run, it will open the browser and close it again returning back to the IDE.
I have no idea how to go around it unless I deactivate these lines.

Maybe putting some if statement codes or something would do the trick, I would appreciate it if someone has a workaround on this that could share with me.

Second, If I don't activate these lines of code and install it on my server and run the application from anywhere in the world, the application runs just fine from the beginning to the end BUT, the SSL functionality will not kick in.

Third and final, If I do activate the above line of code, then install it on my server and run it from anywhere in the world, the application runs just fine too, the above code kicks in SSL functionality kicks in, I get the HTTPS activated, the user navigates, operates well, add records, saves and updates records, delete records and do much more, BUT, when it clicks on the logoff button the application closes fine, it goes to the initial Login page BUT, this nasty Browser Message comes out












This message only appears if the above code is activated.
This message is telling me that apparently the Back Button of the browser is being pressed but there is a workaround about it and that is, to go to the description of my page, and under the GUI Tab, select the "Allowed (Runs the synchronization code)

Well I have done that
I went, select Allowed, validate the changes

Then went to the synchronization code of my page, and there I have put diferent things that according to the help guide is the right thing to put but it does not work such as:

PageRefresh(PAGE_Supervisor)
ChangeAction(caNone)


Or

PageRefresh(PAGE_Supervisor)
ChangeAction(caContinue)



BUT, none of this works

can anyone tell me if they have run with the same problem, and if you do and have a workaround to it can you please share it with me and with the rest of us.

Greatly appreciate it.

Thank you

Best regards,
Carlos

--
Best regards,

Carlos
Posted on October, 22 2021 - 6:58 PM
For the first part you can use something like:

if ExtractString(SysEnvironment("85658"),2,"=") <> "443" _AND not intestmode() then
ScriptDisplay(PageAddress("",paSECURE))
end
Registered member
37 messages
Posted on October, 23 2021 - 9:48 PM
Paulo Oliveira wrote:
For the first part you can use something like:

if ExtractString(SysEnvironment("85658"),2,"=") <> "443" _AND not intestmode() then
ScriptDisplay(PageAddress("",paSECURE))
end


Paulo!!

Thank you so much for your response and help. I will try it and come back to you

Thank you again

Best regards,

Carlos

--
Best regards,

Carlos
Registered member
37 messages
Posted on October, 24 2021 - 12:11 AM
Hi Paulino,

Yes, that part works. I hope that someone can help me out on the other part which is the one creating the message.

Thanks again
Best regards,

Carlos

--
Best regards,

Carlos
Registered member
37 messages
Posted on October, 26 2021 - 6:07 PM
Hi Paulino

And thank you again for your help

I was able to get a workaround for my problem, and hope it helps others if the same problem arises for them
I guess is not the best solution but it works and it works flawlessly.

This is what I did
1. I created two global variables string types in my project code, for some reason that I don't know I tried boolean variables and never worked
so used string variables

gsHTTPs_Capture is string
gsHTTPs_Capture = "Active"

gsHTTPs_Go_On is string
gsHTTPs_Go_On = "Yes"


Then on my First Project Page (Initialization Code Block), I entered this:

//This code will triger the SSL Certificate once is propertly installed in the server
IF gsHTTPs_Capture = "Active" AND gsHTTPs_Go_On = "Yes" THEN
IF ExtractString(SysEnvironment("85658"),2,"=") <> "443" AND NOT InTestMode() THEN
ScriptDisplay(PageAddress("",paSECURE))
END
END


Then in my Page Program Administrator Log Off button (Server-side Ajax (Enable)code block ) I have this
to go back to my login page.

gsHTTPs_Go_On = "" //This clears the Variable once it returns to the main login page and the SSL remains active without generating the error
PageDisplay(Page_My_Login)
ContextClose(PAGE_Program_Administrator)


That's it.
Hope this helps others

Again. Thank you
Best regards,

Carlos