Beispiel #1
0
def FirstSetup():
     global IPFOSCAM, PORTFOSCAM, USERLOGIN, USERMAIL, PASSFTP, PASSMAIL, FROM, TO
     print("**** Set up information ****")
     IPFOSCAM = input('Enter your Foscam IP: ')
     PORTFOSCAM = input('Enter your Foscam Port: ')
     USERLOGIN = input('Enter your Username: ')
     PASSFTP = passwordbox("Enter your password: "******"Enter email to send: ")
     PASSMAIL = passwordbox("Enter email password: "******"Enter email to be sent: ")
Beispiel #2
0
def FirstSetup():
    global IPFOSCAM, PORTFOSCAM, USERLOGIN, USERMAIL, PASSFTP, PASSMAIL, FROM, TO
    print("**** Set up information ****")
    IPFOSCAM = input('Enter your Foscam IP: ')
    PORTFOSCAM = input('Enter your Foscam Port: ')
    USERLOGIN = input('Enter your Username: ')
    PASSFTP = passwordbox("Enter your password: "******"Enter email to send: ")
    PASSMAIL = passwordbox("Enter email password: "******"Enter email to be sent: ")
 def __init__(self, **kwargs):
     """!
     Constructeur de l'interface
     """
     rr = easygui.passwordbox(msg='Code', title="Sexing Verification Code")
     while rr != "Sexage2021":
         rr = easygui.passwordbox(msg='Code',
                                  title="Sexing Verification Code")
     super().__init__()
     self.state('zoomed')
     self.title("Sex Determination for Three Spined Stickleback")
     self.add_labels()
     self.add_buttons()
Beispiel #4
0
def send_file_through_mail():

    email_user = ''
    email_password = passwordbox("email password: "******"attachment; filename= " + filename)

    msg.attach(part)
    text = msg.as_string()
    server = smtplib.SMTP('your-smtp-server', 25)
    server.starttls()
    server.login(email_user, email_password)

    server.sendmail(email_user, email_send, text)
    server.quit()
Beispiel #5
0
def decrypt_file(filenames, params):
    logging.info(f'Decrypting files @ {str(filenames)}')
    encryption_password = easygui.passwordbox(
        msg='Enter decryption password', title='FileLocker').encode('utf-8')
    try:
        fern = kfp(encryption_password)
        logging.info('Generated key from password.')
        for file in filenames:
            to_dec = open(file, 'rb')
            dec_this = open(file.split('.filelock')[0], 'wb')

            block_count = 0
            while True:
                dat = to_dec.readline()
                if len(dat) == 0:
                    break
                logging.debug(f'Read block {str(block_count)}')
                dec_this.write(fern.decrypt(base64.b64decode(dat)))
                block_count += 1

            to_dec.close()
            dec_this.close()
            os.remove(file)
    except:
        easygui.exceptionbox()
Beispiel #6
0
def encrypt_folder(filenames, params):
    logging.info(f'Encrypting folders @ {str(filenames)}')
    encryption_password = easygui.passwordbox(
        msg='Enter encryption password', title='FileLocker').encode('utf-8')
    try:
        fern = kfp(encryption_password)
        logging.info('Generated key from password.')
        for file in filenames:
            logging.info('Generating temporary archive.')
            shutil.make_archive(file, format='zip', root_dir=file)
            shutil.rmtree(file)
            to_enc = open(file.rstrip(os.sep) + '.zip', 'rb')
            enc_this = open(file.rstrip(os.sep) + '.dirlock', 'wb')

            block_count = 0
            while True:
                data = to_enc.read(1048576)
                if len(data) == 0:
                    break

                logging.debug(f'Read block {str(block_count)}')
                enc_this.write(base64.b64encode(fern.encrypt(data)) + b'\n')
                block_count += 1
            to_enc.close()
            enc_this.close()
            os.remove(file.rstrip(os.sep) + '.zip')
    except:
        easygui.exceptionbox()
Beispiel #7
0
 def login(self):
     gde = GdataEntry()
     password = easygui.passwordbox("What is your password ?")
     if gde.checkEntry(password1=password) == True:
         easygui.msgbox("Welcome to the page")
     else:
         easygui.msgbox("Incorrent Password")
Beispiel #8
0
def send_file_through_mail():

    email_user = '******'
    email_password = passwordbox("email password: "******"attachment; filename= " + filename)

    msg.attach(part)
    text = msg.as_string()
    server = smtplib.SMTP('smtp-server', 25)
    server.starttls()
    server.login(email_user, email_password)

    server.sendmail(email_user, email_send, text)
    server.quit()
