예제 #1
0
        /// <summary>
        /// 设定账号密码
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="newpassword"></param>
        public void SetUserPassword(string UserName, string NewPassword, string oldPassword, string orgPassword, out string errStr)
        {
            errStr = "";
            string[] strArrary = new string[4];
            string   xx        = "";

            ChangePwdService.ChangePWD svr1 = new InterActiveDirectory.ChangePwdService.ChangePWD();

            //if(!svr1.Exchange_PassWord_erp(UserName,NewPassword,oldPassword,out xx))
            //{
            //    errStr=xx+"修改ERP密码报错!\\n";
            //    strArrary[0]="1";
            //}
            //else
            //    strArrary[0]="0";

            if (!svr1.Exchange_PassWord_hls(UserName, NewPassword, oldPassword, out xx))
            {
                errStr       = xx + "修改LIS密码报错!\\n";
                strArrary[1] = "1";
            }
            else
            {
                strArrary[1] = "0";
            }
            kmoapassword.CHTWebService cht = new InterActiveDirectory.kmoapassword.CHTWebService();
            if (!cht.Edit_PassWord(UserName, NewPassword, oldPassword, out xx))
            {
                errStr       = xx + "修改KMOA密码报错!\\n";
                strArrary[2] = "1";
            }
            else
            {
                strArrary[2] = "0";
            }
            if (svr1.Exchange_PassWord_RTX(UserName, orgPassword, oldPassword) != "")
            {
                errStr       = xx + "修改RTX密码报错!\\n";
                strArrary[3] = "0";
            }
            else
            {
                strArrary[3] = "1";
            }


            try
            {
                ADVB.AdUser    advb  = new ADVB.AdUser();
                DirectoryEntry oUser = Iads.GetUserEntry(UserName);
                AdOperate.AD_ExchangePassWord adService = new InterActiveDirectory.AdOperate.AD_ExchangePassWord();
                string er = "";
                int    t  = adService.SetExchangePassword(UserName, orgPassword, out er)?1:0;


                //DirectoryEntry oUser = Iads.GetUserEntry(UserName);
                //SetPsw(oUser, orgPassword, out errStr);
                //oUser.Close();


                oUser.Properties["l"].Value = "4";
                //oUser.Properties["physicalDeliveryOfficeName"].Value=orgPassword;

                /********Editor:cengyp 2008年11月3日********/
                oUser.Properties["physicalDeliveryOfficeName"].Value = Encryption.DesEncrypt(orgPassword);
                oUser.Properties["extensionAttribute1"].Value        = "1111";
                oUser.CommitChanges();
                oUser.Close();
            }
            catch (Exception err)
            {
                errStr = errStr + "-------" + err + "  修改活动目录密码报错\\n";
            }
        }
예제 #2
0
파일: AD_Users.cs 프로젝트: JuRogn/OA
		/// <summary>
		/// 设定账号密码
		/// </summary>
		/// <param name="userName"></param>
		/// <param name="newpassword"></param>
		public  void SetUserPassword(string UserName,string NewPassword,string oldPassword,string orgPassword,out string errStr)
		{
			errStr="";
			string[] strArrary=new string[4];
			string xx="";
            ChangePwdService.ChangePWD svr1 = new InterActiveDirectory.ChangePwdService.ChangePWD();
			
            //if(!svr1.Exchange_PassWord_erp(UserName,NewPassword,oldPassword,out xx))
            //{
            //    errStr=xx+"修改ERP密码报错!\\n";
            //    strArrary[0]="1";
            //}
            //else
            //    strArrary[0]="0";

			if(!svr1.Exchange_PassWord_hls(UserName,NewPassword,oldPassword,out xx))
			{
				errStr=xx+"修改LIS密码报错!\\n";
				strArrary[1]="1";
			}
			else
				strArrary[1]="0";
            kmoapassword.CHTWebService cht = new InterActiveDirectory.kmoapassword.CHTWebService();
            if (!cht.Edit_PassWord(UserName, NewPassword, oldPassword, out xx))
			{
				errStr=xx+"修改KMOA密码报错!\\n";
				strArrary[2]="1";
			}
			else
				strArrary[2]="0";
			if(svr1.Exchange_PassWord_RTX(UserName,orgPassword,oldPassword)!="")
			{
				errStr=xx+"修改RTX密码报错!\\n";	
				strArrary[3]="0";
			}
			else
				strArrary[3]="1";


			try
			{
				ADVB.AdUser advb=new ADVB.AdUser(); 
				DirectoryEntry oUser= Iads.GetUserEntry(UserName);
                AdOperate.AD_ExchangePassWord adService = new InterActiveDirectory.AdOperate.AD_ExchangePassWord();
				string er="";
                int t = adService.SetExchangePassword(UserName, orgPassword, out er)?1:0;


                //DirectoryEntry oUser = Iads.GetUserEntry(UserName);
                //SetPsw(oUser, orgPassword, out errStr);
                //oUser.Close();
				
	
				oUser.Properties["l"].Value="4";
				//oUser.Properties["physicalDeliveryOfficeName"].Value=orgPassword;		

                /********Editor:cengyp 2008年11月3日********/
                oUser.Properties["physicalDeliveryOfficeName"].Value = Encryption.DesEncrypt(orgPassword);
				oUser.Properties["extensionAttribute1"].Value="1111";		
				oUser.CommitChanges();
				oUser.Close();
			}
			catch(Exception err)
			{
				errStr=errStr+"-------"+err+"  修改活动目录密码报错\\n";
			}	
			
		}