Changeset 2546


Ignore:
Timestamp:
Jan 31, 2011, 10:25:53 PM (10 years ago)
Author:
kopal
Message:
  • downloading a job now uses hash to avoid storing a job twice on the users hard drive
  • typo corrected
Location:
trunk/CrypPlugins/P2PEditor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/P2PEditor/Distributed/DistributedJob.cs

    r1727 r2546  
    33using System.IO;
    44using Cryptool.P2P;
     5using System.Security.Cryptography;
    56
    67namespace Cryptool.P2PEditor.Distributed
     
    7172                if (value == localFilePath) return;
    7273                localFilePath = value;
    73                 FileName = Path.GetFileName(localFilePath);
     74                //FileName = Path.GetFileName(localFilePath);
    7475                OnPropertyChanged("LocalFilePath");
    7576            }
     
    9697            }
    9798
    98             // Avoid overwriting previous versions of this workspace or workspaces with common names by adding an integer prefix
    99             var originalFileName = FileName;
    100             LocalFilePath = Path.Combine(workspacePath, Owner + "_" + originalFileName);
    101             var counter = 0;
    102             while (File.Exists(LocalFilePath))
    103             {
    104                 LocalFilePath = Path.Combine(workspacePath, counter++ + "_" + Owner + "_" + originalFileName);
    105             }
    106 
    10799            if (rawWorkspaceData == null || rawWorkspaceData.Length == 0)
    108100            {
    109101                throw new NotSupportedException("Workspace data could not be fetched using Peer-to-Peer system.");
     102            }
     103           
     104            HashAlgorithm hashAlgorithm = new MD5CryptoServiceProvider();
     105            string hash = BitConverter.ToString(hashAlgorithm.ComputeHash(rawWorkspaceData)).Replace("-", "");
     106            LocalFilePath = Path.Combine(workspacePath, Owner + "_" + hash + "_" + FileName);
     107
     108            if (File.Exists(LocalFilePath))
     109            {               
     110                return;
    110111            }
    111112
  • trunk/CrypPlugins/P2PEditor/GUI/Controls/VerifyPasswordResetView.xaml

    r2478 r2546  
    2222            <Label Content="Password reset verification"  Grid.ColumnSpan="2" Margin="0,0,0,56" FontSize="15" FontWeight="Bold" HorizontalAlignment="Center" />
    2323            <TextBlock Grid.ColumnSpan="2" Margin="5,32,0,0" FlowDirection="LeftToRight" HorizontalAlignment="Center">
    24             Please enter the assword reset verification code which you should have received by email. <LineBreak/>
     24            Please enter the password reset verification code which you should have received by email. <LineBreak/>
    2525            Also choose a new password and confirm it. By clicking the reset button you will receive your new<LineBreak/>
    2626            account data immediately.
Note: See TracChangeset for help on using the changeset viewer.