Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.4 KiB

  1. <%@ Page Language='C#' Trace='true' Debug='true'%>
  2. <script language='C#' runat='server'>
  3. protected PassportIdentity passport;
  4. protected bool secure;
  5. protected string returnUrl;
  6. protected string thisUrl;
  7. protected void Page_Init( object sender, EventArgs e )
  8. {
  9. passport = (PassportIdentity)Context.User.Identity;
  10. secure = Request.IsSecureConnection;
  11. if( null != Request[ "ru" ] )
  12. Session[ "ru" ] = Request[ "ru" ];
  13. returnUrl = (string)Session[ "ru" ];
  14. thisUrl = ( Request.IsSecureConnection ? "https://" : "http://" ) +
  15. Request.ServerVariables[ "SERVER_NAME" ] +
  16. Request.ServerVariables[ "SCRIPT_NAME" ];
  17. }
  18. protected void Page_Load( object sender, EventArgs e )
  19. {
  20. if( passport.GetIsAuthenticated( 14400, true, false ) )
  21. {
  22. if( null == Request[ "t" ] || null == Request[ "p" ] )
  23. Response.Redirect( passport.AuthUrl( thisUrl, 14400, true, "", 0, "", 0, secure ) );
  24. string authinfo = Request[ "t" ] + ";" + Request[ "p" ];
  25. if( returnUrl.IndexOf( "?" ) >= 0 )
  26. Response.Redirect( returnUrl + "&authinfo=" + authinfo );
  27. else
  28. Response.Redirect( returnUrl + "?authinfo=" + authinfo );
  29. }
  30. else if( passport.HasTicket )
  31. Response.Redirect( passport.AuthUrl( thisUrl, 14400, true, "", 0, "", 0, secure ) );
  32. }
  33. </script>
  34. <%=passport.LogoTag( thisUrl, 14400, true, "", 0, secure, "", 0, false ) %>