}//end of this method #region Web_users membership // Added by Leo // This method validate an Internet user's membership of a web application public static bool IsValidUser(string loginID, string password, string appName, System.Data.OracleClient.OracleConnection conVITAP) { bool valid = false; string encodedPassword = SharedPassword.Encode(password); loginID = loginID.ToUpper(); System.Data.OracleClient.OracleCommand cmdVITAP = new System.Data.OracleClient.OracleCommand(); if (conVITAP.State != ConnectionState.Open) { conVITAP.Open(); } cmdVITAP.Connection = conVITAP; cmdVITAP.CommandText = Queries.getValidUser(loginID, encodedPassword, appName); System.Data.OracleClient.OracleDataReader rdrReader = cmdVITAP.ExecuteReader(); if (rdrReader.Read()) { valid = true; } else { valid = false; } cmdVITAP.Dispose(); return(valid); } //end of this method
// //This routine will build an Oracle connection string from the shared database password file public static string GetConnectionString(string databaseSetting, string userSetting) { string databaseName = ""; string userID = ""; string password = ""; string connectionString; databaseName = ConfigurationManager.AppSettings.Get(databaseSetting); userID = ConfigurationManager.AppSettings.Get(userSetting); //The user id is stored in the configuration file password = SharedPassword.GetPassword(databaseName, userID); //Retreive the password from the shared password database //this connectionstring is only for OracleClient style connectionString = "Data Source=" + databaseName + ";User ID=" + userID + ";Password="******"Provider=OraOLEDB.Oracle.1;Password="******";"+"Persist Security Info=True;User ID="+userID+";"+"Data Source="+databaseName+";Extended Properties="; //Create the connection string dynamically return(connectionString.ToString()); } //end of this method
// 03/07/2014 OCP 57515 RSNAP II: Jun Lee // Using Password Web Service, this routine returns the password for the database and user id passed public static string GetPassword(string databaseName, string userID) { return(SharedPassword.GetPassword(databaseName, userID)); //string passwordResult = ""; //string strDefaultPath = ""; //strDefaultPath = GSA.R7BD.Utility.Utilities.getDrivePathByLetter("MSCTL32:"); //strDefaultPath += "\\MSCTL32.TLB"; //try { //get it from xml file // //passwordResult = SharedPassword.GetPassword(databaseName.Trim(), userID.Trim(), "d:\\components\\MSCTL32.TLB"); // passwordResult = SharedPassword.GetPassword(databaseName.Trim(), userID.Trim(), strDefaultPath); // //if not found in XML file then get ftom SAN box // if (passwordResult == "") { // passwordResult = SharedPassword.GetPassword(databaseName.Trim(), userID.Trim()); // } //} //catch (System.Exception e) { // Console.Write(e.Message); //} //return passwordResult; } //end of this method
//public static string GetWebNowUrl() //{ // string hostUrl = string.Empty; // string username = string.Empty; // string password = string.Empty; // string database = string.Empty; // try // { // hostUrl = getDrivePathByLetter("GSAWEBNOW:"); // database = getDBConfigValueByLetter("IMAGENOWDB:"); // username = getDBConfigValueByLetter("IMAGENOWUSER:"******"&username="******"&password="******"GSA.R7BD.Utility", "Utilities", "GetWebNowUrl", exp.Message.ToString()); // } // return hostUrl; //} public static Dictionary <string, string> ImageNowServiceHelper(string dbName, string dbUser) { Dictionary <string, string> imageNowServiceHelper = new Dictionary <string, string>(); string password = string.Empty; string database = string.Empty; string userName = string.Empty; try { database = getDBConfigValueByLetter(dbName); userName = getDBConfigValueByLetter(dbUser); if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(database)) { password = SharedPassword.GetPassword(database, userName); } imageNowServiceHelper.Add(userName, password); } catch (Exception exp) { GSA.R7BD.Utility.EventLog.AddWebErrors("GSA.R7BD.Utility", "Utilities", "ImageNowServiceHelper", exp.Message.ToString()); } return(imageNowServiceHelper); }
}//end of method public static string getDecodedPwd(string EncodedPwd) { return(SharedPassword.Decode(EncodedPwd)); }