ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / User Groupware functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Logs a user in to the User Groupware.
Example
WEBDEV - Server code
// User login
nReturnedValue is int = gpwConnectUser(EDT_Login, EDT_Password)

// If the connection fails
IF nReturnedValue <> gpwOk THEN
	SWITCH nReturnedValue
		CASE gpwError: Error("Unable to connect.")
		CASE gpwUnknownUser, gpwInvalidPassword: 
				Error("Invalid user or password.")
	END
ELSE
	// Log in as an administrator
	IF gpwGetUserInfo(gpwInfoSupervisor) THEN
		// Opens the groupware administration page
		gpwOpenConfiguration()
		// Refreshes the page
	ELSE
		PageUse(MyPage..Name)
	END
END
Syntax

Logging a user in to the User Groupware Hide the details

<Result> = gpwConnectUser(<Username> , <Password>)
<Result>: Integer constant
Result of the connection:
gpwErrorAn error occurred. To get more details on the error, use ErrorInfo.
gpwInvalidPasswordThe user password is unknown.
gpwOKThe user was logged in.
gpwUnknownUserThe user is unknown: it is not present in the user groupware database.
<Username>: Character string
Username.
<Password>: Character string
Password associated with the username.

Logging a user in to the User Groupware using their email address Hide the details

<Result> = gpwConnectUser(<User's email address>)
<Result>: Integer constant
Result of the connection:
gpwErrorAn error occurred. To get more details on the error, use ErrorInfo.
gpwInvalidPasswordThe user password is unknown.
gpwOKThe user was logged in.
gpwUnknownUserThe user is unknown: it is not present in the user groupware database.
<User's email address>: Character string
User email retrieved in an OpenID authentication (Email property of the OpenIDIdentity variable).
Business / UI classification: Neutral code
Component: wd300gpu.dll
Minimum version required
  • Version 19
This page is also available for…
Comments
Example ok
//SENHACRIPT = password in table GPU_User.password

// Connect the user
nReturnedValue is int = gpwConnectUser(LOGINUSER, SENHACRIPT)
// If connection failure
IF nReturnedValue <> gpwOk AND nReturnedValue <> 0
SWITCH nReturnedValue
CASE gpwError: Error("Unable to connect.")
CASE gpwUnknownUser, gpwInvalidPassword:
Error("Invalid user or password.")
END
ELSE IF nReturnedValue = gpwOk AND nReturnedValue = 0
// Connect as administrator
IF gpwGetUserInfo(gpwInfoSupervisor) = True
// Opens the page for groupware management
gpwOpenConfiguration()
// Refreshes the page
ELSE
PageUse(MyPage..Name)
END
END
BOLLER
25 Jan. 2017

Last update: 04/24/2024

Send a report | Local help