mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 21:01:36 +00:00
Added command gam check suspended <UserItem>
Some checks failed
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Push wiki / pushwiki (push) Has been cancelled
Some checks failed
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Push wiki / pushwiki (push) Has been cancelled
This commit is contained in:
@@ -5639,6 +5639,7 @@ gam update user <UserItem> [ignorenullpassword] <UserAttribute>*
|
|||||||
[logpassword <FileName>]
|
[logpassword <FileName>]
|
||||||
gam delete user <UserItem> [noactionifalias]
|
gam delete user <UserItem> [noactionifalias]
|
||||||
gam undelete user <UserItem> [ou|org|orgunit <OrgUnitPath>]
|
gam undelete user <UserItem> [ou|org|orgunit <OrgUnitPath>]
|
||||||
|
gam check suspended <UserItem>
|
||||||
gam suspend user <UserItem> [noactionifalias]
|
gam suspend user <UserItem> [noactionifalias]
|
||||||
gam unsuspend user <UserItem> [noactionifalias]
|
gam unsuspend user <UserItem> [noactionifalias]
|
||||||
gam info user [<UserItem>]
|
gam info user [<UserItem>]
|
||||||
|
|||||||
@@ -10,6 +10,20 @@ a literal string, a file or a Google Doc.
|
|||||||
(gcsdoc <StorageBucketObjectName>))
|
(gcsdoc <StorageBucketObjectName>))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Added command `gam check suspended <UserItem>` that checks the suspension status of a user
|
||||||
|
and sets the return code to 0 if the user is not suspended or 26 if it is.
|
||||||
|
```
|
||||||
|
$ gam check suspended testok@domain.com
|
||||||
|
User: testok@domain.com, Account Suspended: False
|
||||||
|
$ echo $?
|
||||||
|
0
|
||||||
|
|
||||||
|
$ gam check suspended testsusp@domain.com
|
||||||
|
User: testsusp@domain.com, Account Suspended: True, Suspension Reason: ADMIN
|
||||||
|
$ echo $?
|
||||||
|
26
|
||||||
|
```
|
||||||
|
|
||||||
7.11.00
|
7.11.00
|
||||||
|
|
||||||
Added commands to manage classroom/course announcements.
|
Added commands to manage classroom/course announcements.
|
||||||
|
|||||||
@@ -337,6 +337,7 @@ ENTITY_IS_A_GROUP_RC = 22
|
|||||||
ENTITY_IS_A_GROUP_ALIAS_RC = 23
|
ENTITY_IS_A_GROUP_ALIAS_RC = 23
|
||||||
ENTITY_IS_AN_UNMANAGED_ACCOUNT_RC = 24
|
ENTITY_IS_AN_UNMANAGED_ACCOUNT_RC = 24
|
||||||
ORGUNIT_NOT_EMPTY_RC = 25
|
ORGUNIT_NOT_EMPTY_RC = 25
|
||||||
|
USER_SUSPENDED_RC = 26
|
||||||
CHECK_USER_GROUPS_ERROR_RC = 29
|
CHECK_USER_GROUPS_ERROR_RC = 29
|
||||||
ORPHANS_COLLECTED_RC = 30
|
ORPHANS_COLLECTED_RC = 30
|
||||||
# Warnings/Errors
|
# Warnings/Errors
|
||||||
@@ -44337,6 +44338,28 @@ def doUndeleteUsers():
|
|||||||
def doUndeleteUser():
|
def doUndeleteUser():
|
||||||
undeleteUsers(getStringReturnInList(Cmd.OB_USER_ITEM))
|
undeleteUsers(getStringReturnInList(Cmd.OB_USER_ITEM))
|
||||||
|
|
||||||
|
# gam check suspended <UserItem>
|
||||||
|
def doCheckUserSuspended():
|
||||||
|
cd = buildGAPIObject(API.DIRECTORY)
|
||||||
|
user = getEmailAddress()
|
||||||
|
checkForExtraneousArguments()
|
||||||
|
try:
|
||||||
|
result = callGAPI(cd.users(), 'get',
|
||||||
|
throwReasons=GAPI.USER_GET_THROW_REASONS,
|
||||||
|
userKey=user, fields='suspended,suspensionReason', projection='basic')
|
||||||
|
except (GAPI.userNotFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden):
|
||||||
|
entityDoesNotExistExit(Ent.USER, user)
|
||||||
|
except (GAPI.badRequest, GAPI.invalidCustomerId, GAPI.loginRequired):
|
||||||
|
accessErrorExit(cd)
|
||||||
|
kvList = [Ent.Singular(Ent.USER), user]
|
||||||
|
up = 'suspended'
|
||||||
|
kvList.extend([UProp.PROPERTIES[up][UProp.TITLE], result[up]])
|
||||||
|
if result[up]:
|
||||||
|
up = 'suspensionReason'
|
||||||
|
kvList.extend([UProp.PROPERTIES[up][UProp.TITLE], result[up]])
|
||||||
|
setSysExitRC(USER_SUSPENDED_RC)
|
||||||
|
printKeyValueList(kvList)
|
||||||
|
|
||||||
# gam <UserTypeEntity> suspend users [noactionifalias]
|
# gam <UserTypeEntity> suspend users [noactionifalias]
|
||||||
# gam <UserTypeEntity> unsuspend users [noactionifalias]
|
# gam <UserTypeEntity> unsuspend users [noactionifalias]
|
||||||
def suspendUnsuspendUsers(entityList):
|
def suspendUnsuspendUsers(entityList):
|
||||||
@@ -76554,6 +76577,7 @@ MAIN_COMMANDS_WITH_OBJECTS = {
|
|||||||
Cmd.ARG_USERINVITATION: doCheckCIUserInvitations,
|
Cmd.ARG_USERINVITATION: doCheckCIUserInvitations,
|
||||||
Cmd.ARG_ISINVITABLE: doCheckCIUserInvitations,
|
Cmd.ARG_ISINVITABLE: doCheckCIUserInvitations,
|
||||||
Cmd.ARG_ORG: doCheckOrgUnit,
|
Cmd.ARG_ORG: doCheckOrgUnit,
|
||||||
|
Cmd.ARG_SUSPENDED: doCheckUserSuspended,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
'clear':
|
'clear':
|
||||||
|
|||||||
@@ -777,6 +777,7 @@ class GamCLArgs():
|
|||||||
ARG_STORAGEBUCKETS = 'storagebuckets'
|
ARG_STORAGEBUCKETS = 'storagebuckets'
|
||||||
ARG_STORAGEFILE = 'storagefile'
|
ARG_STORAGEFILE = 'storagefile'
|
||||||
ARG_STORAGEFILES = 'storagefiles'
|
ARG_STORAGEFILES = 'storagefiles'
|
||||||
|
ARG_SUSPENDED = 'suspended'
|
||||||
ARG_SVCACCT = 'svcacct'
|
ARG_SVCACCT = 'svcacct'
|
||||||
ARG_SVCACCTS = 'svcaccts'
|
ARG_SVCACCTS = 'svcaccts'
|
||||||
ARG_TASK = 'task'
|
ARG_TASK = 'task'
|
||||||
|
|||||||
Reference in New Issue
Block a user