Exemplo n.º 1
0
        /// <summary>認証処理</summary>
        private bool auth(DBConnect dbConnect)
        {
            UsersDAO  dao = new UsersDAO(dbConnect);
            DataTable dt  = dao.GetEntityByNameAndPass(textBox_user.Text, GetMD5String(passBox_pass.Password));

            if (dt.Rows.Count == 1)
            {
                DataRow row0 = dt.Rows[0];
                LoginSetting.UserID    = Convert.ToDecimal(row0["userid"]);
                LoginSetting.UserName  = (String)row0["alias"];
                LoginSetting.Authority = (Consts.AuthorityEnum)row0["type"];
                LoginSetting.Mode      = Consts.ActionMode.DEVELOP;
                if (LoginSetting.Authority == Consts.AuthorityEnum.GENERAL)
                {
                    LoginSetting.Mode = Consts.ActionMode.USE;
                }
                LoginSetting.ConnectStr = ((JobconDBSource)comboBox_jobarg.SelectedItem).ConnnectStr;
                LoginSetting.GroupList  = DBUtil.GetGroupIDListByAlias(LoginSetting.UserName);
                LoginSetting.JobconName = ((JobconDBSource)comboBox_jobarg.SelectedItem).JobconName;

                LoginSetting.DBType = ((JobconDBSource)comboBox_jobarg.SelectedItem).DBType;

                //added by YAMA 2014/02/26
                string wkLang = (String)row0["lang"];
                LoginSetting.Lang = wkLang.ToLower();

                LoginSetting.HealthCheckFlag     = ((JobconDBSource)comboBox_jobarg.SelectedItem).HealthCheckFlag;
                LoginSetting.HealthCheckInterval = ((JobconDBSource)comboBox_jobarg.SelectedItem).HealthCheckInterval;

                //added by YAMA 2014/03/03
                LoginSetting.JaZabbixVersion = ((JobconDBSource)comboBox_jobarg.SelectedItem).JaZabbixVersion;

                // added by YAMA 2014/10/20    マネージャ内部時刻同期
                LoginSetting.ManagerTimeSync = DBUtil.GetManagerTimeSync();

                // added by YAMA 2014/10/30    グループ所属無しユーザーでのマネージャ動作
                if (LoginSetting.GroupList.Count == 0)
                {
                    LoginSetting.BelongToUsrgrpFlag = false;
                }
                else
                {
                    LoginSetting.BelongToUsrgrpFlag = true;
                }

                return(true);
            }
            return(false);
        }