Welcome! Log In Create A New Profile

Advanced

WinDev Groupware made for you.

Posted by Tor-Bjarne 
Tor-Bjarne
WinDev Groupware made for you.
June 03, 2017 07:21PM
Hi,

After struggling with the PCSoft groupware, I finally abandon it, and decided to make my own.

In my current project (for a client) we want to restrict access, but managers can press F11 log in as administrator and disable access, then log inn as user again without restarting the app. Or a manager needs to press the [Only Admins] button he can do that in the same manner.

Now I want to share my cGroupware class with anybody that`s want it, as a part of "giving a little back" to this great community, smiling smiley

An small exedemo can be found Here... just unzip in a folder and run the executable file.

Info about the demo, it mainly containing the Admin and User users (and Admin and User groups), password is blank/Nothing on both.

F11 = Login/Change userid
F12 = Inspect screen (where you set or revoke access)

The only buttons that actually do something can be found in the system ribbon.

Might not be suitable for all, but perhaps good starting point if you want to write your own.

Features:

1. One class,One table in the analyze and 2 Windows (Win_Logon,Win_inspect) makes the wholde thing work.

2. You can change userID run-time, no need to restart app to change userID and rights

3. The Inspect screen/Window reads only controls for the window your in, not all - making it simpler to disallow controls "in this Window"


4. Farley easy implementation with your app and if you have existing usergroup/Users tables.
(I will/can write a short PDF Document describing how, if anybody is interested)

5. Written in WinDev 20, I`m on v22 and are using it here, so nothing is problematic about upgrading.
(WinDev 20 is the lowest Window version I have on this PC for the moment)

6. Since WinDev v22 lets you edit a screen I made it possible to change fonts, brushcolors etc. depending on user-group you are logged into.


7. Timed auto-logout or auto-logon as "other" user (perhaps with lower rights)



Some points/limitations of my groupware:

1. Unlike PCSoft`s solution a userid must exist in a group, and the group is actually what you set the rights for.
2. A Userid must be unique. You can not have same userid but in different groups.
3. When pressing F-something (Demo app uses F12) to get the inspect window the controls are read run-time.
4. It has bugs - Yes I also do bugs, not on purpose, but still.
5. I tried to keep the code clean, but some might not agree, I however personally hate statements like:
MySelf..Caption=(MySelf..Pushed?"Trace ON" ELSE "Trace OFF")

Not easy to see whats going on here huh?,... having said that, I copied the example from my own code grinning smiley but it`s just one place and in the test-project, not the groupware.

Now, it`s quite time consuming writing documentation, and if no one is interested I don`t smiling smiley

Please let me know if you are interested and wants some examples on how to load your usergroup/users into my system.

If you do use it and correct bugs or make smart changes, I would like to get a copy.

Anyhow enough said, here is the link to the Project

Cheers
Tor-Bjarne



Edited 1 time(s). Last edit at 06/03/2017 07:25PM by Tor-Bjarne.
Stefan Bentvelsen
Re: WinDev Groupware made for you.
June 03, 2017 09:21PM
Hi Tor-Bjarne,

thanks for sharing this project.
It looks quit nice and simple to use.
Noel Tanti
Re: WinDev Groupware made for you.
June 04, 2017 10:40AM
Hi Tor-Bjarne,

Thanks for your contribution.
I also had difficulties with groupware where the project had multiple configurations and also where the data resided on remote servers.
I need something like that but I do not feel up to it.

Thanks & regards
Noel



Edited 1 time(s). Last edit at 06/04/2017 10:46AM by Noel Tanti.
Tor-Bjarne
Re: WinDev Groupware made for you.
June 04, 2017 05:31PM
Hi,

Thank you guys smiling smiley


I also made a (sort of) user manual that can be found HERE ...


And I made some small cosmetic changes to the Win_Inspect Window (and resolving a small bug) in the updated project (same link as before)


Cheers
Tor-Bjarne
biju
Re: WinDev Groupware made for you.
June 05, 2017 11:39AM
Hello Tor-Bjarne,

Thanks for your contribution both the Gpw Project and Documentation.

- Biju
Tor-Bjarne
Re: WinDev Groupware made for you.
June 05, 2017 01:19PM
Hi,

Thank you Biju smiling smiley

Yesterday I removed the Worst typos from my short manual.

