Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3940


Ignore:
Timestamp:
06/23/10 20:46:30 (14 years ago)
Author:
hmayr
Message:

commit all current changes, so bfarka can try something (#1046):

  • extended DataClasses in Persistence.csproj
  • added DatabaseUtil.cs to Persistence.csproj
  • added HeuristicLabUserTest.cs to UnitTests.csproj
Location:
branches/HeuristicLab.Services.Authentication Prototype
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Services.Authentication Prototype

    • Property svn:ignore
      •  

        old new  
        11*.suo
         2PersistenceTest
         3TestResults
  • branches/HeuristicLab.Services.Authentication Prototype/HeuristicLab.Services.Authentication Prototyp.vsmdi

    r3932 r3940  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<TestLists xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2006">
     3  <TestList name="HeuristicLabUserTestList" id="1ebca506-0e3e-4cc3-800e-9905f9a66bd2" parentListId="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
     4    <Description>just first test for HeuristicLabUser</Description>
     5    <TestLinks>
     6      <TestLink id="def90666-533d-bda5-8a29-fde7f290333f" name="createDBTest" storage="unittests\bin\debug\unittests.dll" type="Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestElement, Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel,   PublicKeyToken=b03f5f7f11d50a3a" />
     7    </TestLinks>
     8  </TestList>
    39  <TestList name="Testlisten" id="8c43106b-9dc1-4907-a29f-aa66a61bf5b6">
    410    <RunConfiguration id="3cde0e70-9e75-4b76-a987-9e1d702958f0" name="Lokaler Testlauf" storage="localtestrun.testrunconfig" type="Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration, Microsoft.VisualStudio.QualityTools.Common,   PublicKeyToken=b03f5f7f11d50a3a" />
  • branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.cs

    r3939 r3940  
     1using System;
    12using System.Web.Security;
     3
    24namespace Persistence {
    35  partial class HeuristicLabUser : MembershipUser {
     6    public override bool ChangePassword(string oldPassword, string newPassword) {
     7      if (oldPassword == null) {
     8        throw new ArgumentNullException("oldPassword");
     9      }
     10      if (newPassword == null) {
     11        throw new ArgumentNullException("newPassword");
     12      }
     13      if (oldPassword.Length == 0) {
     14        throw new ArgumentException("Parameter oldPassword must not be empty!");
     15      }
     16      if (newPassword.Length == 0) {
     17        throw new ArgumentException("Parameter newPassword must not be empty!");
     18      }
     19
     20      if (Password.CompareTo(oldPassword) == 0) {
     21        Password = newPassword;
     22        return true;
     23      } else {
     24        return false;
     25      }
     26    }
     27
     28    public override bool ChangePasswordQuestionAndAnswer(string password, string newPasswordQuestion, string newPasswordAnswer) {
     29      if (password == null) {
     30        throw new ArgumentNullException("password");
     31      }
     32      if (newPasswordQuestion == null) {
     33        throw new ArgumentNullException("newPasswordQuestion");
     34      }
     35      if (newPasswordAnswer == null) {
     36        throw new ArgumentNullException("newPasswordAnswer");
     37      }
     38      if (password.Length == 0) {
     39        throw new ArgumentException("Parameter password must not be empty!");
     40      }
     41      if (newPasswordQuestion.Length == 0) {
     42        throw new ArgumentException("Parameter newPasswordQuestion must not be empty!");
     43      }
     44      if (newPasswordAnswer.Length == 0) {
     45        throw new ArgumentException("Parameter newPasswordAnswer must not be empty!");
     46      }
     47
     48      if (Password.CompareTo(password) == 0) {
     49        _PasswordQuestion = newPasswordQuestion;
     50        PasswordAnswer = newPasswordAnswer;
     51        return true;
     52      } else {
     53        return false;
     54      }
     55    }
     56
     57    public override string GetPassword() {
     58      return Password;
     59    }
     60
     61    //
     62    // Summary:
     63    //     Gets the password for the membership user from the membership data store.
     64    //
     65    // Parameters:
     66    //   passwordAnswer:
     67    //     The password answer for the membership user.
     68    //
     69    // Returns:
     70    //     The password for the membership user.
     71    public override string GetPassword(string passwordAnswer) {
     72      throw new NotImplementedException();
     73    }
     74
     75    //
     76    // Summary:
     77    //     Resets a user's password to a new, automatically generated password.
     78    //
     79    // Returns:
     80    //     The new password for the membership user.
     81    public override string ResetPassword() {
     82      throw new NotImplementedException();
     83    }
     84
     85    //
     86    // Summary:
     87    //     Resets a user's password to a new, automatically generated password.
     88    //
     89    // Parameters:
     90    //   passwordAnswer:
     91    //     The password answer for the membership user.
     92    //
     93    // Returns:
     94    //     The new password for the membership user.
     95    public override string ResetPassword(string passwordAnswer) {
     96      throw new NotImplementedException();
     97    }
     98
     99    public override string ToString() {
     100      return UserName;
     101    }
     102
     103    //
     104    // Summary:
     105    //     Clears the locked-out state of the user so that the membership user can be
     106    //     validated.
     107    //
     108    // Returns:
     109    //     true if the membership user was successfully unlocked; otherwise, false.
     110    public override bool UnlockUser() {
     111      throw new NotImplementedException();
     112    }
    4113  }
    5114}
  • branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml

    r3939 r3940  
    33  <Table Name="" Member="HeuristicLabUsers">
    44    <Type Name="HeuristicLabUser">
    5       <Column Member="Comment" Modifier="Virtual" Type="System.String" CanBeNull="false" />
     5      <Column Name="UserName" Modifier="Override" Type="System.String" IsReadOnly="true" CanBeNull="false" />
     6      <Column Name="Password" Type="System.String" CanBeNull="false" />
     7      <Column Name="PasswordQuestion" Modifier="Override" Type="System.String" IsReadOnly="true" CanBeNull="false" />
     8      <Column Name="LastPasswordChangedDate" Modifier="Override" Type="System.DateTime" IsReadOnly="true" CanBeNull="false" />
     9      <Column Name="Email" Modifier="Override" Type="System.String" CanBeNull="false" />
     10      <Column Name="Comment" Modifier="Override" Type="System.String" CanBeNull="false" />
     11      <Column Name="PasswordAnswer" Type="System.String" CanBeNull="false" />
     12      <Column Member="id" AutoSync="Never" Type="System.Int64" IsReadOnly="true" IsPrimaryKey="true" IsDbGenerated="true" CanBeNull="false" UpdateCheck="Always" />
    613    </Type>
    714  </Table>
  • branches/HeuristicLab.Services.Authentication Prototype/Persistence/DataClasses.dbml.layout

    r3939 r3940  
    33  <DataContextMoniker Name="/DataClassesDataContext" />
    44  <nestedChildShapes>
    5     <classShape Id="d272bb7d-2ecc-4bb7-851f-8e1ecee6fdbd" absoluteBounds="3.625, 1.875, 2, 1.0016910807291666">
     5    <classShape Id="d272bb7d-2ecc-4bb7-851f-8e1ecee6fdbd" absoluteBounds="3.625, 1.875, 2, 2.3478011067708326">
    66      <DataClassMoniker Name="/DataClassesDataContext/HeuristicLabUser" />
    77      <nestedChildShapes>
    8         <elementListCompartment Id="cb578485-5602-4fe8-96b8-63d240ffa2d9" absoluteBounds="3.64, 2.335, 1.9700000000000002, 0.44169108072916663" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
     8        <elementListCompartment Id="cb578485-5602-4fe8-96b8-63d240ffa2d9" absoluteBounds="3.64, 2.335, 1.9700000000000002, 1.7878011067708333" name="DataPropertiesCompartment" titleTextColor="Black" itemTextColor="Black" />
    99      </nestedChildShapes>
    1010    </classShape>
  • branches/HeuristicLab.Services.Authentication Prototype/Persistence/Persistence.csproj

    r3939 r3940  
    5050  </ItemGroup>
    5151  <ItemGroup>
     52    <Compile Include="DatabaseUtil.cs" />
    5253    <Compile Include="DataClasses.cs">
    5354      <DependentUpon>DataClasses.dbml</DependentUpon>
    5455    </Compile>
    55     <Compile Include="HeuristicLabUser.designer.cs">
    56       <AutoGen>True</AutoGen>
    57       <DesignTime>True</DesignTime>
    58       <DependentUpon>HeuristicLabUser.dbml</DependentUpon>
    59     </Compile>
    6056    <Compile Include="Properties\AssemblyInfo.cs" />
    61   </ItemGroup>
    62   <ItemGroup>
    63     <None Include="HeuristicLabUser.dbml">
    64       <Generator>MSLinqToSQLGenerator</Generator>
    65       <LastGenOutput>HeuristicLabUser.designer.cs</LastGenOutput>
    66       <SubType>Designer</SubType>
    67     </None>
    6857  </ItemGroup>
    6958  <ItemGroup>
     
    7160  </ItemGroup>
    7261  <ItemGroup>
    73     <None Include="ClassDiagram1.cd" />
    7462    <None Include="DataClasses.dbml">
    7563      <Generator>MSLinqToSQLGenerator</Generator>
    7664      <SubType>Designer</SubType>
    77     </None>
    78     <None Include="HeuristicLabUser.dbml.layout">
    79       <DependentUpon>HeuristicLabUser.dbml</DependentUpon>
    8065    </None>
    8166  </ItemGroup>
  • branches/HeuristicLab.Services.Authentication Prototype/UnitTests/UnitTests.csproj

    r3932 r3940  
    3939    </Reference>
    4040    <Reference Include="System.Data" />
     41    <Reference Include="System.Data.DataSetExtensions">
     42      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     43    </Reference>
     44    <Reference Include="System.Data.Linq">
     45      <RequiredTargetFramework>3.5</RequiredTargetFramework>
     46    </Reference>
    4147    <Reference Include="System.Runtime.Serialization">
    4248      <RequiredTargetFramework>3.0</RequiredTargetFramework>
     
    5460    <Compile Include="HeuristicLabMembershipProviderTest.cs" />
    5561    <Compile Include="HeuristicLabRoleProviderTest.cs" />
     62    <Compile Include="HeuristicLabUserTest.cs" />
    5663    <Compile Include="Properties\AssemblyInfo.cs" />
    5764  </ItemGroup>
     
    6976    </ProjectReference>
    7077  </ItemGroup>
     78  <ItemGroup>
     79    <Shadow Include="Test References\Persistence.accessor" />
     80  </ItemGroup>
    7181  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
    7282  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Note: See TracChangeset for help on using the changeset viewer.