mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			Option to activate an account
							parent
							
								
									7d9df1445a
								
							
						
					
					
						commit
						8e669659ed
					
				
							
								
								
									
										19
									
								
								epicyon.py
								
								
								
								
							
							
						
						
									
										19
									
								
								epicyon.py
								
								
								
								
							| 
						 | 
				
			
			@ -14,6 +14,7 @@ from person import setDisplayNickname
 | 
			
		|||
from person import setBio
 | 
			
		||||
from person import setProfileImage
 | 
			
		||||
from person import removeAccount
 | 
			
		||||
from person import activateAccount
 | 
			
		||||
from person import deactivateAccount
 | 
			
		||||
from skills import setSkillLevel
 | 
			
		||||
from roles import setRole
 | 
			
		||||
| 
						 | 
				
			
			@ -113,6 +114,9 @@ parser.add_argument('-a','--addaccount', dest='addaccount', \
 | 
			
		|||
parser.add_argument('-g','--addgroup', dest='addgroup', \
 | 
			
		||||
                    type=str,default=None, \
 | 
			
		||||
                    help='Adds a new group')
 | 
			
		||||
parser.add_argument('--activate', dest='activate', \
 | 
			
		||||
                    type=str,default=None, \
 | 
			
		||||
                    help='Activate a previously deactivated account')
 | 
			
		||||
parser.add_argument('--deactivate', dest='deactivate', \
 | 
			
		||||
                    type=str,default=None, \
 | 
			
		||||
                    help='Deactivate an account')
 | 
			
		||||
| 
						 | 
				
			
			@ -1014,6 +1018,21 @@ if args.rmaccount:
 | 
			
		|||
            print('Group '+handle+' was removed')
 | 
			
		||||
        sys.exit()
 | 
			
		||||
 | 
			
		||||
if args.activate:
 | 
			
		||||
    if '@' in args.activate:
 | 
			
		||||
        nickname=args.activate.split('@')[0]
 | 
			
		||||
        domain=args.activate.split('@')[1]
 | 
			
		||||
    else:
 | 
			
		||||
        nickname=args.activate
 | 
			
		||||
        if not args.domain or not getConfigParam(baseDir,'domain'):
 | 
			
		||||
            print('Use the --domain option to set the domain name')
 | 
			
		||||
            sys.exit()
 | 
			
		||||
    if activateAccount(baseDir,nickname,domain):
 | 
			
		||||
        print('Account for '+handle+' was activated')
 | 
			
		||||
    else:
 | 
			
		||||
        print('Deactivated account for '+handle+' was not found')
 | 
			
		||||
    sys.exit()
 | 
			
		||||
 | 
			
		||||
if args.changepassword:
 | 
			
		||||
    if len(args.changepassword)!=2:
 | 
			
		||||
        print('--changepassword [nickname] [new password]')
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue