PDA

View Full Version : Logon Question



Chris Spencer
6-Nov-2016, 03:20 PM
I see you can pass Params to the app on the wordpress string to set properties that are published.

However is it possible to control whether a user needs to logon or not.

I have a site under development to be embedded in a WP site where i do not require a logon for those users.

However if the site is run as a normal webapp I want the logon to appear..
I have got it working via rendering the first view different depending on whether it is in or not in the WP site.

Then I started looking at peLoginMode but it is not a webproperty.

So what is best practice for allowing this logon or not depending on where the site is run from?

Mike Peat
7-Nov-2016, 04:31 AM
Chris

There is a boolean function of cWPWebApp called InWordPress that will tell you if the program is running under WordPress or not.

Additionally there is also a function called WPInfo, which takes a string parameter of the name of the information you want and returns the value WordPress passes into the program (or nothing if it is not running under WordPress or specify a name it doesn't know. The items it knows about by default (you can extend these in the PHP - see https://docs.google.com/presentation/d/1OZjyPbwrMQwDPr_6XTw_2GPrGTNDq2and9Jv48wLmos/edit?usp=sharing, slides 26-28) are:



sWPTimeSent
bWPUserLoggedIn
sDF4WP_Parameters
sWPView
sWPSiteAddress
iWPUserID
sWPUserDispName
sWPUserEMail
sWPUserLogin
iWPUserLevel
sWPUserFirstName
sWPUserLastName
sWPLoginURL
sWPHomeURL


Use those as literal strings in the parameter you pass to WPInfo to see the value which was passed to the program (obviously a lot of them will be blank if the user is not logged into WordPress).

Mike