Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######
- """
- How to use
- 1) Login into the user account.
- 2) You will have full access to his account.
- 3) You can change everyone's / view passwords and emails and all that stuff.
- 4) I recommend that you only view them and not delete them but the admins will notice
- That's it! Enjoy!
- WARNING : I am NOT responsible how you use this data. Some users just want it to view the 29k + users Emails and passwords and gain themselves money, again, I AM NOT RESPONSIBLE HOW YOU USE THIS DATA!
- """
- ######
- username = input("Username : ") # ADMIN USERNAME IN TXT FILE
- password = input("Password : ") # ADMIN PASSWORD IN TXT FILE
- pp = pprint.PrettyPrinter()
- numbers = [] # Store ALL user's usernames position
- #This function will get positions
- def get_numbers(reset_function):
- global numbers,numbers_paswd
- if reset_function == "yes":
- numbers = []
- paswd_numbers = []
- else:
- pass
- for position,item in enumerate(sheet.col_values(1)):
- if item == username:
- numbers.append(int(position))
- numbers_paswd = [] # Store all user's password to compare
- for paswd_position,pasw_item in enumerate(sheet.col_values(2)):
- if pasw_item == password:
- numbers_paswd.append(int(paswd_position))
- get_numbers (reset_function = 'no')
- # Little check
- if numbers == numbers_paswd:
- print ("Logged in!")
- else:
- print ("The login info didn't work. Please check your username and password.")
- raise SystemExit("Incorrect information.")
- # ------------------------------------------------- #
- ##### _____________________________________________
- # ~~ // !! START OF USER UNPACKING DATA !! \\ ~~ #
- ##### _____________________________________________
- # ------------------------------------------------- #
- user_data = []
- def get_data(reset_function):
- global user_data, numbers, amounts
- if reset_function == 'yes':
- user_data = []
- get_numbers (reset_function = 'yes')
- else:
- pass
- # // Will now user numbers to get specific user data \\ #
- # how many dups there is
- amounts = len(numbers)
- # Where it will store all data
- for x in range(amounts):
- position_table = (numbers[0]) # Will always stay 0 because the number that is used is being removed.
- # Get table
- Specific_User = sheet.row_values(position_table+1) # It's position_table + 1 because in the database it's always 1 number behind.
- # Insert first value
- user_data.append(Specific_User)
- # Remove the data that was already inserted
- numbers.remove(position_table)
- get_data(reset_function = 'no')
- # user_data - contains list of user stored records.
- # // unpacking data \\ #
- print ("Unpacking Data...")
- account_number = 0
- current_number = -1
- def print_data(reset_function):
- global account_number,current_number
- if reset_function == "no":
- pass
- elif reset_function == "yes":
- account_number = 0
- current_number = -1
- get_data(reset_function = 'yes')
- for y in range(len(user_data)):
- account_number +=1
- current_number +=1
- account_name = (user_data[current_number][2])
- account_password = (user_data[current_number][3])
- account_website = (user_data[current_number][4])
- account_note = (user_data[current_number][5])
- print ("---------------------------\nRECORD {0} : \nAccount : {1}\nPassword : {2}\nWebsite : {3}\nNote : {4}\n---------------------------".format(
- account_number,
- account_name,
- account_password,
- account_website,
- account_note))
- print_data(reset_function = 'no')
- print ("You have {0} account(s) stored.".format(len(user_data)))
- # ------------------------------------------------- #
- ##### _____________________________________________
- # ~~ // !! END OF USER UNPACKING DATA !! \\ ~~ #
- ##### _____________________________________________
- # ------------------------------------------------- #
- # ------------------------------------------------- #
- ##### _____________________________________________
- # ~~ // !! START OF UPDATING DATA !! \\ ~~ #
- ##### _____________________________________________
- # ------------------------------------------------- #
- def question()
- global _choice_
- _choice_ = input("1 - Update Data\n> ")
- def update_cell(value,y,x,new_data):
- global print_data
- update = value
- try:
- update_to = new_data
- try:
- sheet.update_cell(y,x, update_to)
- except Exception as update_error:
- print (update_error)
- print ("The data was changed!")
- print_data(reset_function = 'yes')
- question()
- except Exception as error_finding:
- print (error_finding)
- print ("Sorry, that value couldn't be found! or the program ran into an error")
- question()
- question()
- if _choice_ == "1":
- original = input ("What would you like to change? : ")
- print ("Finding data...")
- try:
- cell = sheet.find(original)
- row = cell.row
- col = cell.col
- print ("Found!")
- new = input(f"RECORD BEING CHANGED : {original}\nWhat would you like to change it to? : ")
- update_cell(original,row,col,new)
- except:
- print ("Failed! couldn't find the data.")
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement