예제 #1
0
def debug_menu():
    menu = [
        'DEBUG MENU\n', '1. SOAP - View user folder list',
        '2. SOAP - View user address book list',
        '3. SOAP - getUserListRequest', '4. View verifyUser data',
        '5. View variables', '\n     0. Quit'
    ]
    logger.info("Running DEBUG menu!")

    available = build_avaialbe(menu)
    loop = True
    while loop:
        show_menu(menu)
        choice = get_choice(available)
        if choice == '1':
            logger.info("DEBUG MENU: Checking SOAP folder check")
            userConfig = ds.verifyUser()[0]
            if userConfig['name'] is not None:
                pydoc.pager(str(dsSOAP.soap_checkFolderListTEST(userConfig)))

        elif choice == '2':
            logger.info("DEBUG MENU: Checking SOAP address book check")
            userConfig = ds.verifyUser()[0]
            if userConfig['name'] is not None:
                pydoc.pager(
                    str(dsSOAP.soap_checkAddressBookListTEST(userConfig)))

        elif choice == '3':
            gw_location = "%(sSecure)s://%(gListenAddress)s:%(sPort)s/soap" % glb.gwConfig
            info = "Trusted Name: %s\nTrusted Key: %s\nAddress: %s\n\n" % (
                glb.trustedConfig['name'], glb.trustedConfig['key'],
                gw_location)
            info += str(dsSOAP.soap_getUserList())
            pydoc.pager(info)

        elif choice == '4':
            logger.info("DEBUG MENU: Running verifyUser()")
            for user in ds.verifyUser():
                print user
                print
            ds.eContinue()
        elif choice == '5':
            logger.info("DEBUG MENU: Listing variables")
            saved_variables = ("Database Config:\n%s\n" % glb.dbConfig)
            saved_variables += ("\nLDAP Config:\n%s\n" % glb.ldapConfig)
            saved_variables += ("\nMobility Config:\n%s\n" %
                                glb.mobilityConfig)
            saved_variables += ("\nGroupWise Config:\n%s\n" % glb.gwConfig)
            saved_variables += ("\nTrusted App Config:\n%s\n" %
                                glb.trustedConfig)
            saved_variables += ("\nConfig Files:\n%s\n" % glb.config_files)
            saved_variables += ("\nWeb Config:\n%s\n" % glb.webConfig)
            saved_variables += ("\nAuth Config:\n%s\n" % glb.authConfig)
            pydoc.pager(saved_variables)

        elif choice == '0':
            loop = False
            ds.clear()
            return
예제 #2
0
def groupwiseChecks_menu():
	menu = ['1. Check user over SOAP', '2. Check GroupWise folder structure', '\n     3. Count user shared folders', '4. Count all users shared folders', '\n     0. Back']

	available = build_avaialbe(menu)
	loop = True
	while loop:
		show_menu(menu)
		choice = get_choice(available)
		if choice == '1':
			userConfig = ds.verifyUser(dbConfig)[0]
			if userConfig['name'] != None:
				if userConfig['type'] != 'group':
					dsSOAP.soap_printUser(trustedConfig, gwConfig, userConfig)
				else:
					print ("Input '%(name)s' is not a user. Type='%(type)s'" % userConfig)
				print; ds.eContinue()

		elif choice == '2':
			dsSOAP.soap_checkFolderList(trustedConfig, gwConfig, ds.verifyUser(dbConfig)[0])

		elif choice == '3':
			userConfig = ds.verifyUser(dbConfig)[0]
			if userConfig['name'] != None:
				if userConfig['type'] != 'group':
					shared_list = dsSOAP.soap_check_sharedFolders(trustedConfig, gwConfig, userConfig)
					if shared_list is not None:
						pydoc.pager(shared_list)
						if ds.askYesOrNo("Save to file"):
							with open(dsappdata + '/shared_folder_list.txt', 'w') as file:
								file.write(shared_list)
								file.write('\n')
							logger.info("Saving shared list to %s" % (dsappdata + '/shared_folder_list.txt'))
							print ("Saved to %s" % (dsappdata + '/shared_folder_list.txt'))
					print; ds.eContinue()

		elif choice == '4':
			ds.datasyncBanner(dsappversion)
			print ("This can take some time to check every user in mobility")
			if ds.askYesOrNo("Warning! CPU may become busy. Continue"):
				userList = ds.getMobilityUserList(dbConfig)
				shared_list = dsSOAP.soap_check_allSharedFolders(trustedConfig, gwConfig, userList)
				if shared_list is not None:
					pydoc.pager(shared_list)
					if ds.askYesOrNo("Save to file"):
						with open(dsappdata + '/shared_folder_list-allUsers.txt', 'w') as file:
							file.write(shared_list)
							file.write('\n')
						logger.info("Saving shared list to %s" % (dsappdata + '/shared_folder_list-allUsers.txt'))
						print ("Saved to %s" % (dsappdata + '/shared_folder_list-allUsers.txt'))
					print; ds.eContinue()
					
		elif choice == '0':
			loop = False
			return
