Ejemplo n.º 1
0
        public ActionResult Logout()
        {
            HttpCookie cookie = Request.Cookies["AP_Guid"];

            if (cookie == null)
            {
                return(RedirectToAction("Login"));
            }

            Response.AppendCookie(CookieService.DeleteCookies(cookie));
            return(RedirectToAction("Login"));
        }
Ejemplo n.º 2
0
        private void ExecuteLogin(object parameter)
        {
            if (LoginStatus.Equals("LOGOUT"))
            {
                CookieService.DeleteCookies();
                Settings.ComputingId = "";
                Settings.Password    = "";
                Settings.DeleteCourses();

                OnPropertyChanged("LoginStatus");
            }
            else
            {
                NavigationService navigationService = ServiceLocator.GetService <NavigationService>();
                navigationService.Navigate(new Uri("/Pages/LoginDetailsPage.xaml", UriKind.Relative));
            }
        }
Ejemplo n.º 3
0
        private void GetSIMSResponse(IAsyncResult result)
        {
            HttpWebRequest  request  = (HttpWebRequest)result.AsyncState;
            HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(result);

            Cookie casCookie = CookieService.GetCookieWithName("CASTGC");

            CookieService.DeleteCookies();
            if (casCookie != null)
            {
                CookieService.AddCookie(casCookie);
            }
            CookieCollection cookies = request.CookieContainer.GetCookies(new Uri("https://go.sfu.ca"));

            foreach (Cookie cookie in cookies)
            {
                CookieService.AddCookie(cookie);
            }
            //Settings.GetStudentId();
            string         request2String = string.Format("https://sims-prd.sfu.ca/psc/csprd_1/EMPLOYEE/HRMS/c/SA_LEARNER_SERVICES.SS_ES_STUDY_LIST.GBL?Page=SS_ES_STUDY_LIST&Action=U&ACAD_CAREER=UGRD&EMPLID=&INSTITUTION=SFUNV&STRM={0}", SemesterHelper.GetSemesterId());
            HttpWebRequest request2       = (HttpWebRequest)HttpWebRequest.Create(request2String);

            request2.Method          = "GET";
            request2.CookieContainer = new CookieContainer();

            foreach (Cookie cookie in cookies)
            {
                if (cookie.Domain == ".sfu.ca")
                {
                    request2.CookieContainer.Add(new Uri("http://www" + cookie.Domain), cookie);
                }
                else
                {
                    request2.CookieContainer.Add(new Uri("https://" + cookie.Domain), cookie);
                }
            }


            request2.BeginGetResponse(new AsyncCallback(GetClassesResponse), request2);
        }