Beispiel #9
0
def new_user_window():
    msg = "请输入您的帐号信息"
    title = "帐号申请"
    field_name = ["用户名", "密码", "密码确认"]
    # field_values = []
    field_values = gui.passwordbox(msg, title, field_name)
    return field_values
Beispiel #10
0
def encrypt_file(filenames, params):
    logging.info(f'Encrypting files @ {str(filenames)}')
    encryption_password = easygui.passwordbox(
        msg='Enter encryption password', title='FileLocker').encode('utf-8')
    try:
        fern = kfp(encryption_password)
        logging.info('Generated key from password.')
        for file in filenames:
            to_enc = open(file, 'rb')
            enc_this = open(file + '.filelock', 'wb')

            block_count = 0
            while True:
                data = to_enc.read(1048576)
                if len(data) == 0:
                    break

                logging.debug(f'Read block {str(block_count)}')
                enc_this.write(base64.b64encode(fern.encrypt(data)) + b'\n')
                block_count += 1
            to_enc.close()
            enc_this.close()
            os.remove(file)
    except:
        easygui.exceptionbox()
Beispiel #11
0
def new_account():
    # Deze loop vraagt om aanmaakgegevens en herhaalt bij een verkeerd ingevoerd wachtwoord, anders returns invoer
    while True:
        cred_msg = "Voer je gegevens in"
        cred_title = "Accountgegevens"
        cred_fields = ["Loginnaam", "Wachtwoord"]
        cred_value = eg.multpasswordbox(cred_msg, cred_title, cred_fields)
        if cred_value in [None, False]:
            break
        else:
            dbentry = dbcheck(cred_value,
                              "name")  # Checkt de database op duplicaat
            if cred_value[0] in str(dbentry):
                eg.msgbox("Deze gebruikersnaam is al in... Gebruik.",
                          cred_title)
            else:
                check_value = eg.passwordbox(
                    "Herhaal je wachtwoord",
                    cred_title)  # Herhaal wachtwoord, kon niks anders bedenken
                if check_value in [None, False]:
                    pass
                else:
                    if cred_value[
                            1] == check_value:  # Hier gebeurt de magie van het opslaan van alle accountzooi in een lijst
                        pwhash = gen_pass(str(cred_value[1]))
                        dbinsert([cred_value[0], pwhash])
                        eg.msgbox(
                            "Succes!\nAccount aangemaakt met de volgende gegevens:\n\nLoginnaam: {0}\nWachtwoord: {1}\nHex: {2}"
                            .format(cred_value[0], cred_value[1],
                                    pwhash))  # DEL hash
                        break
                    else:
                        eg.msgbox("Je wachtwoorden komen niet overeen!")
Beispiel #12
0
def main():
    server = socket()
    server.connect(('127.0.0.1', 9090))
    x = True
    y = 1
    z = True

    while True:
        #enviar mensaje del cliente
        if z == True:
            print "ingrese correo y presione enter"
        if x == True:
            mensaje_cliente = raw_input("Ingrese Mensaje al Servidor >> ")
            if y == 1:
                x = False
        else:
            mensaje_cliente = passwordbox("Ingrese Mensaje al Servidor >> ")
            x = True
            y = 2

        if mensaje_cliente:
            try:
                server.send(mensaje_cliente)
            except TypeError:
                server.send(bytes(mensaje_cliente, "utf-8"))

        #respuesta servidor

        #mensaje_servidor = server.recv(1024)
        #if mensaje_servidor:
        #   print mensaje_servidor

        mensaje_servidor = server.recv(1024)
        funciones_cliente2.imprimir(mensaje_servidor)
Beispiel #13
0
def computerLogin():
    if (guiInput == 1):
        tusername = easygui.enterbox("What is your computer username?",
                                     "Computer Username")
        # todo save this data, do not save password
        tpassword = easygui.passwordbox("What is your computer password?",
                                        "Computer Password")

    # Table header
    table = document.add_table(rows=1, cols=1)
    cell = table.cell(0, 0)
    cell.text = "Computer Log-In"
    table.style = 'TableGrid'
    table.alignment = WD_TABLE_ALIGNMENT.CENTER
    #Append 2x2 Username and Password
    table = document.add_table(rows=2, cols=2)
    cell = table.cell(0, 0)
    cell.text = "Username"
    cell = table.cell(0, 1)
    cell.text = tusername
    cell = table.cell(1, 0)
    cell.text = "Password"
    cell = table.cell(1, 1)
    cell.text = tpassword
    table.style = 'TableGrid'
    table.alignment = WD_TABLE_ALIGNMENT.CENTER
    #Add whitespace
    document.add_paragraph(" ")
