コード例 #1
0
        public static string GetMySqlPassword()
        {
            string password = ZohoOAuth.GetConfigValue("mysql_password");

            if (password == null)
            {
                return("");
            }
            return(password);
        }
コード例 #2
0
        public static string GetPortNumber()
        {
            string port = ZohoOAuth.GetConfigValue(ZohoOAuthConstants.MYSQL_PORT);

            if (port == null)
            {
                return("3306");
            }
            return(port);
        }
コード例 #3
0
        public static string GetMySqlUserName()
        {
            string userName = ZohoOAuth.GetConfigValue("mysql_username");

            if (userName == null)
            {
                return("root");
            }
            return(userName);
        }
コード例 #4
0
        public static string GetDataBaseName()
        {
            string database = ZohoOAuth.GetConfigValue(ZohoOAuthConstants.MYSQL_DATABASE);

            if (database == null)
            {
                return("zohooauth");
            }
            return(database);
        }
コード例 #5
0
        public static string GetServerName()
        {
            string server = ZohoOAuth.GetConfigValue(ZohoOAuthConstants.MYSQL_SERVER);

            if (server == null)
            {
                return("localhost");
            }
            return(server);
        }
コード例 #6
0
        public static string GetMySqlPassword()
        {
            string password = ZohoOAuth.GetConfigValue(ZohoOAuthConstants.MYSQL_PASSWORD);

            if (password == null)
            {
                return("");
            }
            return(password);
        }
コード例 #7
0
        public static string GetMySqlUserName()
        {
            string userName = ZohoOAuth.GetConfigValue(ZohoOAuthConstants.MYSQL_USERNAME);

            if (userName == null)
            {
                return("root");
            }
            return(userName);
        }
コード例 #8
0
 private bool IsTokenGenerated(string currentUserEmail)
 {
     try
     {
         ZohoOAuthTokens tokens = ZohoOAuth.GetPersistenceHandlerInstance().GetOAuthTokens(currentUserEmail);
         return(tokens != null ? true : false);
     }
     catch (Exception ex)
     {
         Trace.TraceError("Is Token Generated Error: " + ex.Message);
         return(false);
     }
 }
コード例 #9
0
        public static void Initialize(bool initOAuth, Stream configStream, Dictionary <string, string> configData)
        {
            Assembly assembly = Assembly.GetAssembly(typeof(ZCRMConfigUtil));

            ConfigProperties = CommonUtil.GetFileAsDict(assembly.GetManifestResourceStream(assembly.GetName().Name + ".Resources.configuration.txt"));

            if (configStream == null && configData == null)
            {
                Dictionary <string, string> keyValuePairs = CommonUtil.GetConfigFileAsDict("zcrm_configuration");

                foreach (KeyValuePair <string, string> keyValues in keyValuePairs)
                {
                    ConfigProperties[keyValues.Key] = keyValues.Value;
                }
            }
            if (configStream != null)
            {
                configData   = CommonUtil.GetFileAsDict(configStream);
                configStream = null;
            }
            if (configData != null)
            {
                AddConfigurationData(configData);
            }
            ZCRMLogger.Init();

            if (initOAuth)
            {
                HandleAuthentication = true;
                try
                {
                    ZohoOAuth.Initialize(ConfigProperties.ContainsKey(APIConstants.DOMAIN_SUFFIX) ? (string)ConfigProperties[APIConstants.DOMAIN_SUFFIX] : null, configData);
                    if (ConfigProperties.ContainsKey(APIConstants.DOMAIN_SUFFIX))
                    {
                        SetAPIBaseUrl(ConfigProperties[APIConstants.DOMAIN_SUFFIX]);
                    }
                }
                catch (Exception e)
                {
                    throw new ZCRMException(e);
                }
            }
            ZCRMLogger.LogInfo("C# Client Library Configuration Properties : " + CommonUtil.DictToString(ConfigProperties));
        }
コード例 #10
0
 public static string GetPersistenceHandlerFilePath()
 {
     return(ZohoOAuth.GetConfigValue("oauth_tokens_file_path"));
 }