Skip to content

Commit

Permalink
Merge pull request #86 from tpokorra/20150909_release_2015-09
Browse files Browse the repository at this point in the history
merge the release 2015-09 into trunk
  • Loading branch information
tpokorra committed Sep 23, 2015
2 parents 72a512d + dd1dd98 commit c496a6f
Show file tree
Hide file tree
Showing 28 changed files with 735 additions and 209 deletions.
1 change: 1 addition & 0 deletions OpenPetra.build
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ useful parameters

<call target="quickClean"/>
<call target="generateSolution"/>
<call target="translation"/>
<call target="recreateDatabase"/>
<call target="resetDatabase"/>

Expand Down
154 changes: 104 additions & 50 deletions csharp/ICT/BuildTools/PatchTool/Library/StatusForm.resx

Large diffs are not rendered by default.

11 changes: 1 addition & 10 deletions csharp/ICT/Common/DB/Access.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2721,22 +2721,13 @@ private object ExecuteScalar(String ASqlStatement,

#endregion

/// <summary>
/// Reads a SQL statement from file and remove the comments.
/// </summary>
/// <returns>SQL statement.</returns>
public static string ReadSqlFile(string ASqlFilename)
{
return ReadSqlFile(ASqlFilename, null);
}

/// <summary>
/// Reads a SQL statement from file and removes the comments.
/// </summary>
/// <param name="ASqlFilename">.</param>
/// <param name="ADefines">Defines to be set in the SQL statement.</param>
/// <returns>SQL statement.</returns>
public static string ReadSqlFile(string ASqlFilename, SortedList <string, string>ADefines)
public static string ReadSqlFile(string ASqlFilename, SortedList <string, string>ADefines = null)
{
string line = null;
string stmt = "";
Expand Down
4 changes: 2 additions & 2 deletions csharp/ICT/Common/Data/TypedDataAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2389,7 +2389,7 @@ public static TVerificationResultCollection BuildVerificationResultCollectionFro
TVerificationResultCollection ReturnValue = new TVerificationResultCollection(VerificationRunGuid);
string MessageHeaderPart1 = Catalog.GetString(String.Format("The '{0}' record", AThisTableLabel));
string MessageHeaderPart2 = Catalog.GetString("{0}\r\n cannot be deleted because\r\n");
string MessageFooter = Catalog.GetString("\r\n {0} from the '{1}' Table:\r\n{2}");
string MessageFooter = Environment.NewLine + Catalog.GetString(" {0} from the '{1}' Table:\r\n{2}");

string[] MessageDetails = null;
string CompleteMessageDetails = String.Empty;
Expand Down Expand Up @@ -2760,4 +2760,4 @@ public void PopulatePKInfoDataFromDataRow()
}
}
}
}
}
21 changes: 10 additions & 11 deletions csharp/ICT/Common/LogWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ public TLogWriter(string LogfileName)
LogfileName = Path.GetFullPath(LogfileName);
}

ULogFileName = LogfileName;

// Test whether I can write to this file.
FileStream temp = null;
try
Expand All @@ -110,16 +108,18 @@ public TLogWriter(string LogfileName)
FLogFileErrorMsg = "Log file is " + ULogFileName;

// Test whether there was a write access today, if not rotate filenames
if (NeedToRotateFiles(ULogFileName))
if (NeedToRotateFiles(LogfileName))
{
RotateFiles(ULogFileName, LogfileName);
RotateFiles(LogfileName);
}

temp = new FileStream(ULogFileName, FileMode.OpenOrCreate, FileAccess.Write);
temp = new FileStream(LogfileName, FileMode.OpenOrCreate, FileAccess.Write);

ULogFileName = LogfileName;
}
catch (Exception e)
{
FLogFileErrorMsg = "Error opening log file " + ULogFileName + ": " + e.Message;
FLogFileErrorMsg = "Error opening log file " + LogfileName + ": " + e.Message;
FCanWriteLogFile = false;
}
finally
Expand All @@ -139,11 +139,10 @@ public TLogWriter(string LogfileName)
///
/// When it comes to rotate the logfiles, the number of each logfile is increased
/// </summary>
/// <param name="ULogFileName">Full Path including filename</param>
/// <param name="LogFileName"> The name of the Logfile</param>
private void RotateFiles(string ULogFileName, string LogFileName)
/// <param name="LogFileName">Full Path including filename</param>
private void RotateFiles(string LogFileName)
{
string LogfilePath = Path.GetDirectoryName(ULogFileName);
string LogfilePath = Path.GetDirectoryName(LogFileName);
string Extension = Path.GetExtension(LogFileName);
string LogFileNameWithoutExtension = Path.GetFileNameWithoutExtension(LogFileName);

Expand Down Expand Up @@ -172,7 +171,7 @@ private void RotateFiles(string ULogFileName, string LogFileName)
string Name = LogFileNameWithoutExtension + "-01" + Extension;
string NewFile = Path.Combine(LogfilePath, Name);

File.Move(ULogFileName, NewFile);
File.Move(LogFileName, NewFile);
}

