Skip to content

Commit

Permalink
Merge branch '07sumit1002:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
snehhhcodes authored Oct 5, 2024
2 parents e25cdd1 + f656175 commit b39bbc2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
23 changes: 22 additions & 1 deletion DBSetup/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,27 @@ def main():
time.sleep(1)
sys.exit(0)

# Function to securely fetch MySQL password from user with asterisk masking
def get_mysql_password():
print(Fore.YELLOW + "Enter your MySQL Password: " + Fore.RESET, end='', flush=True)
password = ''
while True:
key = keyboard.read_event()
if key.event_type == keyboard.KEY_DOWN:
if key.name == 'enter':
print() # Move to the next line after pressing enter
break
elif key.name == 'backspace':
if password:
password = password[:-1] # Remove last character from password
print('\b \b', end='', flush=True) # Erase the last asterisk
elif key.name in ('space', 'tab'):
continue # Ignore space and tab
else:
password += key.name # Add the character to the password
print('*', end='', flush=True) # Print an asterisk for masking

return password

# Placeholder function for setting up database from scratch
def setup_database_from_scratch():
Expand Down Expand Up @@ -155,5 +176,5 @@ def reset_database():
print(Fore.GREEN + "Database Reset complete." + Fore.RESET)

if __name__ == "__main__":
passwd = input(Fore.YELLOW + "Enter your MySQL Password: " + Fore.RESET)
passwd = get_mysql_password() # Using custom function for password input
main()
16 changes: 13 additions & 3 deletions serv.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,43 @@ header h1 {
}

nav {
padding: 0px 0;
padding:0px 0;
position: relative;
left: 55px;
top: -55px;


}

nav ul {

list-style: none;
margin: 0;
margin:0;
padding: 0;
display: flex;
justify-content: center;

}

nav ul li {
margin: 0 15px;
margin: 0 20px;

}

nav a:hover {
background: rgb(231, 223, 223);
padding-block:6px;
padding-inline: 9px;
border-radius: 2px;
}

nav ul li a {
color: #000000;
text-decoration: none;
font-size: 1rem;
transition: color 0.3s;
padding-block:6px;
padding-inline: 9px;
}

/* nav ul li a:hover {
Expand Down

0 comments on commit b39bbc2

Please sign in to comment.