3 import ext.crud as crud
\r
5 import ext.pyperclip.__init__ as pyperclip
\r
6 import webbrowser,pickle
\r
7 import os,subprocess,getpass
\r
8 import ext.x64.x64_encoding as x64
\r
10 from ext.pyftpdlib.authorizers import DummyAuthorizer
\r
11 from ext.pyftpdlib.handlers import FTPHandler
\r
12 from ext.pyftpdlib.servers import FTPServer
\r
16 def authorizer_def():
\r
18 authorizer = DummyAuthorizer()
\r
23 #---------------------------------------------------------------------------------------#
\r
26 return socket.gethostbyname(socket.gethostname())
\r
28 #---------------------------------------------------------------------------------------#
\r
31 global server,FTP_DIRECTORY,status,users_count,annonimus
\r
34 annonimus=anonim.get()
\r
36 handler = FTPHandler
\r
37 handler.authorizer = authorizer
\r
38 handler.banner = 'Servidor FTP Listo'
\r
39 handler.passive_ports = range(60000, 65535)
\r
40 address = (ip_var.get(), port.get())
\r
41 server = FTPServer(address, handler)
\r
43 server.max_cons = 256
\r
44 server.max_cons_per_ip = 5
\r
47 ftp_name=textwrap.wrap(FTP_DIRECTORY,60)
\r
52 web=Label(text="ftp://"+ip_var.get()+":"+str(port.get()),relief="sunken",justify="center",bg=color,fg=color2,width=53)
\r
53 pyper=Button(text="Copiar",command=lambda:pyperclip.copy("ftp://"+ip_var.get()+":"+str(port.get())),bg=color,fg=color2,overrelief="sunken",width=25)
\r
54 pyper2=Button(text="Abrir navegador",command=lambda:webbrowser.open("ftp://"+ip_var.get()+":"+str(port.get())),bg=color,fg=color2,overrelief="sunken",width=25)
\r
56 root.geometry("620x710")
\r
57 pyper.place(x=120,y=620)
\r
58 pyper2.place(x=312,y=620)
\r
59 web.place(x=120,y=590)
\r
60 messagebox.showinfo("Ftp","El servidor inicio correctamente")
\r
61 server.serve_forever()
\r
63 pyper.place_forget()
\r
64 pyper2.place_forget()
\r
67 root.geometry("620x610")
\r
68 #No se asusten este error es para matar el hilo š¤£š¤£š¤£
\r
74 print(ipauth.get(),12)
\r
75 if ipauth.get()=="1":
\r
76 ip_var.set(ip_def())
\r
80 except OSError as error:
\r
81 if ipauth.get()=="0":
\r
82 messagebox.showwarning("IP","La direcciĆ³n IP que puso ya esta en uso, por favor escriba otra.")
\r
84 ftp.config(text="Start Ftp-server",command=ftpstart)
\r
86 port.set(int(port.get())+1)
\r
87 if ip_def()==ip_var.get():
\r
90 messagebox.showwarning("IP","La direcciĆ³n IP que puso ya esta en uso, por favor escriba otra.")
\r
91 ftp.config(text="Iniciar Servidor",command=ftpstart)
\r
96 #---------------------------------------------------------------------------------------#
\r
98 from tkinter import Label,Entry,Tk,Button,StringVar,IntVar,Checkbutton,Menu,Spinbox,Menubutton,PhotoImage
\r
99 from tkinter import messagebox,filedialog
\r
100 import threading,io
\r
107 from ext.color import Color
\r
113 global theme2,color,color2,banner,banner1,banner_name2
\r
115 theme=io.open("configs\\themes\\theme.thm","r")
\r
116 theme2=theme.readlines()
\r
117 print("THEME-NAME: ",theme2[0].rstrip(" \n"))
\r
118 color_class=Color(theme2[1].rstrip(" \n"))
\r
119 color=color_class.get()
\r
121 color2_class=Color(theme2[2].rstrip("\n"))
\r
122 color2=color2_class.get()
\r
123 banner=Color(theme2[3].rstrip("\n"))
\r
124 banner1=Color(theme2[4].rstrip("\n"))
\r
125 banner=banner.get()
\r
126 banner1=banner1.get()
\r
127 banner_name2=theme2[5].rstrip("\n")
\r
131 messagebox.showwarning("ColorError","Uno/s color no esta bien escrito")
\r
132 ifoff=messagebox.askokcancel("Alerta","Se le restablecera el tema")
\r
134 theme=io.open("configs\\themes\\theme.thm","w")
\r
135 theme.write("Photoshop-theme\n#5e5c5c\n#ffffff\n#5e5c5c\n#ffffff\nSERVIDOR FTP V10")
\r
140 os.mkdir("configs")
\r
144 os.mkdir("configs\\themes")
\r
147 theme=io.open("configs\\themes\\theme.thm","w")
\r
148 theme.write("Photoshop-theme\n#5e5c5c\n#ffffff\n#5e5c5c\n#ffffff\nSERVIDOR FTP V10")
\r
150 theme=io.open("configs\\themes\\theme.thm","r")
\r
151 theme2=theme.readlines()
\r
154 color_class=Color(theme2[1].rstrip(" \n"))
\r
155 color=color_class.get()
\r
156 color2_class=Color(theme2[2].rstrip(" \n"))
\r
157 color2=color2_class.get()
\r
158 banner=Color(theme2[3].rstrip("\n"))
\r
159 banner1=Color(theme2[4].rstrip("\n"))
\r
160 banner=banner.get()
\r
161 banner1=banner1.get()
\r
162 banner_name2=theme2[5].rstrip(" \n")
\r
164 print("THEME-NAME: ",theme2[0].rstrip(" \n"))
\r
175 root.geometry("620x610")
\r
176 root.config(bg=color)
\r
177 root.resizable(0,0)
\r
178 root.title("FTP server")
\r
179 root.iconbitmap("image\\logo.ico")
\r
183 global status,t,FTP_USER,FTP_PASSWORD,FTP_DIRECTORY
\r
185 FTP_USER = user.get()
\r
186 FTP_PASSWORD = pass2.get()
\r
187 FTP_DIRECTORY = directory.get()
\r
189 ftp.config(text="Parar servidor",command=ftpstop)
\r
194 t=threading.Thread(target=man)
\r
197 if anonim.get()=="1":
\r
198 Pass.config(show="A")
\r
199 status1.place_forget()
\r
200 User.config(show="A")
\r
202 Pass.config(show="")
\r
203 status1.place(x=245,y=240)
\r
204 t=threading.Thread(target=while_)
\r
206 User.config(show="")
\r
208 user.set(getpass.getuser())
\r
211 ftp.config(text="Iniciar Servidor",command=ftpstart)
\r
216 crud.connect("configs\\cfg.db")
\r
217 if show_.get()=="1" and anonim.get()=="0":
\r
218 Pass.config(show="")
\r
219 crud.update("configs","show","'"+show_.get()+"'","id",1)
\r
220 elif show_.get()=="0" and anonim.get()=="0":
\r
221 Pass.config(show="*")
\r
222 crud.update("configs","show","'"+show_.get()+"'","id",1)
\r
224 if show_.get()=="0":
\r
226 elif show_.get()=="1":
\r
232 annonimus=anonim.get()
\r
234 dire=filedialog.askdirectory(initial=directory.get())
\r
236 directory.set(os.getcwd())
\r
239 directory.set(dire)
\r
241 def pass_auth_def():
\r
242 pass2.set(crud.password(10))
\r
244 crud.connect("configs\\cfg.db")
\r
245 crud.update("configs","cfg_aut",run_open.get(),"id",1)
\r
250 crud.connect("configs\\cfg.db")
\r
251 crud.update("configs","cfg_ann",anonim.get(),"id",1)
\r
256 crud.connect("configs\\cfg.db")
\r
257 crud.update("configs","cfg_ip","'"+ip_var.get()+"'","id",1)
\r
261 crud.connect("configs\\cfg.db")
\r
262 crud.update("configs","cfg_port",port.get(),"id",1)
\r
266 crud.connect("configs\\cfg.db")
\r
267 crud.update("configs","cfg_dir","'"+directory.get()+"'","id",1)
\r
271 crud.connect("configs\\cfg.db")
\r
272 crud.update("configs","cfg_usr","'"+x64.encode_b64_x64(user.get())+"'","id",1)
\r
276 crud.connect("configs\\cfg.db")
\r
277 crud.update("configs","cfg_pass","'"+x64.encode_b64_x64(pass2.get())+"'","id",1)
\r
281 def ip_port_auth():
\r
282 crud.connect("configs\\cfg.db")
\r
283 crud.update("configs","cfg_auth","'"+ipauth.get()+"'","id",1)
\r
288 crud.connect("configs\\cfg.db")
\r
289 crud.update("configs","perm","'"+perm.get()+"'","id",1)
\r
301 global users_count,FTP_USER,FTP_PASSWORD,FTP_DIRECTORY,annonimus,status
\r
302 annonimus=anonim.get()
\r
304 FTP_USER = user.get()
\r
305 FTP_PASSWORD = pass2.get()
\r
306 if FTP_PASSWORD=="":
\r
307 sino=messagebox.askokcancel("NoPassword","A puesto una contraseƱa en blanco,\nQuiere que sea creado un usuario anonimo?")
\r
314 FTP_PASSWORD = pass2.get()
\r
315 FTP_DIRECTORY = directory.get()
\r
316 if FTP_DIRECTORY=="":
\r
317 FTP_DIRECTORY=os.getcwd()
\r
318 directory.set(os.getcwd())
\r
319 if ip_var.get()=="":
\r
324 authorizer.add_anonymous(FTP_DIRECTORY, perm=perm.get())
\r
325 messagebox.showinfo("Usuario aƱadido","El usuario anonimo fue aƱadido con exito\nPermiso:"+perm.get())
\r
326 users_count=users_count+1
\r
328 authorizer.add_user(FTP_USER, FTP_PASSWORD, FTP_DIRECTORY, perm=perm.get())
\r
329 messagebox.showinfo("Usuario aƱadido","El usuario "+user.get()+" fue aƱadido con exito\nPermiso: "+perm.get()+"\n"+"Password: "+"*"*len(pass2.get()))
\r
330 users_count=users_count+1
\r
333 print("ValueError1")
\r
337 authorizer.remove_user(user.get())
\r
338 messagebox.showinfo("Sucess!!","El usuario "+user.get()+" ha sido eliminado correctamente")
\r
340 messagebox.showwarning("UserError","El usuario no existe")
\r
343 authorizer.remove_user(user.get())
\r
349 messagebox.showwarning("UserError","El usuario no existe")
\r
353 ip_var.set(ip_def())
\r
355 directory.set(os.getcwd())
\r
357 pass2.set("ADMIN999.")
\r
358 perm.set("elradfmw")
\r
367 banner_=banner_name2
\r
370 configure.config(bg=color,fg=color2)
\r
371 ftp1.config(bg=color,fg=color2)
\r
372 ayuda.config(bg=color,fg=color2)
\r
373 b1.config(bg=color,fg=color2)
\r
374 b2.config(bg=color,fg=color2)
\r
375 b3.config(bg=color,fg=color2)
\r
376 b4.config(bg=color,fg=color2)
\r
377 b5.config(bg=color,fg=color2)
\r
378 b6.config(bg=color,fg=color2)
\r
379 b7.config(bg=color,fg=color2)
\r
380 b8.config(bg=color,fg=color2)
\r
381 #b9.config(bg=color,fg=color2)
\r
383 l1.config(bg=color,fg=color2)
\r
384 l2.config(bg=color,fg=color2)
\r
385 l3.config(bg=color,fg=color2)
\r
386 l4.config(bg=color,fg=color2)
\r
387 l5.config(bg=color,fg=color2)
\r
388 l6.config(bg=color,fg=color2)
\r
389 l7.config(bg=color,fg=color2)
\r
390 l8.config(bg=color,fg=color2)
\r
391 l9.config(bg=color,fg=color2)
\r
393 c1.config(bg=color,fg=color2,selectcolor=color)
\r
394 c2.config(bg=color,fg=color2,selectcolor=color)
\r
395 c3.config(bg=color,fg=color2,selectcolor=color)
\r
396 c4.config(bg=color,fg=color2,selectcolor=color)
\r
397 ip_ent.config(bg=color,fg=color2)
\r
398 Dir.config(bg=color,fg=color2)
\r
399 Port.config(bg=color,fg=color2,buttonbackground=color)
\r
400 User.config(bg=color,fg=color2)
\r
401 Perm.config(bg=color,fg=color2)
\r
402 Pass.config(bg=color,fg=color2)
\r
403 menu.config(fg=color2,bg=color)
\r
404 ftp.config(bg=color,fg=color2)
\r
405 Banner.config(bg=banner,fg=banner1,text=b23)
\r
406 root.config(bg=color)
\r
407 status1.config(bg=color,fg=color2)
\r
408 def tkinter_config():
\r
409 subprocess.Popen(["pythonw","config.pyw"])
\r
411 #Este error es para matar el hilo no se asusten š¤£
\r
413 def tkinter_init():
\r
414 t2=threading.Thread(target=tkinter_config)
\r
424 banner_=banner_name2
\r
427 if len(banner_)<=23 and banner_!="":
\r
430 b23="Servidor FTP V11"
\r
433 Banner=Label(text=b23,bg=banner,width=25)
\r
434 Banner.config(fg=banner1,font=("Army",19))
\r
435 if len(b23)<=23 and len(b23)>=20:
\r
436 Banner.place(x=105,y=40)
\r
437 elif len(b23)<=20 and len(b23)>16:
\r
438 Banner.place(x=100,y=40)
\r
439 elif len(b23)<=16 and len(b23)>10:
\r
440 Banner.place(x=95,y=40)
\r
441 elif len(b23)<=10 and len(b23)>5:
\r
442 Banner.place(x=105,y=40)
\r
443 elif len(b23)<=5 and len(b23)>3:
\r
444 Banner.place(x=105,y=40)
\r
445 elif len(b23)<=3 and len(b23)>=1:
\r
446 Banner.place(x=105,y=40)
\r
450 #StringVar and IntVar
\r
452 directory=StringVar()
\r
456 portauth=StringVar()
\r
457 run_open=StringVar()
\r
463 annonimus=anonim.get()
\r
464 portauth.set("off")
\r
467 arch=filedialog.asksaveasfile(initialdir=directory.get(),filetypes=(("FTP Config File","*.fcfg"),("Other Config File","*.*")))
\r
471 arch.write(str(ip_var.get())+"\n"+
\r
472 str(port.get())+"\n"+
\r
473 str(directory.get())+"\n"+
\r
474 str(user.get())+"\n"+
\r
475 str(pass2.get())+"\n"+
\r
476 str(perm.get())+"\n"+
\r
477 str(anonim.get())+":"+
\r
478 str(show_.get())+":"+
\r
479 str(ipauth.get())+":"+
\r
480 str(run_open.get()))
\r
483 arch=filedialog.askopenfile(initialdir=directory.get(),filetypes=(("FTP Config File","*.fcfg"),("Other Config File","*.*")))
\r
488 archivo=archivo.readlines()
\r
489 ip_var.set(archivo[0].split(":")[0])
\r
490 port.set(archivo[0].split(":")[1].replace("\n",""))
\r
491 directory.set(archivo[1].replace("\n",""))
\r
492 user.set(archivo[2].split(":")[0].replace("\n",""))
\r
493 pass2.set(archivo[3].replace("\n",""))
\r
494 perm.set(archivo[2].split(":")[1].replace("\n",""))
\r
495 anonim.set(archivo[4].split(":")[0].replace("\n",""))
\r
496 show_.set(archivo[4].split(":")[1].replace("\n",""))
\r
497 ipauth.set(archivo[4].split(":")[2].replace("\n",""))
\r
498 run_open.set(archivo[4].split(":")[3].replace("\n",""))
\r
503 l1=Label(text="__________________________________________________________________________",justify="left",bg=color,fg=color2)
\r
504 l1.place(y=310,x=120)
\r
505 l2=Label(text="__________________________________________________________________________",justify="left",bg=color,fg=color2)
\r
506 l2.place(y=570,x=120)
\r
507 l3=Label(text="IP",bg=color,fg=color2)
\r
508 l3.place(x=170,y=100)
\r
509 l4=Label(text=":",font=("Arial",15),bg=color,fg=color2)
\r
510 l4.place(x=362,y=93)
\r
511 l5=Label(text="P",bg=color,fg=color2)
\r
512 l5.place(x=357,y=179)
\r
513 l6=Label(text="Directorio",bg=color,fg=color2)
\r
514 l6.place(x=170,y=140)
\r
515 l7=Label(text="User",bg=color,fg=color2)
\r
516 l7.place(x=170,y=180)
\r
517 l8=Label(text="Password",bg=color,fg=color2)
\r
518 l8.place(x=170,y=220)
\r
519 l9=Label(text="__________________________________________________________________________",justify="left",bg=color,fg=color2)
\r
520 l9.place(y=395,x=120)
\r
522 c1=Checkbutton(text="Ejecutar servidor al abrir",variable=run_open,onvalue="1",offvalue="0",command=aut,bg=color,fg=color2,overrelief="sunken",selectcolor=color,anchor="w",width=18)
\r
523 c1.place(y=370,x=150)
\r
524 c2=Checkbutton(text="IP y Puerto AutomƔticos",variable=ipauth,onvalue=1,offvalue=0,bg=color,command=ip_port_auth,fg=color2,overrelief="sunken",selectcolor=color,anchor="w",width=18)
\r
525 c2.place(x=315,y=340)
\r
526 c3=Checkbutton(text="Mostrar contraseƱa",variable=show_,onvalue=1,offvalue=0,command=show,bg=color,fg=color2,overrelief="sunken",selectcolor=color,anchor="w",width=18)
\r
527 c3.place(y=370,x=315)
\r
528 c4=Checkbutton(text="Anonimo",variable=anonim,onvalue=1,offvalue=0,command=ann,bg=color,fg=color2,overrelief="sunken",selectcolor=color,anchor="w",width=18)
\r
529 c4.place(y=340,x=150)
\r
531 ftp=Button(text="Iniciar Servidor",command=ftpstart,bg=color,fg=color2,overrelief="sunken")
\r
532 ftp.place(x=260,y=280)
\r
533 b1=Button(text="Seleccionar Directorio",command=lambda:selecdir(),bg=color,fg=color2,width=20,overrelief="sunken")
\r
534 b1.place(x=155,y=460)
\r
535 b2=Button(text="Guardar cambios",command=lambda:save_all(),bg=color,fg=color2,width=20,overrelief="sunken")
\r
536 b2.place(x=155,y=490)
\r
537 b3=Button(text="AƱadir usuario",command=lambda:newuser(),bg=color,fg=color2,width=20,overrelief="sunken")
\r
538 b3.place(x=320,y=460)
\r
539 b4=Button(text="Resetear cambios",command=lambda:reset(),bg=color,fg=color2,width=20,overrelief="sunken")
\r
540 b4.place(x=320,y=490)
\r
541 b5=Button(text="Actualizar usuario",command=lambda:actualizar(),bg=color,fg=color2,width=20,overrelief="sunken")
\r
542 b5.place(x=155,y=520)
\r
543 b6=Button(text="Eliminar usuario",command=lambda:remove(),bg=color,fg=color2,width=20,overrelief="sunken")
\r
544 b6.place(x=320,y=520)
\r
545 b7=Button(text="Usuario de PC",command=user_auth,bg=color,fg=color2,overrelief="sunken",width=20)
\r
546 b7.place(y=430,x=155)
\r
547 b8=Button(text="Crear ContraseƱa",command=pass_auth_def,bg=color,fg=color2,overrelief="sunken",width=20)
\r
548 b8.place(y=430,x=320)
\r
549 b9=Button(text="Cargar FCFG",command=analsis,bg=color,fg=color2,overrelief="sunken",width=20)
\r
550 b9.place(y=550,x=155)
\r
551 b10=Button(text="Exportar FCFG",command=save_an,bg=color,fg=color2,overrelief="sunken",width=20)
\r
552 b10.place(y=550,x=320)
\r
556 abc=Menubutton(fg=color2,bg=color,text="Editar",font=("ARial",10))
\r
558 abc1=Menubutton(fg=color2,bg=color,text="Servidor",font=("ARial",10))
\r
559 abc1.place(x=50,y=5)
\r
560 abc2=Menubutton(fg=color2,bg=color,text="Ayuda",font=("ARial",10))
\r
561 abc2.place(x=110,y=5)
\r
563 menu=Menu(abc,tearoff=0)
\r
564 menu1=Menu(abc1,tearoff=0)
\r
565 menu2=Menu(abc2,tearoff=0)
\r
568 abc.config(menu=menu)
\r
569 abc1.config(menu=menu1)
\r
570 abc2.config(menu=menu2)
\r
572 menu.config(fg=color2,bg=color)
\r
573 menu1.config(fg=color2,bg=color)
\r
574 menu2.config(fg=color2,bg=color)
\r
576 configure=Menu(menu,tearoff=0,fg=color2,bg=color)
\r
578 #menu.add_cascade(label="Editar",menu=menu)
\r
579 #ftp1=Menu(menu,tearoff=0,fg=color2,bg=color)
\r
581 ftp1.add_command(label="Iniciar servidor",command=lambda:ftpstart())
\r
582 ftp1.add_command(label="Parar servidor",command=lambda:ftpstop())
\r
583 ftp1.add_separator()
\r
584 ftp1.add_command(label="Cerrar APP",command=lambda:root.destroy())
\r
585 #menu.add_cascade(label="Servidor",menu=ftp1)
\r
587 #ayuda=Menu(menu,tearoff=0,fg=color2,bg=color)
\r
589 ayuda.add_command(label="Puntuar app",command=lambda:subprocess.Popen(["pythonw","ext\\puntua.py"]))
\r
590 ayuda.add_command(label="Acerca de...",command=lambda:subprocess.Popen(["pythonw","ext\\acerca_de.py"]))
\r
591 ayuda.add_separator()
\r
592 ayuda.add_command(label="IP",command=lambda:subprocess.Popen(["pythonw","ext\\Ftp_help.py"]))
\r
593 ayuda.add_command(label="Directorio",command=lambda:subprocess.Popen(["pythonw","ext\\Ftp_help1.py"]))
\r
594 ayuda.add_command(label="Usuario",command=lambda:subprocess.Popen(["pythonw","ext\\Ftp_help2.py"]))
\r
595 ayuda.add_command(label="Permisos",command=lambda:subprocess.Popen(["pythonw","ext\\Ftp_help3.py"]))
\r
596 #menu.add_cascade(label="Ayuda",menu=ayuda)
\r
597 menu.add_command(label="ConfiguraciĆ³n",command=tkinter_init)
\r
600 menu.config(fg=color2,bg=color)
\r
601 root.config(menu=menu)
\r
602 configure=Menu(menu,tearoff=0,fg=color2,bg=color)
\r
603 menu.add_cascade(label="Editar",menu=configure)
\r
604 ftp1=Menu(menu,tearoff=0,fg=color2,bg=color)
\r
605 ftp1.add_command(label="Iniciar servidor",command=lambda:ftpstart())
\r
606 ftp1.add_command(label="Parar servidor",command=lambda:ftpstop())
\r
607 ftp1.add_separator()
\r
608 ftp1.add_command(label="Cerrar APP",command=lambda:root.destroy())
\r
609 menu.add_cascade(label="Servidor",menu=ftp1)
\r
610 ayuda=Menu(menu,tearoff=0,fg=color2,bg=color)
\r
611 ayuda.add_command(label="Puntuar app",command=lambda:subprocess.Popen(["pythonw","ext\\puntua.pyw"]))
\r
612 ayuda.add_command(label="Acerca de...",command=lambda:subprocess.Popen(["pythonw","ext\\acerca_de.pyw"]))
\r
613 ayuda.add_separator()
\r
614 ayuda.add_command(label="IP",command=lambda:subprocess.Popen(["pythonw","ext\\Ftp_help.pyw"]))
\r
615 ayuda.add_command(label="Directorio",command=lambda:subprocess.Popen(["pythonw","ext\\Ftp_help1.pyw"]))
\r
616 ayuda.add_command(label="Usuario",command=lambda:subprocess.Popen(["pythonw","ext\\Ftp_help2.pyw"]))
\r
617 ayuda.add_command(label="Permisos",command=lambda:subprocess.Popen(["pythonw","ext\\Ftp_help3.pyw"]))
\r
618 menu.add_cascade(label="Ayuda",menu=ayuda)
\r
619 configure.add_command(label="ConfiguraciĆ³n",command=tkinter_init)
\r
621 ip_ent=Entry(textvariable=ip_var,bg=color,fg=color2,width=16)
\r
622 Port=Spinbox(justify="center",textvariable=port,width=8,bg=color,fg=color2,to=9999,buttonbackground=color)
\r
623 Dir=Entry(textvariable=directory,width=29,bg=color,fg=color2)
\r
624 Dir.place(x=260,y=140)
\r
625 User=Entry(textvariable=user,width=15,bg=color,justify="center",fg=color2)
\r
626 Perm=Entry(textvariable=perm,width=10,bg=color,justify="center",fg=color2)
\r
627 Pass=Entry(textvariable=pass2,width=29,justify="center",bg=color,fg=color2)
\r
628 Port.place(x=375,y=100)
\r
629 User.place(x=260,y=180)
\r
630 Perm.place(x=375,y=180)
\r
631 ip_ent.place(x=260,y=100)
\r
632 Pass.place(x=260,y=220)
\r
634 status1=Label(text="password",fg=color2,bg=color,width=29,justify="center")
\r
635 status1.place(x=245,y=240)
\r
638 global pass2_status,pass2
\r
641 if pass2_status==pass2.get() and anonim.get()=="0":
\r
643 elif anonim.get()=="1":
\r
645 #Este error es para matar el hilo no se asusten š¤£
\r
647 pass2_status=pass2.get()
\r
648 status1.config(text=crud.check_password_potential(pass2.get()))
\r
649 t=threading.Thread(target=while_)
\r
652 #Llamadas a funciones necesarias
\r
655 os.mkdir("configs")
\r
658 crud.connect("configs\\cfg.db")
\r
661 crud.runcode("""CREATE TABLE configs(
\r
662 id INTEGER PRIMARY KEY AUTOINCREMENT,
\r
675 crud.create("configs","NULL,FALSE,TRUE,'"+ip_def()+"',2121,"+"'"+os.getcwd()+"'"+",'"+x64.encode_b64_x64("admin")+"','"+x64.encode_b64_x64("admin")+"','off',1,'elradfmw'")
\r
677 read_db=crud.read("configs")
\r
679 b64=read_db[0][6],read_db[0][7]
\r
680 b64=x64.decode_list_x64(b64)
\r
682 run_open.set(str(read_db[0][1]))
\r
683 anonim.set(str(read_db[0][2]))
\r
685 ip_var.set(read_db[0][3])
\r
687 port.set(read_db[0][4])
\r
689 directory.set(read_db[0][5])
\r
694 show_.set(read_db[0][8])
\r
696 ipauth.set(read_db[0][9])
\r
699 perm.set(read_db[0][10])
\r
704 read_db=crud.read("configs")
\r
706 b64=read_db[0][6],read_db[0][7]
\r
707 b64=x64.decode_list_x64(b64)
\r
709 run_open.set(str(read_db[0][1]))
\r
710 anonim.set(str(read_db[0][2]))
\r
712 ip_var.set(read_db[0][3])
\r
714 port.set(read_db[0][4])
\r
716 directory.set(read_db[0][5])
\r
721 show_.set(read_db[0][8])
\r
723 ipauth.set(read_db[0][9])
\r
726 perm.set(read_db[0][10])
\r
736 if run_open.get()=="1":
\r
739 print(run_open.get())
\r
750 class HoverButton(Button):
\r
751 def __init__(self, master, **kw):
\r
752 Button.__init__(self,master=master,**kw)
\r
753 self.defaultBackground = self["background"]
\r
754 self.bind("<Enter>", self.on_enter)
\r
755 self.bind("<Leave>", self.on_leave)
\r
757 def on_enter(self, e):
\r
758 self["background"] = self["activebackground"]
\r
760 def on_leave(self, e):
\r
761 self["background"] = self.defaultBackground
\r
763 #b9=HoverButton(root,text="x",fg=color2,bg=color,command=close_app,height=1,width=4,font=("Arial",15),relief="flat",overrelief="flat",highlightcolor=Color("red").get(),activebackground=Color("red_strong").get(),activeforeground="#ffffff")
\r
764 #print(b9.config())
\r
765 #b9.place(y=0,x=566)
\r
766 #root.overrideredirect(1)
\r
767 root.protocol('WM_DELETE_WINDOW',close_app)
\r