Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 3 Monaten, 1 Woche
Letzter Beitrag:
vor 3 Monaten, 1 Woche
Beteiligte Autoren:
GuenterP, PETER ZHOU

WEBDEV 20 - to get group within user groupware

Startbeitrag von PETER ZHOU am 13.05.2017 07:32

Hi,

I am using 'gpwAddUser(clUser)' to add the login user.
But how do i add/assign the group within the groupware ?

Regards,

PETER ZHOU

Antworten:

Hi Peter,

complexity takes its toll ... as you've seen, in Groupware the user's structure doesn't contain a "group" member. This is because on one hand in PC Soft's Groupware a group can be part of another group that itself can be part of another group and so on ... on the other hand a user may not be part of any group. So, rights can be attributed to a group or a single user.

However, the function gpwGetUserInfo(gpwInfoGroup) comes to rescue you!

von GuenterP - am 13.05.2017 13:50
Quote
GuenterP
Hi Peter,

complexity takes its toll ... as you've seen, in Groupware the user's structure doesn't contain a "group" member. This is because on one hand in PC Soft's Groupware a group can be part of another group that itself can be part of another group and so on ... on the other hand a user may not be part of any group. So, rights can be attributed to a group or a single user.

However, the function gpwGetUserInfo(gpwInfoGroup) comes to rescue you!


Hi Guenter,

'gpwGetUserInfo(gpwInfoGroup)' is to get the current logon user's group.

I would like to assign the group (which we have fixed to a certain group) when i add the user, how do i do that ?

Regards,

Peter Zhou

von PETER ZHOU - am 13.05.2017 20:03
Hi Peter,
afaik there's no cheap solution to get at any user's group without logging her/him in. In fact a user can be member of several groups! There are numerous other problems buried in Groupware. As long as you keep to what it is made for, you're safe. Maybe you can find a code snippet in the groupware's component code to retrieve the group? Just a suggestion:


PROCEDURE GPU_sGetUserGroups(nUserId is int)

sListGroups is string UNICODE

// browse the groups of the user
HFilter(GPU_User_Group,UserID,nUserId,nUserId)
FOR EACH GPU_User_Group ON UserID
// retrieve information about the group
HReadSeekFirst(GPU_Group,IDGroup,GPU_User_Group.IDGroup)
IF HFound(GPU_Group) THEN
IF sListGroups“” THEN sListGroups+=TAB
sListGroups+=GPU_Group.Name
END
END
HDeactivateFilter(GPU_User_Group)

RESULT sListGroups



If it starts to become nasty, I recommend to write your own groupware. This takes a week but then you're playing by your own rules.

von GuenterP - am 14.05.2017 05:25
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.