NetTalk Central

Author Topic: NT 6 to NT 7 app upgrades  (Read 7467 times)

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
NT 6 to NT 7 app upgrades
« on: December 13, 2012, 10:34:30 AM »
Bruce,

     I'm upgrading all my NT 6 apps to NT 7.  I have run into 2 issues so far:

1.  All my login forms are now left justified.  I have been tinkering with FireBug to see if I can find the cause but so far no luck.

2.  Two of my apps use the technique to store a hash of the password in the user.tps file.  After conversion, I find I cannot log into these apps with the known user name and password.  There is no error message, I'm simply left at the login screen.  I have attached a sample of the code embedded in the login form, that worked in the NT 6.45 version of the app.  Has something changed in StringTheory or Cryptonite?

By the way, all my apps are compiled as a DLL for use with the Multi-Site host app. 

Also, the test app I sent you last week is one I'm trying to convert and can't log into.  If you could recompile that with NT 7, you should see this issue.

Thanks,

Jeff King

[attachment deleted by admin]
« Last Edit: December 13, 2012, 11:06:09 AM by kingja »

MikeR

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #1 on: December 13, 2012, 11:27:23 AM »
My logins dont work either, nothing special ???

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #2 on: December 13, 2012, 11:57:36 AM »
Mike,

     I found that if I uncheck "Delete session on logout" and "Change session on login/logout", then I can log in again.  I tried different combinations of these and it seems that just unchecking "Delete session on logout" allows logins to continue.  This bothers me as I prefer the session be deleted on logout.  Hopefully Bruce can resolve this quickly.

Jeff

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #3 on: December 13, 2012, 02:21:07 PM »
Same problem with me. Once I unchecked the "Delete session on logout" it worked. When that item IS checked, in my app the procedure processing completely bypasses the ValidateUpdate routine where the actual login validation coding is.

Mark

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #4 on: December 13, 2012, 02:35:44 PM »
Sorry, forgot to mention the procedure I was talking about is the LogInForm.

Note: I opened the Web3 example, compiled it in NT7, and the login worked properly with the call to ValidateUpdate processed, even with the "delete session on logout" checked in the WebServer.

Mark

MikeR

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #5 on: December 13, 2012, 03:49:09 PM »
Thanks Works, in that it logs on but the alert message doesnt appear ?

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #6 on: December 13, 2012, 04:39:12 PM »
Mike and Mark,

     Are either of you Hashing the password?  I'm storing the hash back into my user file and thought it might have something to do with CryptoNite and StringTheory.  If not, then there is some other reason it is bypassing the ValidateUpdate or perhaps the ValidateLogin() routine.

Jeff

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Solved - Re: NT 6 to NT 7 app upgrades
« Reply #7 on: December 13, 2012, 05:51:07 PM »
Mike and Mark,

     I compared my 2 apps with the latest Web3 example.  In my apps I have the following code in the GenerateForm/Start embed:

! change the 'save' button so it says 'login'
p_web.site.SaveButton.TextValue = 'Login'

! coming to the login screen automatically logs the user out.
! Note that logging out does not delete the session.

p_web.SetSessionLoggedIn(0)


     The last line, p_web.SetSessionLoggedIn(0), is not present in the latest example.  Commenting out this code has solved the problem.  Most of the NT apps I create are based on a few of the example apps.  This line was probably in one of the earlier examples and has not been a problem until NT 7.

     Now, the only remaining issue is that the login form opens on the left instead of centered, as it did in NT 6.45.  Also, when I log out, the login form reappears on the left.  In the NT 6.45 version of my apps, it only appears when I select Login from a menu.  Still looking into this issue.

Thanks,

Jeff

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11177
    • View Profile
Re: NT 6 to NT 7 app upgrades
« Reply #8 on: December 13, 2012, 10:35:23 PM »
Hi Guys,

Thanks for the feedback - and also the analysis.

So this bit of code;

! coming to the login screen automatically logs the user out.
! Note that logging out does not delete the session.
p_web.SetSessionLoggedIn(0)


is incompatible with "Delete session on logout" because effectively it means that the session values _of the login form_ set before this line are being cleared. So the login basically doesn't work right. My recommendation is like Jeff's - remove the line. (or turn off "delete session on logout).

Regarding the centering of the login window;
go to the Web Server procedure, Settings / Styles / Site tab. remove the Content Body Div Class set there (it's defaulting to 'nt-left'.)
I don't _think_ this will have an impact on the rest of the system, but please keep an eye out for any other style problems and let me know if there are any.

cheers
Bruce



kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #9 on: December 14, 2012, 12:39:03 PM »
Bruce,

     Thanks!  All is back to "normal".  I'll finish testing the other converted apps and report back here if I find any issues. 

Jeff

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #10 on: December 17, 2012, 01:29:06 PM »
Deleting the handcode referred to above and checking on the Delete Session on Login corrects the log in issue.

However, I have discovered another issue which was not present before in NT6. When you log in, several additional menu buttons appear in the menu at the top of the page. I'm using a menu extension in the PageHeaderTag proc and these menu items are all dependent on the user being logged in.

In NT6, when I clicked on my Log Out button, these menu items would disappear, as they should.

In NT7, they do not disappear.

Mark

JPMacDonald

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #11 on: December 17, 2012, 05:49:34 PM »
Mark/Bruce,

I am seeing the same behaviour in my application, the menu options do not disappear and will still launch the procedure coded behind the menu selection after logout.

In addition to that I have code embedded in the Webhandler/DeleteSession embed point to do some cutom cleanup of memory tables etc. and that is no longer getting invoked when the user logs out.

Regards

Parker

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11177
    • View Profile
Re: NT 6 to NT 7 app upgrades
« Reply #12 on: December 17, 2012, 11:13:50 PM »
Tell me more about your "Log Out" button. What does it do? What URL does it have? does it go straight to the Login form?
Is it a button or a menu item?

Cheers
Bruce

JPMacDonald

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #13 on: December 18, 2012, 04:33:37 AM »
Bruce,

In my case the Logout is a menu option generated from the Wizard in the original NT6 app.

In the "or Procedure" section it names LoginForm as the action to take when selected.

Regards

Parker

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: NT 6 to NT 7 app upgrades
« Reply #14 on: December 18, 2012, 05:30:32 AM »
yeah, I thought maybe it was. Ok, remember that we removed the "logout" line from the Login page? That means that just going to the logout page no longer logs you out. You'd need to go to an actual "logout" page to do that.

So maybe make a netwebpage.
Put a "thanks for coming" type message on it.
and move the p_web.SetSessionLoggedIn(0) call there.

Then you'll probably need to adjust the Header on that page so that it shows a reduced set of menu options.

cheers
Bruce