Fix for running against RabbitMQ 2.2
[mono.git] / mcs / class / System.Web / System.Web.Security / PassportIdentity.cs
index 937e825eecc7069b8723f5c52b73e2824d6db579..3191c265676b165ac31d7d78329e85508c68a11c 100644 (file)
@@ -1,36 +1,71 @@
 //
-// System.Web.Security.PassportIdentity
+// System.Web.Security.PassportIdentity.cs
 //
 // Authors:
-//     Gonzalo Paniagua Javier (gonzalo@ximian.com)
+//   Gonzalo Paniagua Javier (gonzalo@ximian.com)
+//   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
 //
 // (C) 2002 Ximian, Inc (http://www.ximian.com)
+// Copyright (C) 2005-2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-using System;
+using System.Security.Permissions;
 using System.Security.Principal;
 
-namespace System.Web.Security
-{
-       public sealed class PassportIdentity : IIdentity
-       {
-               [MonoTODO]
+namespace System.Web.Security {
+
+       [MonoNotSupported ("")]
+       [MonoTODO("Not implemented")]
+       // CAS - no InheritanceDemand here as the class is sealed
+       [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
+#if NET_4_0
+       [Obsolete ("This type is obsolete. The Passport authentication product is no longer supported and has been superseded by Live ID.")]
+#endif
+#if NET_2_0
+       public sealed class PassportIdentity : IIdentity, IDisposable {
+#else
+       public sealed class PassportIdentity : IIdentity {
+#endif
+               [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
                public PassportIdentity ()
                {
-                       throw new NotImplementedException ();
                }
 
                ~PassportIdentity ()
                {
                }
 
-               [MonoTODO]
                public string AuthUrl ()
                {
-                       throw new NotImplementedException ();
+                       return AuthUrl (null, -1, -1, null, -1, null, -1, -1);
                }
 
-               [MonoTODO]
+#if (!NET_1_0)
+               public string AuthUrl (String strReturnUrl)
+               {
+                       return AuthUrl (strReturnUrl, -1, -1, null, -1, null, -1, -1);
+               }
+#endif
+
                public string AuthUrl (string strReturnUrl,
                                       int iTimeWindow,
                                       bool fForceLogin,
@@ -40,10 +75,10 @@ namespace System.Web.Security
                                       int iKPP,
                                       bool bUseSecureAuth)
                {
-                       throw new NotImplementedException ();
+                       return AuthUrl (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string AuthUrl (string strReturnUrl,
                                       int iTimeWindow,
                                       int iForceLogin,
@@ -56,13 +91,18 @@ namespace System.Web.Security
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public string AuthUrl2 ()
                {
-                       throw new NotImplementedException ();
+                       return AuthUrl2 (null, -1, -1, null, -1, null, -1, -1);
+               }
+
+#if (!NET_1_0)
+               public string AuthUrl2 (String strReturnUrl)
+               {
+                       return AuthUrl2 (strReturnUrl, -1, -1, null, -1, null, -1, -1);
                }
+#endif
 
-               [MonoTODO]
                public string AuthUrl2 (string strReturnUrl,
                                        int iTimeWindow,
                                        bool fForceLogin,
@@ -72,10 +112,10 @@ namespace System.Web.Security
                                        int iKPP,
                                        bool bUseSecureAuth)
                {
-                       throw new NotImplementedException ();
+                       return AuthUrl2 (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string AuthUrl2 (string strReturnUrl,
                                        int iTimeWindow,
                                        int iForceLogin,
@@ -88,85 +128,90 @@ namespace System.Web.Security
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public static string Compress (string strData)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public static bool CryptIsValid ()
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public static int CryptPutHost (string strHost)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public static int CryptPutSite (string strSite)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public static string Decompress (string strData)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public static string Decrypt (string strData)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public static string Encrypt (string strData)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public object GetCurrentConfig (string strAttribute)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string GetDomainAttribute (string strAttribute, int iLCID, string strDomain)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string GetDomainFromMemberName (string strMemberName)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public bool GetIsAuthenticated (int iTimeWindow, bool bForceLogin, bool bCheckSecure)
                {
-                       throw new NotImplementedException ();
+                       return this.GetIsAuthenticated (iTimeWindow, (bForceLogin ? 1 : 0), (bCheckSecure ? 1 : 0));
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public bool GetIsAuthenticated (int iTimeWindow, int iForceLogin, int iCheckSecure)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public string GetLoginChallenge ()
                {
-                       throw new NotImplementedException ();
+                       return GetLoginChallenge (null, -1, -1, null, -1, null, -1, -1, null);
                }
 
-               [MonoTODO]
+#if (!NET_1_0)
+               public string GetLoginChallenge (String strReturnUrl)
+               {
+                       return GetLoginChallenge (strReturnUrl, -1, -1, null, -1, null, -1, -1, null);
+               }
+#endif
+
+               [MonoTODO("Not implemented")]
                public string GetLoginChallenge (string szRetURL,
                                                 int iTimeWindow,
                                                 int fForceLogin,
@@ -180,43 +225,48 @@ namespace System.Web.Security
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public object GetOption (string strOpt)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public object GetProfileObject (string strProfileName)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public bool HasFlag (int iFlagMask)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public bool HasProfile (string strProfile)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public bool HaveConsent (bool bNeedFullConsent, bool bNeedBirthdate)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public int LoginUser ()
                {
-                       throw new NotImplementedException ();
+                       return LoginUser (null, -1, -1, null, -1, null, -1, -1, null);
                }
 
-               [MonoTODO]
+#if (!NET_1_0)
+               public int LoginUser (String strReturnUrl)
+               {
+                       return LoginUser (strReturnUrl, -1, -1, null, -1, null, -1, -1, null);
+               }
+#endif
+
                public int LoginUser (string szRetURL,
                                      int iTimeWindow,
                                      bool fForceLogin,
@@ -227,10 +277,10 @@ namespace System.Web.Security
                                      bool fUseSecureAuth,
                                      object oExtraParams)
                {
-                       throw new NotImplementedException ();
+                       return LoginUser (szRetURL, iTimeWindow, (fForceLogin ? 1 : 0), szCOBrandArgs, iLangID, strNameSpace, iKPP, (fUseSecureAuth ? 1 : 0), null);
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public int LoginUser (string szRetURL,
                                      int iTimeWindow,
                                      int fForceLogin,
@@ -244,13 +294,18 @@ namespace System.Web.Security
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public string LogoTag ()
                {
-                       throw new NotImplementedException ();
+                       return LogoTag (null, -1, -1, null, -1, -1, null, -1, -1);
                }
 
-               [MonoTODO]
+#if (!NET_1_0)
+               public string LogoTag (String strReturnUrl)
+               {
+                       return LogoTag (strReturnUrl, -1, -1, null, -1, -1, null, -1, -1);
+               }
+#endif
+
                public string LogoTag (string strReturnUrl,
                                       int iTimeWindow,
                                       bool fForceLogin,
@@ -261,10 +316,10 @@ namespace System.Web.Security
                                       int iKPP,
                                       bool bUseSecureAuth)
                {
-                       throw new NotImplementedException ();
+                       return LogoTag (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, (fSecure ? 1 : 0), strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string LogoTag (string strReturnUrl,
                                       int iTimeWindow,
                                       int iForceLogin,
@@ -278,13 +333,18 @@ namespace System.Web.Security
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public string LogoTag2 ()
                {
-                       throw new NotImplementedException ();
+                       return LogoTag2 (null, -1, -1, null, -1, -1, null, -1, -1);
                }
 
-               [MonoTODO]
+#if (!NET_1_0)
+               public string LogoTag2 (String strReturnUrl)
+               {
+                       return LogoTag2 (strReturnUrl, -1, -1, null, -1, -1, null, -1, -1);
+               }
+#endif
+
                public string LogoTag2 (string strReturnUrl,
                                        int iTimeWindow,
                                        bool fForceLogin,
@@ -295,10 +355,10 @@ namespace System.Web.Security
                                        int iKPP,
                                        bool bUseSecureAuth)
                {
-                       throw new NotImplementedException ();
+                       return LogoTag2 (strReturnUrl, iTimeWindow, (fForceLogin ? 1 : 0), strCoBrandedArgs, iLangID, (fSecure ? 1 : 0), strNameSpace, iKPP, (bUseSecureAuth ? 1 : 0));
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string LogoTag2 (string strReturnUrl,
                                        int iTimeWindow,
                                        int iForceLogin,
@@ -312,13 +372,12 @@ namespace System.Web.Security
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public string LogoutURL ()
                {
-                       throw new NotImplementedException ();
+                       return LogoutURL (null, null, -1, null, -1);
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string LogoutURL (string szReturnURL,
                                         string szCOBrandArgs,
                                         int iLangID,
@@ -328,25 +387,25 @@ namespace System.Web.Security
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public void SetOption (string strOpt, object vOpt)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public static void SignOut (string strSignOutDotGifFileName)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public object Ticket (string strAttribute)
                {
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string AuthenticationType
                {
                        get {
@@ -354,7 +413,7 @@ namespace System.Web.Security
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public int Error
                {
                        get {
@@ -362,7 +421,7 @@ namespace System.Web.Security
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public bool GetFromNetworkServer
                {
                        get {
@@ -370,7 +429,7 @@ namespace System.Web.Security
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public bool HasSavedPassword
                {
                        get {
@@ -378,7 +437,7 @@ namespace System.Web.Security
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public bool HasTicket
                {
                        get {
@@ -386,7 +445,7 @@ namespace System.Web.Security
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string HexPUID
                {
                        get {
@@ -394,7 +453,7 @@ namespace System.Web.Security
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public bool IsAuthenticated
                {
                        get {
@@ -402,7 +461,7 @@ namespace System.Web.Security
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string this [string strProfileName]
                {
                        get {
@@ -410,7 +469,7 @@ namespace System.Web.Security
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public string Name
                {
                        get {
@@ -418,7 +477,7 @@ namespace System.Web.Security
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public int TicketAge
                {
                        get {
@@ -426,13 +485,19 @@ namespace System.Web.Security
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO("Not implemented")]
                public int TimeSinceSignIn
                {
                        get {
                                throw new NotImplementedException ();
                        }
                }
+
+#if NET_2_0
+               void IDisposable.Dispose ()
+               {
+               }
+#endif
        }
 }