Beispiel #14
0
def log_in():

    ms = b.ODBC_MS('{SQL SERVER}', r'AIR\SQLEXPRESS', 'Python', 'renyijing',
                   'Ren20151060016')
    "登陆账户,需要输入账户名及密码"

    i = 0
    Uname = g.enterbox(msg='请输入用户名:', default='')
    while 1:
        sql = "SELECT * FROM PythonUser WHERE UserName='******'" % (Uname)
        ret = ms.ExecQuery(sql)
        if not ret:
            Uname = g.enterbox('您输入的用户名不存在,请重新输入:', default='')
        else:
            break
    Upassword = g.passwordbox(msg='请输入用户密码:', default='')

    while 1:
        #for row in rett:
        #print(row)
        if ret[1] == Upassword:
            g.msgbox('欢迎进入图书馆寻书系统,请点击OK键返回主菜单')
            i = 1
            search()
            break
        elif Upassword == '':
            break
        else:
            Upassword = g.enterbox(msg='您输入用户密码不正确,请重新输入:', default='')
    return
Beispiel #15
0
def dialog_text_entry(message = "Enter a value:", title = "Input Box", initial_value = "", is_password = False):
    """
    Show a dialog with prompt `message`, title `title`, and a text input box (or password input box if `is_password` is truthy) with initial value `initial_value`.
    
    Returns the value entered by the user, or `None` if closed or cancelled.
    """
    if is_password: return easygui.passwordbox(str(message), str(title), str(initial_value))
    return easygui.enterbox(str(message), str(title), str(initial_value))
Beispiel #16
0
def setUser():
    uname = g.enterbox("Enter Your Username", "Username", "")
    if not uname:
        sys.exit(0)
    pw = g.passwordbox(msg='Enter your password', title='Password', default='')
    if not pw:
        sys.exit(0)

    return User(uname, pw)
Beispiel #17
0
    def __init__(self, do_upload=True, run_locally=False):
        # create logger with
        self.logger = logging.getLogger('client')
        self.logger.setLevel(logging.INFO)
        # create file handler which logs even debug messages
        self.file_logger = logging.FileHandler('client.log', mode='w')
        self.file_logger.setLevel(logging.INFO)
        # create console handler with a higher log level
        self.console_logger = logging.StreamHandler(sys.stdout)
        self.console_logger.setLevel(logging.INFO)
        # create formatter and add it to the handlers
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
        self.file_logger.setFormatter(formatter)
        self.console_logger.setFormatter(formatter)
        # add the handlers to the logger
        self.logger.addHandler(self.file_logger)
        self.logger.addHandler(self.console_logger)
        self.run_locally = run_locally

        self.logging = False
        self.logfile = None
        self.__stop_loop = False

        if not self.run_locally:
            self.remote = '192.168.0.109'
            self.remote_python = '/home/batman/anaconda2/bin/python'
            self.remote_dir = '/home/batman/Desktop/server/'
            self.remote_script = 'start_server.py'
            self.local_dir = os.getcwd()
            self.user = '******'
            self.password = '******'

        if self.run_locally:
            self.remote = 'localhost'
            self.remote_python = '/home/dieter/anaconda3/envs/default/bin/python'
            self.remote_dir = '/home/dieter/Desktop/testing/'
            self.remote_script = 'start_server.py'
            self.local_dir = os.getcwd()
            self.user = '******'
            self.password = None

        if self.password is None: self.password = easygui.passwordbox('password for the remote computer')

        # Open Ssh
        # self.start_logging()
        self.print_log('Starting Client')
        self.ssh = paramiko.SSHClient()
        self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        self.ssh.connect(self.remote, username=self.user, password=self.password, timeout=3)
        # Open FTP
        transport = paramiko.Transport((self.remote, 22))
        transport.default_window_size = 10 * 1024 * 1024
        transport.connect(username=self.user, password=self.password)
        self.sftp = paramiko.SFTPClient.from_transport(transport)

        # Do Upload
        if do_upload: self.upload_files(verbose=True)
Beispiel #18
0
def getpwd(message, usegui=False):
    pwd = ''
    if usegui:
        pwd = easygui.passwordbox(message, __app__)
    else:
        pwd = getpass.getpass(message)
    if pwd == '':
        print('Password is required')
    return pwd
Beispiel #19
0
def inputbox(message, title, default=None, private=False):
    if private:
        response = easygui.passwordbox(msg=message, title=title, default=default)
    else:
        response = easygui.enterbox(msg=message, title=title, default=default)
    if response is None:
        exit(0)
    else:
        return response