/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions csharp/ICT/Common/Remoting/Server/ServerManagerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ public String ServerInfoVersion
{
get
{
// Result := 'PETRAServer x.x.x Build xxxxxx/xx/xxxx (OS: ' + ExecutingOSEnumToString(TSrvSetting.ExecutingOS) + ')';
string DLLPath = TAppSettingsManager.ApplicationDirectory + Path.DirectorySeparatorChar +
"Ict.Common.Remoting.Server.dll";

return String.Format(
Catalog.GetString("PETRAServer {0} Build {1} (OS: {2})"),
TSrvSetting.ApplicationVersion.ToString(),
System.IO.File.GetLastWriteTime(Process.GetCurrentProcess().MainModule.FileName).ToString(),
System.IO.File.GetLastWriteTime(DLLPath).ToString(),
CommonTypes.ExecutingOSEnumToString(TSrvSetting.ExecutingOS));

// System.Reflection.Assembly.GetEntryAssembly.FullName does not return the file path
}
}

Expand Down Expand Up @@ -543,4 +543,4 @@ public virtual string TimedProcessingDailyStartTime24Hrs
}
}
}
}
}
121 changes: 121 additions & 0 deletions csharp/ICT/Petra/Client/CommonDialogs/ChangePassword.ManualCode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
//
// DO NOT REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
//
// @Authors:
// timop
//
// Copyright 2004-2015 by OM International
//
// This file is part of OpenPetra.org.
//
// OpenPetra.org is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenPetra.org is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with OpenPetra.org. If not, see <http://www.gnu.org/licenses/>.
//
using System;
using System.Drawing;
using System.Windows.Forms;

using Ict.Common;
using Ict.Common.Verification;
using Ict.Common.Remoting.Shared;
using Ict.Common.Remoting.Client;
using Ict.Petra.Client.App.Core;
using Ict.Petra.Client.App.Core.RemoteObjects;
using Ict.Petra.Shared.MSysMan.Validation;

namespace Ict.Petra.Client.CommonDialogs
{
/// manual methods for the generated window
public partial class TFrmChangePassword
{
private void InitializeManualCode()
{
UserName = string.Empty;
PasswordNeedsChanged = true;
txtOldPassword.PasswordChar = '*';
txtNewPassword.PasswordChar = '*';
txtNewPassword2.PasswordChar = '*';
}

/// <summary>
/// the username of the user that this password is for
/// </summary>
public string UserName { get; set; }
/// <summary>
/// the old password. directly after login, we still have the password, the user does not need to enter it again
/// </summary>
public string OldPassword {
set
{
if (value.Length > 0)
{
txtOldPassword.Visible = false;
lblOldPassword.Visible = false;
txtOldPassword.Text = value;
}
}
}

/// <summary>
/// do we want to enforce the change of the password
/// </summary>
public bool PasswordNeedsChanged { get; set; }

private void RunOnceOnActivationManual()
{
lblChangePassword.Visible = PasswordNeedsChanged;
}

private void BtnOK_Click(Object Sender, EventArgs e)
{
if (txtNewPassword.Text != txtNewPassword2.Text)
{
MessageBox.Show(Catalog.GetString("Passwords do not match! Please try again..."));
return;
}

if (txtNewPassword.Text == this.txtOldPassword.Text && this.PasswordNeedsChanged)
{
MessageBox.Show(String.Format(Catalog.GetString(
"Password not changed as the old password was reused. Please use a new password."), Catalog.GetString("Error")));
return;
}

TVerificationResultCollection VerificationResultCollection;
TVerificationResult VerificationResult;

if (!TSharedSysManValidation.CheckPasswordQuality(txtNewPassword.Text, out VerificationResult))
{
MessageBox.Show(String.Format(Catalog.GetString(
"There was a problem setting the password for user {0}."), UserName) +
Environment.NewLine + VerificationResult.ResultText);
return;
}

if (!TRemote.MSysMan.Maintenance.WebConnectors.SetUserPassword(UserName, txtNewPassword.Text,
txtOldPassword.Text,
PasswordNeedsChanged,
out VerificationResultCollection))
{
MessageBox.Show(String.Format(Catalog.GetString(
"There was a problem setting the password for user {0}."), UserName) +
Environment.NewLine + VerificationResultCollection.BuildVerificationResultString());
return;
}

MessageBox.Show(String.Format(Catalog.GetString("Password was successfully set for user {0}"), UserName),
Catalog.GetString("Success"));
this.DialogResult = DialogResult.OK;
}
}
}
34 changes: 34 additions & 0 deletions csharp/ICT/Petra/Client/CommonDialogs/ChangePassword.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
RootNode:
BaseYaml: ../CommonForms/PetraFormDialog.yaml
Namespace: Ict.Petra.Client.CommonDialogs
FormType: dialog
Template: window
FormTitle: New Password
#Icon: petraico-big.ico
WindowWidth: 450
WindowHeight: 200

Controls:
pnlDialogContent:
Controls:
Row0: [lblChangePassword]
Row1: [txtOldPassword]
Row2: [txtNewPassword]
Row3: [txtNewPassword2]

lblChangePassword:
Label: You need to change your password immediately
txtOldPassword:
Label: Your old password
Width: 150
txtNewPassword:
Label: The new password
Width: 150
txtNewPassword2:
Label: Repeat the new password
Width: 150
btnHelp: {Visible=false}
btnOK: {Visible=true}
btnCancel: {Visible=true}
pnlDialogButtons: {Visible=true}
stbMain: {Visible=false}
Loading

0 comments on commit c496a6f

Please sign in to comment.