public static bool GetKitServerURLWithValidityCheck(string securityId, out string url, string BYPASSED_USER) { try { return(Security_Ext_DBHandler.GetKitServerURLWithValidityCheck(securityId, out url, BYPASSED_USER)); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
public static bool IsValidCredential(string roleName, string rolePass) { try { return(Security_Ext_DBHandler.GetRoleValidationStatus(roleName, rolePass)); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
public static string InsertSecurityInfo(string userId, string roleName, string print_server_location, string kit_server_url, string docSharePath) { string securityId = CreateSecurityId(32, true); try { string authString = GetAuthenticationInfo(roleName); string authJsonValue = ConvertAuthStringToJson(authString); Security_Ext_DBHandler.InsertNewSecurityInfo(userId, securityId, authJsonValue, print_server_location, kit_server_url, docSharePath); } catch (Exception ex) { LogWriter.WriteLog(ex.ToString()); throw new Exception(ex.ToString()); } return(securityId); }
public static bool GetKitServerURLWithValidityCheck(string securityId, out string url, string BYPASSED_USER) { DataTable dt = Security_Ext_DBHandler.GetUserSessionInfo(securityId); url = ""; if (dt.Rows.Count > 0) { url = dt.Rows[0]["kitserverurl"].ToString(); Double idleTimeInSecond = Convert.ToDouble(dt.Rows[0]["timediff"]); Double timeout = Convert.ToDouble(dt.Rows[0]["timeout"]); if (timeout >= idleTimeInSecond || BYPASSED_USER.Equals("true")) { SecurityManager.UpdateLastAccessTime(securityId); return(true); } else { SecurityManager.DeleteSecurityKeyInfo(securityId); return(false); } } return(false); }
private static string GetAuthenticationInfo(string roleName) { DataTable dt = Security_Ext_DBHandler.GetAuthenticationInfo(roleName); List <string> lstAuthSections = new List <string>(); string authSection = string.Empty; foreach (DataRow dr in dt.Rows) { authSection = dr["authsection"].ToString(); if (!lstAuthSections.Contains(authSection)) { lstAuthSections.Add(authSection); } } AuthTypeValue[] authInfoList = new AuthTypeValue[lstAuthSections.Count]; AuthTypeValue authTypeValue; for (int i = 0; i < lstAuthSections.Count; i++) { authTypeValue = new AuthTypeValue(); DataRow[] tmpDrs = dt.Select("authsection='" + lstAuthSections[i] + "'"); List <string> authValues = new List <string>(); foreach (DataRow dr in tmpDrs) { authValues.Add(dr["functionname"].ToString()); } authTypeValue.authType = lstAuthSections[i]; authTypeValue.authValue = authValues.ToArray(); authInfoList[i] = authTypeValue; } System.Web.Script.Serialization.JavaScriptSerializer jsSlz = new System.Web.Script.Serialization.JavaScriptSerializer(); return(jsSlz.Serialize(authInfoList)); }
public static bool CheckSecurityIDExist(string sid) { return(Security_Ext_DBHandler.CheckSecurityIDExist(sid)); }
public static string GetUserName(string securityKey) { return(Security_Ext_DBHandler.GetUserName(securityKey)); }
internal static void DeleteSecurityKeyInfo(string securityKey) { Security_Ext_DBHandler.DeleteSecurityKeyInfo(securityKey); }
public static void UpdateLastAccessTime(string securityKey) { Security_Ext_DBHandler.UpdateLastAccessTime(securityKey); }
public static string[] GetAuthenticationValues(string securityKey) { return(Security_Ext_DBHandler.GetAuthenticationValues(securityKey)); }