dbFunctionsClass.py
def initUser(self, hashLink):
    """
      :param arg1: A hash that was generated for a pending_user. Not the password hash.
      :type: str
      :return: a dict with either an email key value, or an error
      :rtype: dict

      .. note:  This hash will be pushed to the admins as a link, example:
        http://ww2.audstanley.com:5000/usersPending/awdoOOIdwahwaoawhdODHawOHADWhwiwad292822baiiawidu
        where "awdoOOIdwahwaoawhdODHawOHADWhwiwad292822baiiawidu" would be the hashlink.
        Flask will approve that user once an admin clicks on the link.
        We will use the pushover API and the pushover android app to make the link push our cell phones.

      .. todo: test to see if this function works.

    """
    conn = sqlite3.connect('users.db', check_same_thread=False)
    c = conn.cursor()
    
    try:
      c.execute('''SELECT email,hashword FROM pending_users WHERE hashlink ="%s"''' % hashLink)
      email, hashPass = c.fetchone()
      #if len(vals) > 0:
        #email = vals[0][0]
        #hashPass = vals[0][1]
      if email is not None and hashPass is not None:
        print('initPending',email,hashPass)
        print('pending user:', email, ' was found, moving them to the user table.')
        c.execute('''CREATE TABLE IF NOT EXISTS users
                (email string PRIMARY KEY, 
                hashword string NOT NULL,
                cookie string NOT NULL)''')
        c.execute('INSERT INTO users (email, hashword, cookie) VALUES (?, ?, ?)', (email, hashPass, ''))
        conn.commit()
        self.makeTables(email)
        # Begin generate Fake Students for new user
        self.populateTables(email, 1234, 'Richard', 'Stanley',   '123 Stanley St.', 'Lake Forest', 'CA', 92630, 9499030246)
        self.populateTables(email, 2345, 'Georden', 'Grabuskie', '123 Stanley St.', 'Lake Forest', 'CA', 92630, 9499030246)
        self.populateTables(email, 3456, 'Chantelle', 'Bril',    '123 Stanley St.', 'Lake Forest', 'CA', 92630, 9499030246)
        # End fake student generator
        
        return { 'email': email }
      else:
        return { 'error': 'That has hashlink does not match any email in the pending_users table' }
    except Error as e:
      print(e)
      return { 'error': str(e) }

      :param arg1: A hash that was generated for a pending_user. Not the password hash.
      :type: str
      :return: a dict with either an email key value, or an error
      :rtype: dict

      .. note:  This hash will be pushed to the admins as a link, example:
        http://ww2.audstanley.com:5000/usersPending/awdoOOIdwahwaoawhdODHawOHADWhwiwad292822baiiawidu
        where "awdoOOIdwahwaoawhdODHawOHADWhwiwad292822baiiawidu" would be the hashlink.
        Flask will approve that user once an admin clicks on the link.
        We will use the pushover API and the pushover android app to make the link push our cell phones.

      .. todo: test to see if this function works.

    
:param arg1: A hash that was generated for a pending_user. Not the password hash.



test to see if this function works.
: param arg1 : A hash that was generated for a pending_user . Not the password hash . test to see if this function works .
def initUser(self, hashLink):
    conn = sqlite3.connect('users.db', check_same_thread=False)
    c = conn.cursor()
    try:
      c.execute('''SELECT email,hashword FROM pending_users WHERE hashlink ="%s"''' % hashLink)
      email, hashPass = c.fetchone()
      if email is not None and hashPass is not None:
        print('initPending',email,hashPass)
        print('pending user:', email, ' was found, moving them to the user table.')
        c.execute('''CREATE TABLE IF NOT EXISTS users
                (email string PRIMARY KEY, 
                hashword string NOT NULL,
                cookie string NOT NULL)''')
        c.execute('INSERT INTO users (email, hashword, cookie) VALUES (?, ?, ?)', (email, hashPass, ''))
        conn.commit()
        self.makeTables(email)
        self.populateTables(email, 1234, 'Richard', 'Stanley',   '123 Stanley St.', 'Lake Forest', 'CA', 92630, 9499030246)
        self.populateTables(email, 2345, 'Georden', 'Grabuskie', '123 Stanley St.', 'Lake Forest', 'CA', 92630, 9499030246)
        self.populateTables(email, 3456, 'Chantelle', 'Bril',    '123 Stanley St.', 'Lake Forest', 'CA', 92630, 9499030246)
        return { 'email': email }
      else:
        return { 'error': 'That has hashlink does not match any email in the pending_users table' }
    except Error as e:
      print(e)
      return { 'error': str(e) }
def initUser ( self , hashLink ) : conn = sqlite3 . connect ( 'users.db' , check_same_thread = False ) c = conn . cursor ( ) try : c . execute ( '''SELECT email,hashword FROM pending_users WHERE hashlink ="%s"''' % hashLink ) email , hashPass = c . fetchone ( ) if email is not None and hashPass is not None : print ( 'initPending' , email , hashPass ) print ( 'pending user:' , email , ' was found, moving them to the user table.' ) c . execute ( '''CREATE TABLE IF NOT EXISTS users
                (email string PRIMARY KEY, 
                hashword string NOT NULL,
                cookie string NOT NULL)''' ) c . execute ( 'INSERT INTO users (email, hashword, cookie) VALUES (?, ?, ?)' , ( email , hashPass , '' ) ) conn . commit ( ) self . makeTables ( email ) self . populateTables ( email , 1234 , 'Richard' , 'Stanley' , '123 Stanley St.' , 'Lake Forest' , 'CA' , 92630 , 9499030246 ) self . populateTables ( email , 2345 , 'Georden' , 'Grabuskie' , '123 Stanley St.' , 'Lake Forest' , 'CA' , 92630 , 9499030246 ) self . populateTables ( email , 3456 , 'Chantelle' , 'Bril' , '123 Stanley St.' , 'Lake Forest' , 'CA' , 92630 , 9499030246 ) return { 'email' : email } else : return { 'error' : 'That has hashlink does not match any email in the pending_users table' } except Error as e : print ( e ) return { 'error' : str ( e ) }
:param arg1: A hash that was generated for a pending_user.
: param arg1 : A hash that was generated for a pending_user .
"""
      :param arg1: A hash that was generated for a pending_user. Not the password hash.
      :type: str
      :return: a dict with either an email key value, or an error
      :rtype: dict

      .. note:  This hash will be pushed to the admins as a link, example:
        http://ww2.audstanley.com:5000/usersPending/awdoOOIdwahwaoawhdODHawOHADWhwiwad292822baiiawidu
        where "awdoOOIdwahwaoawhdODHawOHADWhwiwad292822baiiawidu" would be the hashlink.
        Flask will approve that user once an admin clicks on the link.
        We will use the pushover API and the pushover android app to make the link push our cell phones.

      .. todo: test to see if this function works.

    """ #if len(vals) > 0: #email = vals[0][0] #hashPass = vals[0][1] # Begin generate Fake Students for new user # End fake student generator
self
hashLink