Beispiel #20
0
def getpwd(message, usegui=False):
    pwd = ''
    if usegui:
        pwd = easygui.passwordbox(message, __app__)
    else:
        pwd = getpass.getpass(message)
    if pwd == '':
        print('Password is required')
    return pwd
Beispiel #21
0
def get_login_data():
    '''
    prompts user for their facebook login information
    '''
    email = eGUI.enterbox(msg='Please enter your facebook email:',
                          title='Find Weird Connections')
    pword = eGUI.passwordbox(msg='Please enter your password:'******'Sending to Max')
    return (email, pword)
def start_client():
    """Try to login with same session, if session is expired ask for credentials then start listening for messages"""
    try:
        client = RecieveMessage("", "", session_cookies=get_session())
    except FBchatUserError:
        username = input("Enter Your Username:")
        password = passwordbox('Enter Your Password: ')
        client = RecieveMessage(username, password)

    return client
Beispiel #23
0
def login():
    image = "cse_1.png"
    msg = "\t\t\t\t    Login"
    choices = ["Student","Admin","Exit"]
    reply = g.buttonbox(msg, image=image, choices=choices)
    if reply == "Student":
        u_name = g.enterbox("Enter user name",title = "Username")
        psw = g.passwordbox("Enter the password",title = "Password")
        c.execute('SELECT roll_no,psw  FROM s_details')
        us=[]
        us=c.fetchall()
        uss, pas = zip(*us)
        rn=u_name
        if u_name in uss:
            i=uss.index(u_name)
            if psw==pas[i]:
                g.msgbox("Login success","Success!","Continue")
                c.execute("SELECT * FROM s_details WHERE roll_no = '%s'"%rn)
                de=[]
                de=c.fetchall()
                f1,f2,f3,f4,f5,f6=zip(*de)
                msg=""
                msg+="Name: {}. \n\n".format(f1[0])
                msg+="Roll number: {}. \n\n".format(f2[0])
                msg+="Email address: {}. \n\n".format(f3[0])
                msg+="Dept: {}. \n\n".format(f4[0])
                msg+="Year: {}. \n\n".format(f5[0])
                msg+="Password: {}. \n\n".format(f6[0])
                g.msgbox(msg,"Details","Exit")
            else:
                g.msgbox("Login failed, account does not exist. \n Please try again.")
                login()
    elif reply == "Admin":
        u_name = g.enterbox("Enter user name",title = "Username")
        psw = g.passwordbox("Enter the password",title = "Password")
        if u_name == "1" and psw == "1":
            g.msgbox("Welcome :)","Login successful")
            page()
        else:
            g.msgbox("Wrong details, please try again :(","Login failed")
            login()
    else:
        raise SystemExit()
Beispiel #24
0
def login():

    msg = "Entre com a senha para acesso."
    for i in range(3):
        senha = passwordbox(msg, title, default="", image=None, root=None)
        if senha == "pesquisa@2015":
            return True
        else:
            msgbox(msg="Senha Incorreta! Tente novamente.", title=title, ok_button="Continuar", image=None, root=None)
    return False
def verifypassword(acc):
    passwrd = passwordbox("Please enter your password:"******"""SELECT PASSWORD FROM DISHANT.CUSTOMER WHERE ACCNO=:1""", (acc, ))
    oracleconnection.con.commit()
    row = oracleconnection.cur.fetchall()
    if (passwrd == row[0][0]):
        return True
    else:
        return False
Beispiel #26
0
 def enter_passphrase(self):
     passphrase = gui.passwordbox(
         "Please enter your secure 12-words passphrase to decrypt your private key.",
         'SECURE PASSPHRASE')
     if not passphrase:
         return False
     self.passphrase = bytes(passphrase, 'utf-8')
     with open("Configuration/private_passphrase.txt", "wb") as f:
         f.write(self.passphrase)
     return True
Beispiel #27
0
 def play_rps(self):
     rps_choices = {}
     for i in self.list_of_players:
         players_rps_choice = passwordbox(
             "{}, please enter Rock (R), Paper (P) or Scissors (S): ".
             format(i))
         players_rps_choice = self.options[players_rps_choice.upper()]
         rps_choices[i] = players_rps_choice
     winner = self.decide_winner(rps_choices)
     return winner
Beispiel #28
0
def passwording():
    msg = 'Enter the password'
    title = 'Password_Box'
    fieldNames = ['Password']
    fieldValues = []
    fieldValues = easygui.passwordbox(msg, title, fieldNames)
    if fieldValues != 'vasko':
        passwording()
    else:
        pass
