protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { foreach (studentSpec ss in aStudentSpecSL.Values) { string y = ""; mAttributeValues = GetLDAPInfo("cn=" + ss.NDSName); Boolean grpExists = false; foreach (String grp in attributeArray("grpmbr")) { if (buildGroupContext(grp) == ss.ActionData.Replace("Group=", "").ToString().ToUpper()) { grpExists = true; break; } } if (!grpExists) { mTestedOK.Add(ss.queueItem.ToString()); } if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { foreach (studentSpec ss in aStudentSpecSL.Values) { if ((mAttributeValues = GetLDAPInfo("cn=" + ss.NDSName)) != null) { String x = attributeValue("gwexpire").ToString(); Boolean b = GetDescriptionChanged(ss.Description.ToString()); //Boolean c = GetTelephoneChanged(ss.Telephone.ToString()); if (attributeValue("logindisabled").ToLower() == "false" && GetDescriptionChanged(ss.Description.ToString()) == true) { //studentUtility.updateWcStaffIdentity(ss.NDSName, "SET NDSdisabled = 0"); mTestedOK.Add(ss.queueItem.ToString()); } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { String NDSHomeDir = ""; foreach (studentSpec ss in aStudentSpecSL.Values) { mAttributeValues = GetLDAPInfo("cn=" + ss.NDSName); //Byte[] x = attributeValue("ndshomedirectory"); String[] aPath = attributeValue("ndshomedirectory").Split('='); if (aPath.Length > 1) { if (aPath[1].IndexOf(',') > 0) { NDSHomeDir = aPath[1].Substring(0, aPath[1].IndexOf(',')); } } if (NDSHomeDir.ToUpper().Trim() == GetHomeDir(ss.Context.ToUpper().Trim())) { //studentUtility.updateWcStaffIdentity(ss.NDSName, "SET NDSdisabled = 1"); // don't need this as we are not using groupwise now. //studentUtility.writeCouplerMessageQueueStu(ss.NDSName, "", "LinkStudentLogin"); mTestedOK.Add(ss.queueItem.ToString()); } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { String NDSPostOffice = ""; foreach (studentSpec ss in aStudentSpecSL.Values) { mAttributeValues = GetLDAPInfo("cn=" + ss.NDSName); //Byte[] x = attributeValue("ndshomedirectory"); String[] aPath = attributeValue("ngwpostoffice").Split('='); if (aPath.Length > 0) { NDSPostOffice = aPath[1].Substring(0, aPath[1].IndexOf(',')) + "." + aPath[2].Substring(0, aPath[2].IndexOf(',')) + "." + aPath[3].ToString(); } if (NDSPostOffice.ToUpper().Trim() == "PO-STUDENTS.LSPA.WC") { mTestedOK.Add(ss.queueItem.ToString()); } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { String NDScontext = ""; foreach (studentSpec ss in aStudentSpecSL.Values) { mAttributeValues = GetLDAPInfo("cn=" + ss.NDSName); String [] aPath = attributeValue("adspath").Split('='); if (aPath.Length > 0) { NDScontext = aPath[2].Substring(0, aPath[2].IndexOf(',')) + "." + aPath[3].Substring(0, aPath[3].IndexOf(',')) + "." + aPath[4].Substring(0, aPath[4].IndexOf(',')) + "." + aPath[5].ToString(); } if (NDScontext.ToUpper().Trim() == ss.Context.ToUpper().Trim()) { //studentUtility.updateWcStaffIdentity(ss.NDSName, "SET NDSdisabled = 1"); studentUtility.writeCouplerMessageQueueStu(ss.NDSName, "", GetHomeDirCouplerJob(ss.Context.ToUpper().Trim())); mTestedOK.Add(ss.queueItem.ToString()); } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } }
protected override void doSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { if (aStudentSpecSL.Count > 0) { StreamWriter wNewNDSStream = new StreamWriter( mJRBFilesPath + runDateTime.ToString("yyyyMMddHHmmss") + ".txt" ); foreach (studentSpec ss in aStudentSpecSL.Values) { wNewNDSStream.WriteLine(doSelectedItem(ss)); } wNewNDSStream.Close(); } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { foreach (studentSpec ss in aStudentSpecSL.Values) { mAttributeValues = GetLDAPInfo("cn=" + ss.NDSName); if (attributeValue("logindisabled").ToLower() == "true") { //studentUtility.updateWcStaffIdentity(ss.NDSName, "SET NDSdisabled = 1"); mTestedOK.Add(ss.queueItem.ToString()); } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { foreach (studentSpec ss in aStudentSpecSL.Values) { //mAttributeValues = GetALLLDAPInfo("cn=" + ss.NDSName); List <String> mResult = GetALLLDAPInfo("objectclass=user", "OU=staff,OU=per,o=wc"); //List<String> mResult = GetALLLDAPInfo("ou=staff","o=wc"); //List<String> mResult = GetALLLDAPInfo("organisationalunit=staff","o=wc"); if (attributeValue("logindisabled").ToLower() == "true") { //studentUtility.updateWcStaffIdentity(ss.NDSName, "SET NDSdisabled = 1"); mTestedOK.Add(ss.queueItem.ToString()); } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { String NDScontext = ""; foreach (studentSpec ss in aStudentSpecSL.Values) { if ((mAttributeValues = GetLDAPInfo("cn=" + ss.NDSName)) != null) { String x = attributeValue("gwexpire").ToString(); if (attributeValue("logindisabled").ToLower() == "false") { //studentUtility.updateWcStaffIdentity(ss.NDSName, "SET NDSdisabled = 0"); mTestedOK.Add(ss.queueItem.ToString()); //Write a coupler job for moveObject here String[] aPath = attributeValue("adspath").Split('='); if (aPath.Length > 0) { NDScontext = aPath[2].Substring(0, aPath[2].IndexOf(',')) + "." + aPath[3].Substring(0, aPath[3].IndexOf(',')) + "." + aPath[4].Substring(0, aPath[4].IndexOf(',')) + "." + aPath[5].ToString(); } if (NDScontext.ToUpper().Trim() != ss.Context.ToUpper().Trim()) { studentUtility.writeCouplerMessageQueueStu(ss.NDSName, "", "MoveObjectNDS"); } } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { //if nds account not exist then delete is true //write a defaultDelete job in the coupler with updateCouplerMessageQueueSet() ? // foreach (studentSpec ss in aStudentSpecSL.Values) { mAttributeValues = GetLDAPInfo("cn=" + ss.NDSName); if (mAttributeValues == null) //if (attributeValue("logindisabled").ToLower() == "true") { studentUtility.writeCouplerMessageQueue(ss.NDSName, "EmpNum=" + ss.QLId.Trim(), "DeleteDefault"); studentUtility.updateWcStaffIdentity(ss.NDSName, "SET job_Title = DELETED NDS record"); mTestedOK.Add(ss.queueItem.ToString()); } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { foreach (studentSpec ss in aStudentSpecSL.Values) { Boolean wNewLoginOk = false; String NewNDSName = ""; String[] AD = ss.ActionData.Split('='); if (AD[0].ToString() == "NewNDS") { NewNDSName = AD[1].ToString(); } // chect to see if the old nds name has been deleted mAttributeValues = GetLDAPInfo("cn=" + ss.NDSName); if (mAttributeValues == null) { // check to see if new nds name has been created mAttributeValues = GetLDAPInfo("cn=" + NewNDSName); if (mAttributeValues.Count > 0) { wNewLoginOk = true; } } if (wNewLoginOk) { // maybe put this in its own coupler class?l // Call staff identity NEW NDS login stored procedure here if (ss.QLId.ToString().Trim().ToLower() != "deleted") { String IDM = "wcIDMupdateNewNDSname " + Convert.ToInt64(ss.QLId); DataView wDV = studentUtility.readDataView(studentUtility.couplerDB, IDM); if (wDV.Count > 0) { if (wDV[0][0].ToString() == "1") { // Success mTestedOK.Add(ss.queueItem.ToString()); } else { if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } } } // TEST the stored Procedure wcIDMupdateNewNDSname here // then do the Application part in defaultCouplerUpdateUserName // maybe call the stored procedure wcIDMupdateNewNDSname to do this /* Success processing * 1. Update NDSName on original * wcStaffIdentity record * 2. Delete the IsPending='Y' * wcStaffIdentity record * 3. Add record to mTestedOk */ } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { foreach (studentSpec ss in aStudentSpecSL.Values) { bool testChangeSite = true; DataView dv = studentUtility.couplerDV( "WHERE " + "(c.whenDone IS NULL) AND " + "(c.action='" + mActionName + "') AND " + "(NDSName='" + ss.NDSName + "') AND " + "(c.queueItem>" + ss.queueItem.ToString() + ")" ); if (dv != null) { if (dv.Count > 0) { testChangeSite = false; } } if (testChangeSite) { mAttributeValues = GetLDAPInfo("cn=" + ss.NDSName); String wADSPath = attributeValue("adspath"); String wTargetSite = ss.ActionData.Replace("NewSite=", ""); Boolean wDoneIt = false; switch (wTargetSite.ToUpper()) { case "LEAMINGTON SPA": wDoneIt = (wADSPath.IndexOf("ou=LSPA,o=WC") > 0); break; case "RUGBY": wDoneIt = (wADSPath.IndexOf("ou=RUG,o=WC") > 0); break; case "TRIDENT PARK": wDoneIt = (wADSPath.IndexOf("ou=TRIDENT,o=WC") > 0); break; case "MORETON MORRELL": wDoneIt = (wADSPath.IndexOf("ou=MM,o=WC") > 0); break; case "HENLEY IN ARDEN": wDoneIt = (wADSPath.IndexOf("ou=ARDN,o=WC") > 0); break; case "PERSHORE": wDoneIt = (wADSPath.IndexOf("ou=PER,o=WC") > 0); break; default: break; } if (wDoneIt) { mTestedOK.Add(ss.queueItem.ToString()); } else if (ss.attempts > mTryCount) { mFailed.Add(ss.queueItem.ToString()); } } else { mTestedOK.Add(ss.queueItem.ToString()); } } }
protected override void testSelectedPhase(studentSpecSL aStudentSpecSL, DateTime runDateTime) { }