NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - John Hickey

Pages: 1 [2]
16
Web Server - Share Knowledge / Example code for logging in a user
« on: June 17, 2007, 02:35:18 PM »
From the newsgroup, Steve Ellis asked:

Does anyone have an example of how to do a logon that verifies a userid and password against a server database?

Nick L answered:

Yes,
Include the tables you need to validate against but use the web form to
memory and local Li/Pw variables.
I validate 2 tables, the "users"(AFF) and "user group(UGRP)".

In the embed "Validate Update" I do a lookup to the "Users" using the key
login and then the user group to compare with the local vars to pass the
login and password. I then lookup the group to get the group access level
then set some session variables as in the example below. Any suggestions to
streamline this would be appreciated, anyone??

!Get login credentials
 If Loc:Login<>''
    If upper(Loc:Login) = upper(AFF:Login) and upper(Loc:Password) =
upper(AFF:Password)
            p_web.SetSessionValue('AffiliateID',clip(AFF:AffiliateID))
            p_web.SetSessionValue('AFFLevel1',clip(UGRP:AccessLevel))
            p_web.ValidateLogin()
            !p_web.SetSessionLoggedIn(1)
    Else
            p_web.SetSessionValue('LoginMessage','Try again')
    End !If
 Else
            p_web.SetSessionValue('LoginMessage','Login required, try
again')
End !If

****end example*****

17
Web Server - Share Knowledge / Setting Form to view only
« on: June 17, 2007, 02:27:50 PM »
On the Newsgroups, Gregg Matteson asked:

How do you set a form to view only , only while the form is in change mode?

I tried setting a session variable at the browse then using that value in a local variable in the form but no luck so far.

Bruce Johnson Answered:

on the advanced tab is
"View Only IF:"
field.

In this you can put any expression.

In your case the expression would be

p_web.GetSessionValue('UpdateInvoices_CurrentAction') = ChangeRecord
where "UpdateInvoices" is the name of this form procedure.

In 4.26 I'll be making it a little easier to test the "current action" as this is something that came up a few times on tour.

Incidentally if your code to determine whether it should be View only or not is too big, then you can set the variable
loc:viewonly in the form in the Generate Form embed point to 1.

Cheers
Bruce

18
Web Server - Share Knowledge / Changing text on buttons
« on: June 17, 2007, 02:25:33 PM »
Question from Greg Bailey on the newsgroups:

I need to be able to change the text on an insert change or delete button at the procedure level (not globally).  The end user wants text specific to a particular browse on the buttons. Is this possible?

Answer from Wolfgang Orth:

yes:

at the Generate Form - StartEmbed

 p_web.site.InsertButton.TextValue = 'New'
 p_web.site.DeleteButton.TextValue = 'Dump it!'
 p_web.site.SaveButton.TextValue = 'Store Date'

19
News And Views / Welcome to the Forums!
« on: June 16, 2007, 01:58:31 PM »
What a fantastic product NetTalk is!  This forum is designed to be a central place where Clarion developers using NetTalk can come for answers to questions, and/or to share tips, code, and apps!

Now that you're here, what can you do?  Post your questions and tips about NetTalk in the appropriate sections.  You can also upload apps and code here, or in the Download/Upload section.

Thanks for participating!

--John Hickey

Pages: 1 [2]