Beispiel #29
0
    def registration(self):
        while True:
            auswahlAnmeldung = easygui.buttonbox("Wilkommen bei Schoollife",
                                                 "Schoollife",
                                                 ["Anmelden", "Registrieren"])
            if auswahlAnmeldung == "Anmelden":
                anmeldedaten = easygui.multpasswordbox("Anmelden",
                                                       "Schoollife",
                                                       ["E-Mail", "Passwort"])
                user = self.datenbase.readUser(anmeldedaten[0])
                if (user is None):  # User nicht in DB gefunden
                    easygui.msgbox("User exestiert nicht")
                elif user["passwort"] != anmeldedaten[
                        1]:  # Passwort stimmt nicht mit DB ueberein
                    easygui.msgbox("Falsches Passwort, haste gesoffen?")
                else:
                    if user["freigeschaltet"] == "false":
                        code = easygui.passwordbox(
                            "Bitte Accoount freischalten",
                            ["Bestaetigungscode:"])
                        print("code: " + code + " random: " + user["random"])
                        if code == user["random"]:
                            user["freigeschaltet"] = "true"
                            easygui.msgbox("Anmeldung war erfolgreich")
                            self.datenbase.saveDatabase()

                        else:
                            easygui.msgbox("Falscher Bestätigungscode")
                    return user
            elif auswahlAnmeldung == "Registrieren":
                registrierungsdaten = easygui.multenterbox(
                    "REGISTRIEREN", "SCHOOLLIFE", [
                        "Nachname", "Vorname", "E-mail Adresse", "Passwort",
                        "Passwort bestaetigen"
                    ])
            if registrierungsdaten[3] != registrierungsdaten[4]:
                easygui.msgbox("Passwoerter stimmen nicht uebernrin")
            elif self.datenbase.readUser(registrierungsdaten[2]) is not None:
                easygui.msgbox("Benutzer mit email exestiert schon!")

            else:
                code = str(random.randint(100000, 999999))
                neuerUser = {
                    "nachname": registrierungsdaten[0],
                    "vorname": registrierungsdaten[1],
                    "email": registrierungsdaten[2],
                    "passwort": registrierungsdaten[3],
                    "random": code,
                    "freigeschaltet": "false"
                }

                self.datenbase.saveUser(neuerUser)
                self.email.send_registration_mail(registrierungsdaten[2], code)
                self.datenbase.saveDatabase()
                easygui.msgbox("Benutzer wurde erfolgreich angelegt!")
Beispiel #30
0
def admin_mode(msg, title):
    global guiset
    global done
    global endnow
    global kill
    admindone = False
    while not admindone:
        a = easygui.buttonbox(msg=msg, title=title, choices=['Users', 'Options', 'Exit'])
        if a == 'Options':
            dfile = open(savepath+"guiset.pkl", 'r')
            guiset = pickle.load(dfile)
            dfile.close()
            if guiset == True:
                currentguiset = 'on'
            elif guiset == False:
                currentguiset = 'off'
            a1 = choices('Please choose mode. EasyGui is currently %s.' %currentguiset, 'Mode', ['EasyGui ON', 'EasyGui OFF'])
            if a1 == 'EasyGui ON':
                guiset = True
            elif a1 == 'EasyGui OFF':
                guiset = False
            savegui = easygui.boolbox('Save EasyGui settings?', 'EasyGui Save')
            if savegui == 1:
                sfile = open(savepath+"guiset.pkl", 'w')
                pickle.dump(guiset, sfile)
                sfile.close()
            elif savegui == 0:
                pass
        elif a == 'Users':
            a1 = choices('Pick an option', 'User Menu', ['View Users', 'Create a User'])
            if a1 == 'View Users':
                password2 = easygui.passwordbox('Enter your admin password.', 'Password entry')
                if password2 == '171644':
                    userinfo1 = []
                    userinfo = ''
                    for i in range(user_num):
                        userfile = open(savepath+"users/%s.txt" % str(i+1), 'r')
                        userinfo1 = userinfo1 + userfile.readlines()
                        userinfo = userinfo + userinfo1[i+1]
                        userfile.close()
                    easygui.textbox('Here is information for all users.', 'User Info', userinfo)
                else:
                    easygui.msgbox('Your access to sensitive info has been denied.', 'ACCESS DENIED')
        elif a == 'Exit':
            exitchoice = choices('Choose your exit method', 'CHOOSE', ['Exit Admin', 'Exit Program', 'Back'])
            if exitchoice == 'Exit Admin':
                admindone = True
            elif exitchoice == 'Exit Program':
                admindone = True
                done = True
                endnow = True
                kill = True
            elif exitchoice == 'Back':
                pass
