def audit_event_vault_created(username, vaultname): u_id = s_h.get_user_id(username) v_id = get_vault_id_by_name(vaultname) if not u_id or not v_id: return False query = "select id from ss_log where userid = {} and groupid = {} and event like '%VAULT CREATED:{}%' and stamp >= '{}'".format(u_id,v_id,vaultname,start_time) return audit_execute(query)
def get_user_fullname(username): u_id = s_h.get_user_id(username) if not u_id: return False cursor.execute('select fullname from ss_userbase where id = %s',u_id) res = cursor.fetchone()[0] cursor.fetchall() return res
def is_user_active(user): u_id = s_h.get_user_id(user) if not u_id: return False cursor.execute('select status from ss_userbase where id = %s',u_id) res = cursor.fetchone()[0] cursor.fetchall() if res is not None: return s_db_objects.obj_status(res) .is_active() else: return False
def audit_event_logout(user): u_id = s_h.get_user_id(user) if not u_id: return False query = "select id from ss_log where event like '%LOGOUT%' and userid = {} and stamp >= '{}'".format(u_id,start_time) return audit_execute(query)
def get_user_id(username): return s_fh.get_user_id(username)