-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand_panel.py
More file actions
86 lines (83 loc) · 3.05 KB
/
command_panel.py
File metadata and controls
86 lines (83 loc) · 3.05 KB
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
import os
import time
import platform
import webbrowser
import subprocess
from __init__ import *
access = False
try:
with open('root.json', mode='r') as f:
data = json.load(f)
rName = data['user']
rPass = data['pass']
name = input('Input username: ')
if name == rName:
passw = input('Input password: ')
if passw == rPass:
access = True
print('Logging into subproces...')
time.sleep(3)
else:
print('Password is not correct')
else:
print('User is not matched')
except:
print('You do not have super-user')
if access:
def fw_delete(item):
if item == 'table':
tableName = input('Table name: ')
delete.table.params('{}'.format(tableName), confirm=True)
elif item == 'database':
dbName = input('Database name: ')
delete.database.params('{}'.format(dbName), confirm=True)
elif item == 'user':
os.remove('root.json')
print('User removed')
def fw_create(item):
if item == 'table':
tableName = input('Table name: ')
columnCount = input('Columns: ')
create.table.params('{}'.format(tableName), '{}'.format(columnCount))
elif item == 'database':
dbName = input('Database name: ')
create.database.params('{}'.format(dbName))
elif item == 'user':
with open('root.json', mode='w') as f:
dict = {}
dict['user'] = input('Username: ')
dict['pass'] = input('Password: ')
json.dump(dict, f)
print('User created')
def show(item):
if item == 'docs':
webbrowser.open('http://scgofficial.esy.es/UsefulDB/')
elif item == 'folder':
path = os.getcwd()
print(os.listdir(path))
elif item == 'mangas': #top secret
webbrowser.open('http://scgofficial.esy.es/mangas/')
elif item == 'author':
print('Elisey Sharov. Rostov-on-Don, Russian Federation')
elif item == 'info':
info = platform.machine()
now = datetime.datetime.now()
pyversion = platform.python_version()
opersyst = platform.system()
print('UsefulDB {};\n'.format(VERSION)
+ 'Python {};\n'.format(pyversion)
+ 'Machine {};\n'.format(info)
+ 'OS {};\n'.format(opersyst)
+ 'Config [use = {}];\n'.format(USE)
+ 'Internet-connection: {};\n'.format(NET)
)
else:
print('Function do not have attr {}. Here is contain args: docs, folder, author')
print('Now, you can do anything, if you have knowledge about Python. Full free')
while access:
code = input('$ ')
time.sleep(2)
eval(code)
else:
print('You do not have access to this panel')
pass