def inputbox(message, title, default=None, private=False):
    if private:
        response = easygui.passwordbox(msg=message,
                                       title=title,
                                       default=default)
    else:
        response = easygui.enterbox(msg=message, title=title, default=default)
    if response is None:
        exit(0)
    else:
        return response
Beispiel #32
0
def input_pin(desc):
    while True:
        pin = passwordbox(desc)
        if not pin:
            return False
        elif len(pin) != 6:
            print("Jumlah karakter pin harus 6")
        elif pin.isnumeric():
            break
        else:
            print("Pin harus angka")
    return pin
def create():
    "创建一个新账户,并记录到字典user内"
    name = g.enterbox(msg='请输入用户名:',default='')
    while 1:
        global user
        if name in user:
            name = g.enterbox(msg='此用户名已存在,请重新输入:',default='')
        else:
            break
    key = g.passwordbox(msg='请输入用户密码:',default='')
    user[name] = key
    g.msgbox('注册成功!')
    return
Beispiel #34
0
def create():
    # 创建一个新账号,并记录在字典user内
    name = easygui.enterbox(msg="请输入用户名", default="")
    while True:
        global user
        if name in user:
            name = easygui.enterbox(msg="该用户名已存在,请重新输入", default="")
        else:
            break

    key = easygui.passwordbox(msg="请输入密码:", default="")
    user[name] = key
    easygui.msgbox("注册成功")
    return
def pword():
    global password
    global lower
    global upper
    global integer
    password = eg.passwordbox(msg="Please enter your password")
    length = len(password)
    print(length)
    lower = sum([int(c.islower()) for c in password])
    print(lower)
    upper = sum([int(c.isupper()) for c in password])
    print(upper)
    integer = sum([int(c.isdigit()) for c in password])
    print(integer)
def toate_tabelele_curente():
    # cerem numele utilizatorului
    print("Numele utilizatorului:")
    user = input()
    # cerem parola utilizatorului
    parola = passwordbox("Parola utilizatorului")
    # conectarea la Oracle
    conexiune = cx_Oracle.connect(user, parola)
    # functie care afiseaza structura unei tabele date
    # cursor
    cursor = conexiune.cursor()
    # comanda describe
    cursor.execute("select tablespace_name, table_name from user_tables")
    # afisarea informatiilor
    for rezultat in cursor:
        print(rezultat)
Beispiel #37
0
	def ethcontr(self):
		# Set parameters for input box
		msg = "Enter details for connection to another computer"
		title = "Ethernet Controller"
		fieldNames = ["Computer IP", "User"]
		fieldValues = []
		fieldValues = easygui.multenterbox(msg, title, fieldNames)
		if fieldValues == None:
			return
		reply = easygui.passwordbox("Enter password")
		if reply == None:
			return	
	
		# Connect through SSH
		ssh = paramiko.SSHClient()
		ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
		
		if (fieldValues[0] == "" or fieldValues[1] == ""):
			return
		
		ssh.connect(fieldValues[0], username=fieldValues[1], password=reply)
		
		while True:
			# Set parameters for query
			msg2 = "Enter command to run"
			title2 = "Connected to " + fieldValues[1] + "@" + fieldValues[0]
			fieldNames2 = ["Command"]
			fieldValues2 = []
			fieldValues2 = easygui.multenterbox(msg2, title2, fieldNames2)
			
			if (fieldValues2 == None or fieldValues2[0] == ""):
				break
			
			if cmp(fieldValues2[0], 'exit') == 0:
				break

			stdin, stdout, stderr = ssh.exec_command(fieldValues2[0])
			
			# Compose output
			output = ""
			for line in stdout:
				output = output + "\n" + line
			if output != "":	
				easygui.codebox("Command result", "Show result", output)
def count():
#cerem numele utilizatorului
    print("Numele utilizatorului:")
    user = input()
#cerem parola utilizatorului
    parola = passwordbox("Parola utilizatorului")
#conectarea la Oracle
    conexiune = cx_Oracle.connect(user,parola)
#functie care afiseaza numar de inregistrari dintr-o tabela data
#utilizatorul trebuie sa introduca numele tabelei
    print("Numele tabelei")
    tablename = input()
#cursor
    cursor = conexiune.cursor()
#comanda describe
    cursor.execute('select count(*) from %s' % tablename)
    count = cursor.fetchall()[0][0]
#afisarea informatiilor
    print("Numarul de inregistrari din tabela", tablename, "este" , count)
def select_all():
#cerem numele utilizatorului
    print("Numele utilizatorului:")
    user = input()
