예제 #1
0
        public void LoadModifyPwdPage(DBLayer.PasswordSafeInfo[] pwdSafeArr)
        {
            SysDBModel.UCML_User       userObj     = new SysDBModel.UCML_User();
            SysDBModel.UCML_UserInfo[] userInfoArr = userObj.FindUser((string)UCMLCommon.Session.Get("UserName"));

            if (pwdSafeArr.Length > 0 && ((string)UCMLCommon.Session.Get("UserName") != "ADMIN") && !Convert.ToBoolean(pwdSafeArr[0].fRefuseUserModifyPwd))
            {
                //假如不是admin而且该用户登录密码等于设置的初始密码,则进行强制修改密码
                if (Convert.ToBoolean(pwdSafeArr[0].fModifyPwdInitPwd) && (pwdSafeArr[0].InitPwd.ToString().Equals(userInfoArr[0].PassWord.ToString())))
                {
                    updatePwdMsg.Text = "<script type=\"text/javascript\">updatePwd(0);</script>";
                    return;
                }
                else
                {
                    //判断最长使用天数
                    DateTime now        = DateTime.Now;
                    DateTime lastupdate = Convert.ToDateTime(userInfoArr[0].USR_PW_LAST_UPD);
                    TimeSpan ts         = now - lastupdate;
                    int      d          = ts.Days;
                    if ((Convert.ToInt32(pwdSafeArr[0].MaxiDays) > 0) && (d > Convert.ToInt32(pwdSafeArr[0].MaxiDays)))
                    {
                        updatePwdMsg.Text = "<script type=\"text/javascript\">updatePwd(1);</script>";
                        return;
                    }
                }
            }
        }
예제 #2
0
        public void SetMasterPost(string UCMLPostOID, string USR_LOGIN)
        {
            string UCMLContactOID = string.Empty;

            SysDBModel.UCML_User       objUser     = new SysDBModel.UCML_User();
            SysDBModel.UCML_UserInfo[] objInfoUser = objUser.FindUser(USR_LOGIN);
            if (objInfoUser.Length > 0)
            {
                UCMLContactOID = objInfoUser[0].UCML_CONTACTOID.ToString();
            }
            else
            {
                return;
            }

            SysDBModel.UCML_POSTN_PER_MAP       obj      = new SysDBModel.UCML_POSTN_PER_MAP();
            SysDBModel.UCML_POSTN_PER_MAPInfo[] objInfos = obj.getUserAllPostn(UCMLContactOID);
            for (int i = 0; i < objInfos.Length; i++)
            {
                if (objInfos[i].UCML_PostOID.ToString() == UCMLPostOID)
                {
                    obj.SetFieldValue("fIsMasterPost", objInfos[i].UCML_POSTN_PER_MAPOID.ToString(), true);
                }
                else
                {
                    if (objInfos[i].fIsMasterPost == true)
                    {
                        obj.SetFieldValue("fIsMasterPost", objInfos[i].UCML_POSTN_PER_MAPOID.ToString(), false);
                    }
                }
            }
        }