mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-08 13:43:35 +00:00
redo of Ross' latest patch against my updates
This commit is contained in:
11
src/gam.py
11
src/gam.py
@ -556,7 +556,7 @@ def doGAMVersion():
|
|||||||
platform.platform(), platform.machine(),
|
platform.platform(), platform.machine(),
|
||||||
GM_Globals[GM_GAM_PATH])
|
GM_Globals[GM_GAM_PATH])
|
||||||
|
|
||||||
def tryOAuth(gdataObject, scope):
|
def tryOAuth(gdataObject, scope, soft_errors=False):
|
||||||
scope.append(u'email')
|
scope.append(u'email')
|
||||||
credentials = oauth2client.client.SignedJwtAssertionCredentials(GM_Globals[GM_OAUTH2SERVICE_ACCOUNT_EMAIL],
|
credentials = oauth2client.client.SignedJwtAssertionCredentials(GM_Globals[GM_OAUTH2SERVICE_ACCOUNT_EMAIL],
|
||||||
GM_Globals[GM_OAUTH2SERVICE_KEY],
|
GM_Globals[GM_OAUTH2SERVICE_KEY],
|
||||||
@ -5334,7 +5334,6 @@ def doCreateUser():
|
|||||||
|
|
||||||
def doCreateGroup():
|
def doCreateGroup():
|
||||||
cd = buildGAPIObject(u'directory')
|
cd = buildGAPIObject(u'directory')
|
||||||
use_gs_api = False
|
|
||||||
body = dict()
|
body = dict()
|
||||||
body[u'email'] = sys.argv[3]
|
body[u'email'] = sys.argv[3]
|
||||||
if body[u'email'].find(u'@') == -1:
|
if body[u'email'].find(u'@') == -1:
|
||||||
@ -5997,7 +5996,6 @@ def doUpdateGroup():
|
|||||||
print u'ERROR: %s is not a valid argument for "gam update group"' % sys.argv[i]
|
print u'ERROR: %s is not a valid argument for "gam update group"' % sys.argv[i]
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
gs_body[attrib] = value
|
gs_body[attrib] = value
|
||||||
use_gs_api = True
|
|
||||||
i += 2
|
i += 2
|
||||||
if group[:4].lower() == u'uid:': # group settings API won't take uid so we make sure cd API is used so that we can grab real email.
|
if group[:4].lower() == u'uid:': # group settings API won't take uid so we make sure cd API is used so that we can grab real email.
|
||||||
use_cd_api = True
|
use_cd_api = True
|
||||||
@ -6255,12 +6253,7 @@ def doGetUserInfo(user_email=None):
|
|||||||
user_email = sys.argv[3]
|
user_email = sys.argv[3]
|
||||||
i = 4
|
i = 4
|
||||||
else:
|
else:
|
||||||
storage = oauth2client.file.Storage(GC_Values[GC_OAUTH2_TXT])
|
user_email = GC_Values[GC_ADMIN]
|
||||||
credentials = storage.get()
|
|
||||||
if credentials is None or credentials.invalid:
|
|
||||||
doRequestOAuth()
|
|
||||||
credentials = storage.get()
|
|
||||||
user_email = credentials.id_token[u'email']
|
|
||||||
if user_email[:4].lower() == u'uid:':
|
if user_email[:4].lower() == u'uid:':
|
||||||
user_email = user_email[4:]
|
user_email = user_email[4:]
|
||||||
elif user_email.find(u'@') == -1:
|
elif user_email.find(u'@') == -1:
|
||||||
|
Reference in New Issue
Block a user