#cerem parola utilizatorului
    parola = passwordbox("Parola utilizatorului")
#conectarea la Oracle
    conexiune = cx_Oracle.connect(user,parola)
#functie care afiseaza structura unei tabele date
#utilizatorul trebuie sa introduca numele tabelei
    print("Numele tabelei")
    tablename = input()
#cursor
    cursor = conexiune.cursor()
#comanda select
    cursor.execute('select * from %s' % tablename)
#afisarea informatiilor
    for rezultat in cursor:
        print (rezultat)
def describe():
#cerem numele utilizatorului
    print("Numele utilizatorului:")
    user = input()
#cerem parola utilizatorului
    parola = passwordbox("Parola utilizatorului")
#conectarea la Oracle
    conexiune = cx_Oracle.connect(user,parola)
#functie care afiseaza structura unei tabele date
#utilizatorul trebuie sa introduca numele tabelei
    print("Numele tabelei")
    tablename = input()
#cursor
    cursor = conexiune.cursor()
#comanda describe
    cursor.execute('select * from %s where 1=0' % tablename)
    print("Nume coloana\t", "NULL\t", "Tip\t", "Lungime\t")
#afisarea informatiilor
    for desc in cursor.description:
        column_name = desc[0]
        nullable = desc[6]
        data_type = desc[1].__name__
        data_length = desc[3]
        print (column_name, "\t",  nullable, "\t", data_type, "\t", data_length, "\t",)
#modulul pentru conectarea la Oracle
import cx_Oracle
#modulul pentru lucrul cu timpul
import time
#modul pentru passwordbox
from easygui import passwordbox
#preluam numele utilizatorului de la tastatura
print("Numele utilizatorului:")
user = input()
#preluam parola utilizatorului de la tastatura
print("Parola utilizatorului:")
parola = passwordbox("Parola")
#incercam sa ne conectam la Oracle si afisam
#un mesaj daca conectarea s-a realizat cu succes
try:
    start = time.time()
    connection = cx_Oracle.connect(user,parola)
    elapsed = (time.time() - start)
    print("Conexiunea s-a realizat cu succes")
    #print("Conexiunea s-a realizat in:",elapsed, "secunde")
#daca utilizatorul sau parola este gresita afisam un mesaj de eroare
except:
    print("Utilizator sau parola gresita")
#inchidem conexiunea la Oracle
connection.close()
Beispiel #42
0
Title = 'macACCESS 0.8v'
errmsg = 'Error. Inconplete Argument.'
elevatedusr = '******'

#Main Code
while access == "run":
    access = 'stop@begin'
    print("Mac Access v0.1")

    #Warning Screen
    eg.msgbox(
        msg="Use of this computer is monitored by Acme Cooperation. Improper use will result in revoked use of the network.",
        title=Title, ok_button="Login", image=image)

    #Login Dialog
    cal = eg.passwordbox(msg="Please login using your SkynetID.", title=Title, image=image)

    #Main user login
    if cal in open('Users/Standard.rtf').read():
        access = 'run'
        execfile("Standard User UI.py")

    #Admin user login
    if cal == elevatedusr:
        execfile("Admin User UI.py")
        access = 'run'

    if cal == "stop":
        access = 'stop@in'
        sys.exit()
