repl.it
@1Ethan/

BasicAdminSystem

Python

"BasicAdminSystem" with a basic login page.

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
admin# @1Ethan's BasicLoginSystem
# Feel free to pick out pieces within this code
# Raise exception is the only way to stop a program in RepL.it, looks messy but meh.
# This program has pretty much got 2 validation levels
# the passcodes at the start are just there as a reminder to those editing/copying..
# ..the script to what the correct inputs are
# ALL the time.sleep commands are not needed, just makes it look more "genuine"

import time
import sys

# "Passcode" is actually just a simple reminder of what the correct inputs are...
passcode1 = "admin"
passcode2 = "user"
# Code "starts" here
print("Welcome to Ethan's Basic Login System.")
print("-----------------------------------------------")
time.sleep(.4)
entry = input("What is the passcode/password? ")
time.sleep(.9)
print("-----------------------------------------------")
# Fancy typing effect, not needed, again looks more "genuine"
typing = "Please wait whilst these details are compared to those in our database.."
for char in typing:
    time.sleep(0.05)
    sys.stdout.write(char)
    sys.stdout.flush()

# Can be removed, not needed, again looks more "genuine"
time.sleep(.3)
print("\n...")
time.sleep(.3)
print("...")
time.sleep(.3)
print("...")
time.sleep(.3) #,of

# Validation level, making sure user has entered the correct data.
if entry == "admin":
  print("Welcome to the system, you have level 1 permissions.")
  permission = "admin"
elif entry == "user":
  print("Welcome to the system, you have level 0 permissions.")
  permission = "user"
else:
  print("You have entered the incorrect passcode/password, program terminating for security purposes.")
  print(entry, "is not a valid passcode/password!")
  time.sleep(1)
  raise Exception('Program terminated, you have entered the incorrect passcode/password.')
# Raise exception is the only way to stop a program in RepL.it, looks messy but meh.
# "else:" is a failsafe, the user only gets 1 attempt
time.sleep(.7)

# Another validation level, the "user" permission has no permissions, so terminates program if entered at start.
if permission == "user":
  print("This system is currently under development and you have no basic permissions so will now terminate, sorry!")
  time.sleep(3)
  raise Exception('Program stopping, you have finished the program.')
elif permission == "admin":
  print("You have full permissions over the system, please wait whilst we load the options.")
else:
  raise Exception('Program stopping, you have finished the program.')
time.sleep(2)
program = input("Which of the following would you like to load? (Enter the number next to the command) \n 1.Admin.exe \n 2.Setup.exe \n 3.KillProgram.exe ")

if program == "1":
  print("You have chosen to run Admin.exe")
elif program == "2":
  print("You have chosen to run Setup.exe")
  print("The program finishes here, trying selecting some other options...")
elif program == "3":
  print("You have chosen to run KillProgram.exe \nThe program will now terminate.:(")
  time.sleep(2)
  raise Exception('Program has been terminated as per requested.')
elif program == "terraria":
  print("WAAAAAAAAAAAH")
  time.sleep(2)
  raise Exception('Program terminating, Monty got too upset and ripped the router out of the wall...')
elif program == "1999":
  print("PRINCE IS THE BEST, WOOHOO.")
  time.sleep(2)
  print("Okay, the program is now being terminated, bye...")
  time.sleep(2)
  raise Exception('Program has been terminated, PRINCE IS THE BEST....')
else:
  print("You have entered an invalid number, for security purposes the program will now be terminated. :(")
  time.sleep(2)
  raise Exception('Program terminating, you have entered invalid data corresponding to the executable scripts.')
time.sleep(1.5)

if program == "1":
  print("The WHOLE program finishes here, thanks for testing/using my script - Ethan. :)")
  time.sleep(1)
  raise Exception('The WHOLE program finishes here, thanks for testing/using my script - Ethan.')
else:
  print("The WHOLE program finishes here, thanks for testing/using my script - Ethan. :)")
  time.sleep(1)
  raise Exception('The WHOLE program finishes here, thanks for testing/using my script - Ethan.')












Fetching token
?