예제 #1
0
 public static void ResetTestCredentials()
 {
     _testReadCredentials =
         _testWriteCredentials =
             _testAdminCredentials = null;
 }
예제 #2
0
    static public PermissionsAnalysis FirstCredentialsTest
        (string readDatabase, string readServer, string readUser, string readPassword,
        string writeDatabase, string writeServer, string writeUser, string writePassword,
        string adminDatabase, string adminServer, string adminUser, string adminPassword,
        string serverName, string ipAddress)
    {
        if (!(VerifyHostName(serverName) && VerifyHostAddress(ipAddress)))
        {
            if (!System.Diagnostics.Debugger.IsAttached)
            {
                return null; // Probable hack attempt - fail silently
            }
        }

        _testReadCredentials = new SwarmDb.Credentials(
                    readDatabase, new SwarmDb.ServerSet(readServer), readUser, readPassword);
        _testWriteCredentials = new SwarmDb.Credentials(
                    writeDatabase, new SwarmDb.ServerSet(writeServer), writeUser, writePassword);
        _testAdminCredentials = new SwarmDb.Credentials(
                    adminDatabase, new SwarmDb.ServerSet(adminServer), adminUser, adminPassword);

        return RecheckDatabasePermissions();  // Subsequent tests only call this function
    }