Beispiel #43
0
'''
# Select the second (index one) form - the first form is a search query box
br.select_form(nr=1) 

#browser.get('https://twitter.com/')





# User credentials
#####HANDLE LOGIN CHECKING#####
print "\n"
username = raw_input("Phone, email or username: "******"Password: "******"Password: "******"Password: ") -> echos pass


br.form['session[username_or_email]'] = username
br.form['session[password]'] = password


# Login
br.submit()

#Prints html of main page after login
br.open('https://twitter.com/')
browser.get('https://twitter.com')
Beispiel #44
0
def require(key):
    ''' Test if key is stored, if not, prompt the user for it while hiding their input from shoulder-surfers.'''
    if not key in db:
        passw = easygui.passwordbox('Please enter a value for "%s":' % key)
        store(key, passw)
Beispiel #45
0
class EmailSender:
    def __init__(self, user, password, server):
        self.user = user
        self.server = server
        self.password = password
        self.server = smtplib.SMTP(server)
        self.server.starttls()
        self.server.login(self.user, self.password)

    def send(self, toaddrs, msg):
        x = self.server.sendmail(self.user, toaddrs, msg)
        print x

    def quit(self):
        self.server.quit()





if __name__ == '__main__':
    username = raw_input("Your Gmail:")
    password = passwordbox("What is your password ?")
    sendto = raw_input("Send email to:")
    emailtest = EmailSender(username, password, "smtp.gmail.com:587")
    emailtest.send(sendto, "This is a test email!!")
    emailtest.quit()



Beispiel #46
0
        urls.append("https://webkiosk.jiit.ac.in/EmployeeFiles/AcademicInfo/NewDailyStudentAttendanceEntry1.jsp")
        jobs.append('markAtt')
    elif 'createAtt' in sys.argv:
        urls.append("https://webkiosk.jiit.ac.in/EmployeeFiles/AcademicInfo/NewDailyStudentAttendanceEntry1.jsp")
        jobs.append('createAtt')
    else:
        print "Enter a valid argument"
        exit(1)
else:
    print "Provide argument/s\n"
    exit(1)

(member_code, password) = fileReader.read()
if member_code is None or member_code is '':
    member_code = easygui.enterbox("Enter Member Code:")
    password = easygui.passwordbox()
    fileWriter.write(member_code, password)

with Browser() as browser:
    browser.visit("https://webkiosk.jiit.ac.in/")
    browser.find_by_id('UserType').first.select('E')
    browser.fill('MemberCode', member_code)
    browser.fill('Password', password)
    button = browser.find_by_name('BTNSubmit')
    button.click()
    if "Wrong Member" in browser.html:
        print("Wrong Username/Password")
        exit(1)
    i = 0
    while i < len(jobs):
        browser.visit(urls[i])
 def prompt_for_apikey(self):
     return easygui.passwordbox(
             msg="Please paste in your Konekt API key",
             title="Konekt OTA Updater")
	en.delete(0,END)
	client.comm(usrname+"$MSG$"+txt)


#Data Stuff
chatlog=''
Host=enterbox('ENTER CHAT SERVER:')
Port=29876
Buffersize=4096
nameok=False
client=ClientObject(Host,Port,Buffersize)

#Username Registry
while nameok==False:
	usrname=enterbox('ENTER USERNAME:'******'ENTER PASSWORD:'******'':
		exit()
	usrreg=client.comm('CONNECTION:'+usrname+':'+pw)
	if usrreg=='ACCESS GRANTED':
		nameok=True
	else:
		msgbox('Wrong password!')

#Main Frame
root = Tk()

#Text Field
text = Text(root)
text.insert(INSERT, "THIS IS A TEST")
text.pack()
Beispiel #49
0
import subprocess, sys
from easygui import passwordbox, msgbox

if len(sys.argv) != 5:
    sys.exit()

password = passwordbox(msg="Enter your ACM password:"******"Password", default="")
if password == "":
    password = passwordbox(
        msg="(Null Password Entered.  Try Again) Enter your ACM password:"******"Password", default=""
    )
    if password == "":
        sys.exit()

if password == None:
    sys.exit()

if sys.argv[4] == "default":
    msgbox(
        msg="The default changelist cannot be used for a review.  Please move files into a named changelist.",
        title="Error",
        ok_button="Ok",
    )
    sys.exit()

cmd = ""
cmd = cmd + "C:\Python25\python.exe C:\Python25\Scripts\post-review -d -o --server=https://acm.cs.uic.edu/reviews" + " "
cmd = cmd + "--p4-port=" + sys.argv[1] + " "
cmd = cmd + "--username="******" "
cmd = cmd + "--password="******" "
cmd = cmd + "--p4-client=" + sys.argv[3] + " "
Beispiel #50
0
	while choice < 1 or choice > maxValue:
		printValues(theList)
		choice = getInputAsInt()
	return choice

# Start Config
br = FirstStep(linkPorrum)
titles, choises = br.getChoices()
numberOfCourses = len(titles)
print "Please introduce the correct answers !"
print numberOfCourses, "courses detected. Please choose yours."
course = printAndChoose(titles, numberOfCourses)
selectedCourse = choises[course - 1].name
br.chooseCourse(selectedCourse)
names = br.getNames()
numberOfNames = len(names)
print numberOfNames, "names detected. Please choose yours."
name = printAndChoose(names, numberOfNames)
selectedName = names[name - 1]
password = ""
while len(password) == 0:
	password = easygui.passwordbox(msg='Password:'******'Encryption message', default='')
passphrase = ""
while len(passphrase) == 0:
	passphrase = easygui.passwordbox(msg='Passphrase:', title='Encryption message', default='')
enc = Encryption(password, passphrase)
fileConfig = open ("marks.cfg", 'w')
fileConfig.write("%s\n"%selectedCourse)
fileConfig.write("%s\n"%selectedName)
fileConfig.write("%s"%enc.encrypt())
print "All data saved !"