And today (As I`m implementing it in a v22 project I discovered a bug when changing an existing username) now corrected in the v1.2 that I put out on the server.

the cGroupware::Version contains (from v1.1), contains version of the class.

cheers
Tor-Bjarne
Yogi Yang
Re: WinDev Groupware made for you.
June 17, 2017 12:34PM
Hello Tor-Bjarne,

Thanks for sharing your hard work.

I have never used this feature till date but after studying your code I think it would be apiece of cake to implement GW.

Regards,
Tor-Bjarne
Re: WinDev Groupware made for you.
June 18, 2017 12:12PM
Thank you Yogi smiling smiley

I made a new chapter for people "in a hurry" named "How I quick-implemented gw in a couple of projects", this shows how to get groupware to work with your existing user/employe table with minimal effort, "Quick and Dirty" in other words grinning smiley

Link as before.

EDIT: You might have to press F5 - refresh in you browser to get the new version of the "manual"

Cheers
Tor-Bjarne



Edited 1 time(s). Last edit at 06/18/2017 12:16PM by Tor-Bjarne.
Luiz Menezes
Re: WinDev Groupware made for you.
July 05, 2017 04:42PM
Thanks Tor-Bjarne.
Tor-Bjarne
Re: WinDev Groupware made for you.
July 06, 2017 09:20AM
Hi Luiz,

No Problem smiling smiley

Actually I put out a new version today (v1.3) with some minor changes, on the same spot/link that has the following changes.

- in later editions (frm v1.3) of my class I removed the :confused smileyave from the "destructor" - no need to save if no one has touched the arrays.

And the ::save is called from the Win_inspect closing code anyhow.

- I now check if a record has been changed in the ::save method to, if not, it do not save.
- The Win_Inspect sets the variable bChanged = True on the ::ExtraOpt and ::ExtraInit arrays when changing

These changes are important in a multi user environment.

If anybody want`s to manually change, here are the changes:

In the definition of the STControlextra structure a variable bChanged has been added:
STControlextra is Structure
	sControlName is string
	sParentName is string
	sGroupName is string
	nType is int 
	fntCharset is string 
	FntOrientation is int
	FntStrikeout is boolean
	FntCondensed is boolean
	FntCOlor is int
	FntExtended is boolean
	FntBold is boolean
	FntItalic is boolean
	FntLarge is boolean
	FntName is string 
	FntUnderline is boolean
	FntSize is int 
	
	BGColorBlue is int 
	BGColorColor is int
	BGColorLuminance is int
	BGColorOpacity is int
	BGColorRed	is int 
	BGColorSaturation is int 
	BGColorHue is int 
	BGColorGreen is int 
	
	FGColorBlue is int 
	FGColorColor is int
	FGColorLuminance is int
	FGColorOpacity is int
	FGColorRed	is int 
	FGColorSaturation is int 
	FGColorHue is int 
	FGColorGreen is int 
	
	bgimage is string
	sNewCaption is string
	bchanged is boolean // <-- New variable
END

in the destructor code the save has been commented:
//:confused smileyave

In Win_Inspect, plane 6 save button BTN_save1 the bChanged field is added:

The code block:
	IF n2 = -1 THEN
		n2 = Add(cGroupWare::ËxtraInit)
		cGroupWare::ËxtraInit[n2] <= cGroupWare::ThisState
		cGroupWare::ËxtraInit[n2].sGroupName = "*"
	END
has been extended with a the new variable bChanged beeing set:
	IF n2 = -1 THEN
		n2 = Add(cGroupWare::ËxtraInit)
		cGroupWare::ËxtraInit[n2] <= cGroupWare::ThisState
		cGroupWare::ËxtraInit[n2].sGroupName = "*"
		cGroupWare::ËxtraInit[n2].bchanged = True // <-- New field
	END

And further down in the same code:
cGroupWare::ExtraOpt[n].fGColorGreen		= gFgcolor..Green

cGroupWare::ExtraOpt[n].sGroupName			= LIST_Usergroups
//Refreshscreen()

WIN_Inspect..Plane = 2
A new line as been added:
cGroupWare::ExtraOpt[n].fGColorGreen		= gFgcolor..Green

cGroupWare::ExtraOpt[n].sGroupName			= LIST_Usergroups
cGroupWare::ExtraOpt[n].bchanged			= True // <-- New entry
//Refreshscreen()

WIN_Inspect..Plane = 2

and finally the cGroupware:confused smileyave class checks if anything has changed, I inserted the code before the:
n is int

s is string = "KeyType"
b is string

A block of code that checks if anything is changed:
bIsSomethingActuallyChanged is boolean
FOR EACH ds OF ::Users
	IF ds.bChanged = True THEN
		bIsSomethingActuallyChanged = True
	END
END
IF bIsSomethingActuallyChanged = False THEN
	FOR EACH ds OF ::Groups
		IF ds.bchanged = True THEN
			bIsSomethingActuallyChanged = True
		END
	END
END
IF bIsSomethingActuallyChanged = False THEN
	FOR EACH ds OF ::ChangedControls
		IF ds.bchanged = True THEN
			bIsSomethingActuallyChanged = True
		END
	END
END
IF bIsSomethingActuallyChanged = False THEN
	FOR EACH ds OF ::wins
		IF ds.bchanged = True THEN
			bIsSomethingActuallyChanged = True
		END
	END
END
IF bIsSomethingActuallyChanged = False THEN
	FOR EACH ds OF ::ËxtraInit
		IF ds.bchanged = True THEN
			bIsSomethingActuallyChanged = True
		END
	END
END
IF bIsSomethingActuallyChanged = False THEN
	FOR EACH ds OF ::ExtraOpt
		IF ds.bchanged = True THEN
			bIsSomethingActuallyChanged = True
		END
	END
END
IF bIsSomethingActuallyChanged = False THEN
	RETURN
END

n is int

s is string = "KeyType"
b is string

Edited - you also need the code below in the loadarrays
FOR EACH ds OF ::wins
	ds.bchanged = False
END

Shoud be:
FOR EACH ds OF ::wins
	ds.bchanged = False
END

FOR EACH ds OF ::ËxtraInit
	ds.bchanged = False
END
FOR EACH ds OF ::ExtraOpt
	ds.bchanged = False
END


Cheers
Tor-Bjarne



Edited 2 time(s). Last edit at 07/06/2017 10:49AM by Tor-Bjarne.
Noel Tanti
Re: WinDev Groupware made for you.
July 06, 2017 09:40AM
Hi Tor-Bjarne

I would like to ask you about menus.
How do you handle the hide/show/greed out for users?

Thanks & regards
Noel
Tor-Bjarne
Re: WinDev Groupware made for you.
July 06, 2017 10:52AM
Quote
Noel Tanti
I would like to ask you about menus.
How do you handle the hide/show/greed out for users?

As stated in the manual "1. Menus - I do not use them (agree or not), so there`s no code handling them.
"
smiling smiley

Cheers
Tor-Bjarne
Noel Tanti
Re: WinDev Groupware made for you.
July 06, 2017 12:40PM
Wrong question smiling smiley

are ribbons ok?

Thanks
Tor-Bjarne
Re: WinDev Groupware made for you.
July 06, 2017 03:20PM
Hi,

Yes the ribbons are read and can be changed (Visible/grayed/Font/Color), also: Now I put out cGroupware v1.4 where menus are read to smiling smiley

So menus are now supported, I change the user-documentation when I have the time.

Cheers
Tor-Bjarne
Noel Tanti
Re: WinDev Groupware made for you.
July 06, 2017 03:43PM
Hi Tor-Bjarne

that is great :spos:. Much appreciated.

Regards
Noel
Luiz Menezes
Re: WinDev Groupware made for you.
July 06, 2017 11:05PM
Made some tests in the DemoExe and Compiled Project, and, after using Alt+F12 instead of F12, it worked fine and liked very much. Good job.
Tor-Bjarne
Re: WinDev Groupware made for you.
July 06, 2017 11:32PM
Hi Luiz,

Thank you smiling smiley - You can use whatever hotkey to the call Win_Inspect or run-time logon with the code:

//Groupware Optional options
cGroupWare::Alternative_InspectKey 	= VK_F12 //F12 calls the inspector window win_inspect
cGroupWare::Alternative_LogonKey	= VK_F11 //F11 calls Run-time login/change user

Cheers
Tor-Bjarne
Re: WinDev Groupware made for you.
October 22, 2020 07:21AM
Hi

I'm requiring a security module like this within a Webdev project. Are these classes compatible with a WB25 project (session mode)? If so is your current version available for purchase? Please let me know if so...

Rgds
Paul Turner



Edited 2 time(s). Last edit at 10/22/2020 08:01AM by pauly139.
tbh
Re: WinDev Groupware made for you.
December 01, 2020 03:04PM
Hi Paul,

I`m currently using this class in my v25 Windev project - there was a couple of errors due to changes in WinDev.

The classes are free smiling smiley

Cheers
Tor-Bjarne
Re: WinDev Groupware made for you.
December 01, 2020 09:42PM
Hi Tor-Bjarne

Thanks for letting me know. I had to decide which way to go a month or so ago, and decided to just work around the areas of the WD offering for now.

Rgds
Paul
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: