Module: user

This module is used to deal with users and their properties, like username and groups.

Members

linuxmusterLinuxclient7.user.cleanTemplateUserGtkBookmarks()[source]

Remove gtk bookmarks of the template user from the current users ~/.config/gtk-3.0/bookmarks file.

linuxmusterLinuxclient7.user.getHomeShareMountpoint()[source]

Returns the mountpoint of the users serverhome.

Returns:

The monutpoint of the users serverhome

Return type:

str

linuxmusterLinuxclient7.user.isInAD()[source]

Checks if the current user is an AD user.

Returns:

True if the user is in the AD, False if it is a local user

Return type:

bool

linuxmusterLinuxclient7.user.isInGroup(groupName)[source]

Checks if the current user is part of a given group

Parameters:

groupName (str) – The name of the group

Returns:

True if the user is part of the group, False otherwise

Return type:

bool

linuxmusterLinuxclient7.user.isRoot()[source]

Checks if the current user is root

Returns:

True if the current user is root, False otherwise

Return type:

bool

linuxmusterLinuxclient7.user.isUserInAD(user)[source]

Checks if a given user is an AD user.

Parameters:

user (str) – The username of the user to check

Returns:

True if the user is in the AD, False if it is a local user

Return type:

bool

linuxmusterLinuxclient7.user.mountHomeShare()[source]

Mounts the serverhome of the current user

Returns:

True on success, False otherwise

Return type:

bool

linuxmusterLinuxclient7.user.readAttributes()[source]

Reads all attributes of the current user from ldap

Returns:

Tuple (success, dict of user attributes)

Return type:

tuple

linuxmusterLinuxclient7.user.school()[source]

Gets the school of the current user from the AD

Returns:

The short name of the school

Return type:

str

linuxmusterLinuxclient7.user.username()[source]

Returns the user of the current user

Returns:

The username of the current user

Return type:

str