Object methods

add($gname,$module,$type,[$gdesc=""],[$reason="ownership"])

  • Add a new group.
  • Provide as first argument the groupname, then the module initials to which the group is associated, and finally the groupe type.
  • Optional arguments are the group description, and the reason for adding the group.
  • This method returns the unique group id if successfull, false on error.

getgid($gname,$module,$type)

  • Retrieve the unique group id of given group name, group type and module.
  • Arg1 is the group name.
  • Arg2 is the module of the group.
  • Arg3 is the group type (PRI/SYS/PUB)
  • This method returns the unique group id if successfull, false on error.

getgname($gid)

  • Retrieve the group name of a unique group id.
  • This method returns the group name (string) if successfull, false on error.

update($oldname,$gname,$module,$type,[$gdesc=""])

  • Rename a group of any type.
  • Arg1 is the original name (existing).
  • Arg2 is the new group name.
  • Arg3 is the module initials.
  • Arg4 is the group type.
  • Arg5 (optional) is the new group description.
  • This method returns the unique group id if successfull, false on error.

adduser($uname,$gname,$module,$type,[$reason="ownership"])

  • Add a relationship between a user and a group of type PUB or PRI.
  • Arg1 is the username of the account to add in the given group.
  • Arg2 is the group name receiving the user.
  • Arg3 is the module to which is associated the group receiving the user.
  • Arg4 is the group type receiving the user.
  • Arg5 (optional) is the electronic signature reason.
  • This method returns the unique group id if successfull, false on error.

deluser($uname,$gname,$module,$type,[$reason="ownership"])

  • Remove a relationship between a user and a group of type PUB or PRI.
  • Arg1 is the username of the account to remove from the given group.
  • Arg2 is the group name containing the user.
  • Arg3 is the module to which is associated the group containing the user.
  • Arg4 is the group type containing the user.
  • Arg5 (optional) is the electronic signature reason.
  • This method returns the unique group id if successfull, false on error.

listusersofgroup($gname,$module,$type)

  • Retrieve the users belonging to a PUB or PRI group.
  • Arg1 is the group name.
  • Arg2 is the module of the group.
  • Arg3 is the group type (PRI/PUB)
  • This method returns an single dimension array containing the list of usernames attached to the group if successfull, false on error.

listgroupsofuser($uname,$module,$type)

  • Retrieve all the private groups, or public groups (PRI or PUB) a user is attached to.
  • Arg1 is the username.
  • Arg2 is the module initials.
  • Arg3 is the group type (PUB/PRI).
  • This method returns an single dimension array containing the list of group names in which the username has been found if successfull, false on error.

listgroupsofmodule($module,$type)

  • Retrieve the public or private groups associated to a module, and filter result with only the groups to which the current user belongs to.
  • Arg 1 the the module initials.
  • Arg2 is the group type you want the list return (PUB / PRI).
  • This method returns a two dimensions array.
  • The array contains the list of group unique id and group names to which the current logged in username belong to... if successfull, false on error.

userbelong2group($uname,$gname,$module,$type)

  • Returns true if a given username belongs to the given group (public or private), false if not.
  • Arg1 is the username.
  • Arg2 is the group name.
  • Arg3 is the module related.
  • Arg4 is the group type (PUB/PRI)

addgroup($ngname,$nmodule,$ntype,$gname,$module,$type,[$reason="ownership"])

  • Creates a new relationship between a system group and a 'public or private' group.
  • Arg1 is the public or private group name.
  • Arg2 is the module of the pub/pri group to add.
  • Arg3 is the the group type to add (PRI/PUB)
  • Arg4 is the system group name.
  • Arg5 is the module of the system group.
  • Arg6 must be set to "SYS" (system).
  • Arg7 is optional, it's the e-sig reason.
  • The method return false on error, or the system group id after successfull operation.

delgroup($ngname,$nmodule,$ntype,$gname,$module,$type,$reason="ownership")

  • Removes a public or private group association from a system group.
  • Arg1 is the public or private group name.
  • Arg2 is the module of the pub/pri group to remove.
  • Arg3 is the the group type to remove (PRI/PUB)
  • Arg4 is the system group name.
  • Arg5 is the module of the system group.
  • Arg6 must be set to "SYS" (system).
  • Arg7 is optional, it's the e-sig reason.
  • The method return false on error, or the system group id after successfull operation.

listsubgroupsofgroup($gname,$module,$type,$nmodule,$ntype)

  • Returns the list of groups (either private or public) associated to a system group.
  • Arg1 is the system group name.
  • Arg2 is the module initials.
  • Arg3 must be set to 'SYS'.
  • Arg4 is the module initials.
  • Arg5 is the type of group list requested (PRI/PUB)
  • Return false on error, or a single dimension array with the group names.

listgroupsmanagedbyuser($uname,$module)

  • Returns the private groups owned by a given user name, for a module.
  • Arg1 is the username.
  • Arg2 is the module initials.
  • Return false on error, or a single dimension array with the group names.

listmastergidofuser($uname)

  • Returns system groups and public/private groups (all group) to which a user is attached to (going through each public/private group of the user).
  • Return false on error, or a single dimension array with the group names (SYS/PRI/PUB).