예제 #3
0
def debug_menu():
	menu = ['DEBUG MENU\n','1. SOAP - View user folder list', '2. SOAP - View user address book list', '3. SOAP - getUserListRequest', '4. View verifyUser data', '5. View variables', '\n     0. Quit']
	logger.info("Running DEBUG menu!")

	available = build_avaialbe(menu)
	loop = True
	while loop:
		show_menu(menu)
		choice = get_choice(available)
		if choice == '1':
			logger.info("DEBUG MENU: Checking SOAP folder check")
			userConfig = ds.verifyUser(dbConfig)[0]
			if userConfig['name'] is not None:
				pydoc.pager(str(dsSOAP.soap_checkFolderListTEST(trustedConfig, gwConfig, userConfig)))

		elif choice == '2':
			logger.info("DEBUG MENU: Checking SOAP folder check")
			userConfig = ds.verifyUser(dbConfig)[0]
			if userConfig['name'] is not None:
				pydoc.pager(str(dsSOAP.soap_checkAddressBookListTEST(trustedConfig, gwConfig, userConfig)))

		elif choice =='3':
			gw_location = "%(sSecure)s://%(gListenAddress)s:%(sPort)s/soap" % gwConfig
			info = "Trusted Name: %s\nTrusted Key: %s\nAddress: %s\n\n" % (trustedConfig['name'], trustedConfig['key'],gw_location)
			info += str(dsSOAP.soap_getUserList(trustedConfig, gwConfig))
			pydoc.pager(info)

		elif choice == '4':
			logger.info("DEBUG MENU: Running verifyUser()")
			for user in ds.verifyUser(dbConfig):
				print user
				print
			ds.eContinue()
		elif choice == '5':
			logger.info("DEBUG MENU: Listing variables")
			saved_variables = ("Database Config:\n%s\n" % dbConfig)
			saved_variables += ("\nLDAP Config:\n%s\n" % ldapConfig)
			saved_variables += ("\nMobility Config:\n%s\n" % mobilityConfig)
			saved_variables += ("\nGroupWise Config:\n%s\n" % gwConfig)
			saved_variables += ("\nTrusted App Config:\n%s\n" % trustedConfig)
			saved_variables += ("\nConfig Files:\n%s\n" % config_files)
			saved_variables += ("\nWeb Config:\n%s\n" % webConfig)
			saved_variables += ("\nAuth Config:\n%s\n" % authConfig)
			pydoc.pager(saved_variables)

		elif choice == '0':
			loop = False
			ds.clear()
			return
예제 #4
0
def remove_device_menu():
    menu = [
        '1. Remove all devices', '2. Remove user devices', '\n     0. Back'
    ]

    available = build_avaialbe(menu)
    loop = True
    while loop:
        show_menu(menu)
        choice = get_choice(available)
        if choice == '1':
            ds.datasyncBanner()
            if ds.askYesOrNo("Remove all users devices"):
                ds.removeDevice()
        elif choice == '2':
            userConfig = ds.verifyUser()[0]
            if ds.confirm_user(userConfig, 'mobility'):
                if ds.askYesOrNo("Remove all devices for %s" %
                                 userConfig['name']):
                    ds.removeDevice(userConfig)
            else:
                ds.eContinue()
        elif choice == '0':
            loop = False
            return
예제 #5
0
def groupwiseChecks_menu():
    menu = [
        '1. Check user over SOAP', '2. Check GroupWise folder structure',
        '\n     3. Count user shared folders',
        '4. Count all users shared folders', '\n     0. Back'
    ]

    available = build_avaialbe(menu)
    loop = True
    while loop:
        show_menu(menu)
        choice = get_choice(available)
        if choice == '1':
            userConfig = ds.verifyUser()[0]
            if userConfig['name'] != None:
                if userConfig['type'] != 'group':
                    dsSOAP.soap_printUser(userConfig)
                else:
                    print("Input '%(name)s' is not a user. Type='%(type)s'" %
                          userConfig)
                print
                ds.eContinue()

        elif choice == '2':
            dsSOAP.soap_checkFolderList(ds.verifyUser()[0])

        elif choice == '3':
            userConfig = ds.verifyUser()[0]
            if userConfig['name'] != None:
                if userConfig['type'] != 'group':
                    shared_list = dsSOAP.soap_check_sharedFolders(userConfig)
                    if shared_list is not None:
                        pydoc.pager(shared_list)
                        if ds.askYesOrNo("Save to file"):
                            with open(
                                    glb.dsappdata + '/shared_folder_list.txt',
                                    'w') as file:
                                file.write(shared_list)
                                file.write('\n')
                            logger.info(
                                "Saving shared list to %s" %
                                (glb.dsappdata + '/shared_folder_list.txt'))
                            print("Saved to %s" %
                                  (glb.dsappdata + '/shared_folder_list.txt'))
                    print
                    ds.eContinue()

        elif choice == '4':
            ds.datasyncBanner()
            print("This can take some time to check every user in mobility")
            if ds.askYesOrNo("Warning! CPU may become busy. Continue"):
                userList = ds.getMobilityUserList()
                shared_list = dsSOAP.soap_check_allSharedFolders(userList)
                if shared_list is not None:
                    pydoc.pager(shared_list)
                    if ds.askYesOrNo("Save to file"):
                        with open(
                                glb.dsappdata +
                                '/shared_folder_list-allUsers.txt',
                                'w') as file:
                            file.write(shared_list)
                            file.write('\n')
                        logger.info("Saving shared list to %s" %
                                    (glb.dsappdata +
                                     '/shared_folder_list-allUsers.txt'))
                        print("Saved to %s" %
                              (glb.dsappdata +
                               '/shared_folder_list-allUsers.txt'))
                    print
                    ds.eContinue()

        elif choice == '0':
            loop = False
            return