simias-svn Mailing List for simias (Page 11)
Brought to you by:
srinidhi_bs
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
|
Feb
(16) |
Mar
(9) |
Apr
(20) |
May
(24) |
Jun
(30) |
Jul
(29) |
Aug
(47) |
Sep
(11) |
Oct
(5) |
Nov
(3) |
Dec
(1) |
| 2011 |
Jan
(5) |
Feb
(2) |
Mar
(6) |
Apr
(15) |
May
(3) |
Jun
(2) |
Jul
(2) |
Aug
(5) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(6) |
Sep
(20) |
Oct
(5) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ra...@us...> - 2010-04-27 13:21:58
|
Revision: 7344
http://simias.svn.sourceforge.net/simias/?rev=7344&view=rev
Author: ravim85
Date: 2010-04-27 13:21:52 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
Bumping version to 3.8.0.3 in simias for Windows Client
Modified Paths:
--------------
branches/iFolder_3.8.0_updates/src/core/FlaimProvider/FlaimWrapper/FlaimWrapper.vcproj
branches/iFolder_3.8.0_updates/src/core/POBoxWS/Properties/AssemblyInfo.cs
branches/iFolder_3.8.0_updates/src/core/Properties/AssemblyInfo.cs
branches/iFolder_3.8.0_updates/src/core/SimiasApp/Properties/AssemblyInfo.cs
branches/iFolder_3.8.0_updates/src/core/SimiasClient/Properties/AssemblyInfo.cs
branches/iFolder_3.8.0_updates/src/core/SyncService/Properties/AssemblyInfo.cs
branches/iFolder_3.8.0_updates/src/core/WebService/Properties/AssemblyInfo.cs
Modified: branches/iFolder_3.8.0_updates/src/core/FlaimProvider/FlaimWrapper/FlaimWrapper.vcproj
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/FlaimProvider/FlaimWrapper/FlaimWrapper.vcproj 2010-04-27 11:33:19 UTC (rev 7343)
+++ branches/iFolder_3.8.0_updates/src/core/FlaimProvider/FlaimWrapper/FlaimWrapper.vcproj 2010-04-27 13:21:52 UTC (rev 7344)
@@ -84,7 +84,7 @@
Name="VCLinkerTool"
AdditionalDependencies="rpcrt4.lib ws2_32.lib odbc32.lib odbccp32.lib flaim.lib msvcrt.lib"
OutputFile=".\Release/FlaimWrapper.dll"
- Version="3.8.0.2"
+ Version="3.8.0.3"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""$(SolutionDir)..\..\dependencies\external\libflaim\win32""
@@ -186,7 +186,7 @@
Name="VCLinkerTool"
AdditionalDependencies="rpcrt4.lib ws2_32.lib odbc32.lib odbccp32.lib dbghelp.lib flaim.lib flaimtk.lib msvcrt.lib"
OutputFile=".\Release/FlaimWrapper.dll"
- Version="3.8.0.2"
+ Version="3.8.0.3"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""$(SolutionDir)..\..\dependencies\external\libflaim\win64""
Modified: branches/iFolder_3.8.0_updates/src/core/POBoxWS/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/POBoxWS/Properties/AssemblyInfo.cs 2010-04-27 11:33:19 UTC (rev 7343)
+++ branches/iFolder_3.8.0_updates/src/core/POBoxWS/Properties/AssemblyInfo.cs 2010-04-27 13:21:52 UTC (rev 7344)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.2")]
-[assembly: AssemblyFileVersion("3.8.0.2")]
+[assembly: AssemblyVersion("3.8.0.3")]
+[assembly: AssemblyFileVersion("3.8.0.3")]
Modified: branches/iFolder_3.8.0_updates/src/core/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/Properties/AssemblyInfo.cs 2010-04-27 11:33:19 UTC (rev 7343)
+++ branches/iFolder_3.8.0_updates/src/core/Properties/AssemblyInfo.cs 2010-04-27 13:21:52 UTC (rev 7344)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.2")]
-[assembly: AssemblyFileVersion("3.8.0.2")]
+[assembly: AssemblyVersion("3.8.0.3")]
+[assembly: AssemblyFileVersion("3.8.0.3")]
Modified: branches/iFolder_3.8.0_updates/src/core/SimiasApp/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/SimiasApp/Properties/AssemblyInfo.cs 2010-04-27 11:33:19 UTC (rev 7343)
+++ branches/iFolder_3.8.0_updates/src/core/SimiasApp/Properties/AssemblyInfo.cs 2010-04-27 13:21:52 UTC (rev 7344)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.2")]
-[assembly: AssemblyFileVersion("3.8.0.2")]
+[assembly: AssemblyVersion("3.8.0.3")]
+[assembly: AssemblyFileVersion("3.8.0.3")]
Modified: branches/iFolder_3.8.0_updates/src/core/SimiasClient/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/SimiasClient/Properties/AssemblyInfo.cs 2010-04-27 11:33:19 UTC (rev 7343)
+++ branches/iFolder_3.8.0_updates/src/core/SimiasClient/Properties/AssemblyInfo.cs 2010-04-27 13:21:52 UTC (rev 7344)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.2")]
-[assembly: AssemblyFileVersion("3.8.0.2")]
+[assembly: AssemblyVersion("3.8.0.3")]
+[assembly: AssemblyFileVersion("3.8.0.3")]
Modified: branches/iFolder_3.8.0_updates/src/core/SyncService/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/SyncService/Properties/AssemblyInfo.cs 2010-04-27 11:33:19 UTC (rev 7343)
+++ branches/iFolder_3.8.0_updates/src/core/SyncService/Properties/AssemblyInfo.cs 2010-04-27 13:21:52 UTC (rev 7344)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.2")]
-[assembly: AssemblyFileVersion("3.8.0.2")]
+[assembly: AssemblyVersion("3.8.0.3")]
+[assembly: AssemblyFileVersion("3.8.0.3")]
Modified: branches/iFolder_3.8.0_updates/src/core/WebService/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/WebService/Properties/AssemblyInfo.cs 2010-04-27 11:33:19 UTC (rev 7343)
+++ branches/iFolder_3.8.0_updates/src/core/WebService/Properties/AssemblyInfo.cs 2010-04-27 13:21:52 UTC (rev 7344)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.2")]
-[assembly: AssemblyFileVersion("3.8.0.2")]
+[assembly: AssemblyVersion("3.8.0.3")]
+[assembly: AssemblyFileVersion("3.8.0.3")]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ra...@us...> - 2010-04-27 11:33:25
|
Revision: 7343
http://simias.svn.sourceforge.net/simias/?rev=7343&view=rev
Author: ravim85
Date: 2010-04-27 11:33:19 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
Remember password option was not working in Windows client - post multi byte login commit. Issue is resolved, password is not encoded if it is null.
Modified Paths:
--------------
trunk/src/core/Domain/DomainAgent.cs
Modified: trunk/src/core/Domain/DomainAgent.cs
===================================================================
--- trunk/src/core/Domain/DomainAgent.cs 2010-04-27 11:30:45 UTC (rev 7342)
+++ trunk/src/core/Domain/DomainAgent.cs 2010-04-27 11:33:19 UTC (rev 7343)
@@ -541,11 +541,15 @@
}
UTF8Encoding utf8Name = new UTF8Encoding();
- byte[] encodedCredsByteArray = utf8Name.GetBytes(user);
- string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(user);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
- encodedCredsByteArray = utf8Name.GetBytes(password);
- string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+ string iFolderPassBase64 = null;
+ if (password != null)
+ {
+ encodedCredsByteArray = utf8Name.GetBytes(password);
+ iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+ }
// Build a credential from the user name and password.
NetworkCredential myCred = new NetworkCredential( iFolderUserBase64, iFolderPassBase64 );
@@ -626,6 +630,7 @@
// Get the Home Server.
domainService.Credentials = oldServer ? myOldCred : myCred ;
+ domainService.PreAuthenticate = true;
string hostID = null;
HostInfo hInfo = new HostInfo();
@@ -911,11 +916,15 @@
bool oldServer = false;
UTF8Encoding utf8Name = new UTF8Encoding();
- byte[] encodedCredsByteArray = utf8Name.GetBytes(Username);
- string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(Username);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
- encodedCredsByteArray = utf8Name.GetBytes(Password);
- string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+ string iFolderPassBase64 = null;
+ if (Password != null)
+ {
+ encodedCredsByteArray = utf8Name.GetBytes(Password);
+ iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+ }
NetworkCredential myCred = new NetworkCredential( iFolderUserBase64, iFolderPassBase64 );
NetworkCredential myOldCred = new NetworkCredential( Username, Password );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ra...@us...> - 2010-04-27 11:30:51
|
Revision: 7342
http://simias.svn.sourceforge.net/simias/?rev=7342&view=rev
Author: ravim85
Date: 2010-04-27 11:30:45 +0000 (Tue, 27 Apr 2010)
Log Message:
-----------
Remember password option was not working in Windows client - post multi byte login commit. Issue is resolved, password is not encoded if it is null.
Modified Paths:
--------------
branches/iFolder_3.8.0_updates/src/core/Domain/DomainAgent.cs
Modified: branches/iFolder_3.8.0_updates/src/core/Domain/DomainAgent.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/Domain/DomainAgent.cs 2010-04-21 13:45:30 UTC (rev 7341)
+++ branches/iFolder_3.8.0_updates/src/core/Domain/DomainAgent.cs 2010-04-27 11:30:45 UTC (rev 7342)
@@ -541,12 +541,16 @@
}
UTF8Encoding utf8Name = new UTF8Encoding();
- byte[] encodedCredsByteArray = utf8Name.GetBytes(user);
- string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(user);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ string iFolderPassBase64 = null;
+ if (password != null)
+ {
+ encodedCredsByteArray = utf8Name.GetBytes(password);
+ iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+ }
- encodedCredsByteArray = utf8Name.GetBytes(password);
- string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
-
// Build a credential from the user name and password.
NetworkCredential myCred = new NetworkCredential( iFolderUserBase64, iFolderPassBase64 );
NetworkCredential myOldCred = new NetworkCredential( user, password );
@@ -625,7 +629,8 @@
log.Debug("Got else Status {0}", status.statusCode);
// Get the Home Server.
- domainService.Credentials = oldServer ? myOldCred : myCred ;
+ domainService.Credentials = oldServer ? myOldCred : myCred ;
+ domainService.PreAuthenticate = true;
string hostID = null;
HostInfo hInfo = new HostInfo();
@@ -911,11 +916,15 @@
bool oldServer = false;
UTF8Encoding utf8Name = new UTF8Encoding();
- byte[] encodedCredsByteArray = utf8Name.GetBytes(Username);
- string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
-
- encodedCredsByteArray = utf8Name.GetBytes(Password);
- string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(Username);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ string iFolderPassBase64 = null;
+ if (Password != null)
+ {
+ encodedCredsByteArray = utf8Name.GetBytes(Password);
+ iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+ }
NetworkCredential myCred = new NetworkCredential( iFolderUserBase64, iFolderPassBase64 );
NetworkCredential myOldCred = new NetworkCredential( Username, Password );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sp...@us...> - 2010-04-21 13:45:37
|
Revision: 7341
http://simias.svn.sourceforge.net/simias/?rev=7341&view=rev
Author: spkumar
Date: 2010-04-21 13:45:30 +0000 (Wed, 21 Apr 2010)
Log Message:
-----------
Tool to import iFolder/directory/file to iFolder Server from backup
location
Modified Paths:
--------------
trunk/configure.in
trunk/src/core/CollectionStore/Collection.cs
trunk/src/core/CollectionStore/Member.cs
trunk/src/core/CollectionStore/Store.cs
trunk/src/core/SimiasClient/Makefile.am
trunk/src/core/SimiasClient/SimiasService.cs
trunk/src/core/SimiasClient/SimiasService2.cs
trunk/src/core/Storage/PropertyTags.cs
trunk/src/core/Sync/SyncFile.cs
trunk/src/core/WebService/Simias.asmx.cs
trunk/src/core/WebService/Simias.wsdl
trunk/src/core/libsimias/Makefile.am
trunk/src/server/Simias.Server/Catalog.cs
trunk/src/server/Simias.Server/HostProvider.cs
trunk/src/server/setup/SimiasServerSetup.cs
trunk/src/utils/Makefile.am
trunk/src/webservices/Upload.ashx.cs
trunk/src/webservices/iFolder.cs
trunk/src/webservices/iFolderAdmin.asmx.cs
trunk/src/webservices/iFolderAdminLocal.asmx.cs
Added Paths:
-----------
trunk/src/utils/restore/
trunk/src/utils/restore/AssemblyInfo.cs.in
trunk/src/utils/restore/FSBiFolderRestore.in
trunk/src/utils/restore/Makefile.am
trunk/src/utils/restore/iFolderAdminProxy.cs
trunk/src/utils/restore/iFolderServer.cs
trunk/src/utils/restore/iFolderWebProxy.cs
trunk/src/utils/restore/xmlDocProcessing.cs
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2010-04-21 13:40:57 UTC (rev 7340)
+++ trunk/configure.in 2010-04-21 13:45:30 UTC (rev 7341)
@@ -796,6 +796,7 @@
src/utils/usercmd/simias-delete-user
src/utils/usercmd/simias-user
src/utils/usercmd/simias-user.cmd
+src/utils/restore/Makefile
package/Makefile
package/windows/Makefile
package/darwin/Makefile
Modified: trunk/src/core/CollectionStore/Collection.cs
===================================================================
--- trunk/src/core/CollectionStore/Collection.cs 2010-04-21 13:40:57 UTC (rev 7340)
+++ trunk/src/core/CollectionStore/Collection.cs 2010-04-21 13:45:30 UTC (rev 7341)
@@ -342,6 +342,96 @@
}
}
+ /// <summary>
+ /// Get/Set DataMovement value
+ /// </summary>
+ public int TotalRestoreFileCount
+ {
+ get
+ {
+ Property p = properties.FindSingleValue(PropertyTags.TotalRestoreFileCount);
+ if ( p != null )
+ return (int)p.Value;
+ else
+ return -1;
+ }
+ set
+ {
+ if( value != -1)
+ {
+ Property p = new Property( PropertyTags.TotalRestoreFileCount, value );
+ p.LocalProperty = true;
+ this.Properties.ModifyProperty( p );
+ }
+ else
+ {
+ Property p = properties.FindSingleValue(PropertyTags.TotalRestoreFileCount);
+ if (p != null )
+ p.DeleteProperty();
+ }
+ }
+ }
+
+
+ public int RestoredFileCount
+ {
+ get
+ {
+ Property p = properties.FindSingleValue(PropertyTags.RestoredFileCount);
+ if ( p != null )
+ return (int)p.Value;
+ else
+ return -1;
+ }
+ set
+ {
+ if( value != -1)
+ {
+ Property p = new Property( PropertyTags.RestoredFileCount, value );
+ p.LocalProperty = true;
+ this.Properties.ModifyProperty( p );
+ }
+ else
+ {
+ Property p = properties.FindSingleValue(PropertyTags.RestoredFileCount);
+ if (p != null )
+ p.DeleteProperty();
+ }
+ }
+ }
+
+
+ /// <summary>
+ /// Get/Set DataMovement value
+ /// </summary>
+ public int RestoreStatus
+ {
+ get
+ {
+ Property p = properties.FindSingleValue(PropertyTags.Restore);
+ if ( p != null )
+ return (int)p.Value;
+ else
+ return -1;
+ }
+ set
+ {
+ if( value != -1)
+ {
+ Property p = new Property( PropertyTags.Restore, value );
+ p.LocalProperty = true;
+ this.Properties.ModifyProperty( p );
+ }
+ else
+ {
+ Property p = properties.FindSingleValue(PropertyTags.Restore);
+ if (p != null )
+ p.DeleteProperty();
+ }
+ }
+ }
+
+
/// <summary>
/// Get/Set details about MigratedFolder
/// </summary>
@@ -1401,7 +1491,30 @@
node.Properties.ModifyNodeProperty( PropertyTags.LocalIncarnation, incarnationValue);
}
+ public Collection SetEncryptionProperties(string eKey, string eBlob, string eAlgorithm, string rKey)
+ {
+ //Set the Encryption status of the collection. This needs to be used for all reporting
+ Property p = properties.FindSingleValue(PropertyTags.SecurityStatus);
+ int securityStatus = 0;
+ if( p!= null)
+ securityStatus = (int)p.Value;
+ securityStatus |= (int)SecurityStatus.Encryption;
+ properties.AddNodeProperty(PropertyTags.EncryptionType, eAlgorithm);
+
+ properties.AddNodeProperty(PropertyTags.EncryptionKey, eKey);
+ properties.AddNodeProperty(PropertyTags.EncryptionBlob, eBlob);
+
+ properties.AddNodeProperty(PropertyTags.EncryptionVersion, EncVersion.version.ToString());
+ properties.AddNodeProperty(PropertyTags.RecoveryKey, rKey);
+ // Add the security status property. This needs to be used for all reporting in Web and client
+ properties.AddNodeProperty(PropertyTags.SecurityStatus, securityStatus);
+ this.Commit();
+ return this;
+ }
+
+
+
/// <summary>
/// Returns whether the specified Node object is a deleted Node object type.
/// </summary>
@@ -3683,6 +3796,26 @@
return node;
}
+ public Node GetNodeByPath( string entryPath)
+ {
+ ICSList children = this.Search(PropertyTags.FileSystemPath, entryPath, SearchOp.Equal);
+ Node n = null;
+ foreach(ShallowNode sn in children)
+ {
+ Node child = this.GetNodeByID(sn.ID);
+
+ if (child.IsBaseType(NodeTypes.FileNodeType) || child.IsBaseType(NodeTypes.DirNodeType))
+ {
+ n = child;
+ break;
+ }
+ }
+
+ return n;
+
+ }
+
+
/// <summary>
/// Clears the node cache
/// </summary>
Modified: trunk/src/core/CollectionStore/Member.cs
===================================================================
--- trunk/src/core/CollectionStore/Member.cs 2010-04-21 13:40:57 UTC (rev 7340)
+++ trunk/src/core/CollectionStore/Member.cs 2010-04-21 13:45:30 UTC (rev 7341)
@@ -1685,8 +1685,20 @@
/// </summary>
public bool ReSetPassPhrase(string OldPassphrase, string Passphrase, string RAName, string RAPublicKey)
{
- if(ValidatePassPhrase(OldPassphrase) != Simias.Authentication.StatusCodes.Success)
- return false;
+ log.Debug("Enter ReSetPassPhrase Function, old :{0} , new:{1}, RAName:{2}, RAPublicKey:{3}",
+ OldPassphrase, Passphrase, RAName, RAPublicKey);
+ bool decryptpassed = true;
+ if (ValidatePassPhrase(OldPassphrase) != Simias.Authentication.StatusCodes.Success)
+ {
+ log.Debug("Failed for Old:{0}", OldPassphrase);
+ if (ValidatePassPhrase(Passphrase) != Simias.Authentication.StatusCodes.Success)
+ {
+ log.Debug("Reset Pass phrase passed for both old and new:{0}", Passphrase);
+ return false;
+ }
+ log.Debug("Reset Pass phrase passed for old and and passed for new");
+ }
+
try
{
if(RAPublicKey != null && RAPublicKey != "" && RAName != "DEFAULT")//RAName null allowed - find a better way to represent "DEFAULT"
@@ -1729,29 +1741,44 @@
while((OldKey = svc.GetiFolderCryptoKeys(DomainID, UserID, index)) != null)
{
- //Decrypt and encrypt the key
- Simias.Storage.Key DeKey = new Key(OldKey.PEDEK);
- DeKey.DecrypytKey(oldPassphrase, out DecryptedKey);
- Simias.Storage.Key EnKey = new Key(DecryptedKey);
- EnKey.EncrypytKey(passphrase, out EncryptedKey);
- //Send back to server
- NewKey.NodeID = OldKey.NodeID;
- NewKey.PEDEK = EncryptedKey;
- if(RAPublicKey !=null && RAPublicKey !="")
- {
- RecoveryAgent agent = new RecoveryAgent(RAPublicKey);
- NewKey.REDEK = agent.EncodeMessage(DecryptedKey); // recoveryKey
- }
- else
- NewKey.REDEK = null; // since we are not changing the recovery agent
-
- if(svc.SetiFolderCryptoKeys(DomainID, UserID, NewKey)==false)
- {
- log.Debug("ReSetPassPhrase : failed for ifolder ID:", NewKey.NodeID);
- throw new CollectionStoreException("The specified cryptographic key not found");
- }
- index++;
+ try
+ {
+ log.Debug("In side while loop");
+ //Decrypt and encrypt the key
+ Simias.Storage.Key DeKey = new Key(OldKey.PEDEK);
+ DeKey.DecrypytKey(oldPassphrase, out DecryptedKey);
+ Simias.Storage.Key EnKey = new Key(DecryptedKey);
+ EnKey.EncrypytKey(passphrase, out EncryptedKey);
+ //Send back to server
+ NewKey.NodeID = OldKey.NodeID;
+ NewKey.PEDEK = EncryptedKey;
+ if (RAPublicKey != null && RAPublicKey != "")
+ {
+ RecoveryAgent agent = new RecoveryAgent(RAPublicKey);
+ NewKey.REDEK = agent.EncodeMessage(DecryptedKey); // recoveryKey
+ }
+ else
+ NewKey.REDEK = null; // since we are not changing the recovery agent
+
+ if (svc.SetiFolderCryptoKeys(DomainID, UserID, NewKey) == false)
+ {
+ log.Debug("ReSetPassPhrase : failed for ifolder ID:", NewKey.NodeID);
+ //throw new CollectionStoreException("The specified cryptographic key not found");
+ decryptpassed = false;
+ }
+ }
+ catch (Exception ex)
+ {
+ log.Debug("Exception in reset pass: {0}--{1}", ex.Message, ex.StackTrace);
+ }
+ finally
+ {
+ index++;
+ }
+
+
+
}
//making it local variable for faster disposal
@@ -1774,7 +1801,7 @@
log.Debug("ReSetPassPhrase : {0}", ex.Message);
throw ex;
}
- return true;
+ return decryptpassed;
}
/// <summary>
@@ -2264,6 +2291,7 @@
/// </summary>
public Simias.Authentication.StatusCodes ValidatePassPhrase(string Passphrase)
{
+ log.Debug("Enter ValidatePassPhrase for validating passphrase :{0}", Passphrase);
string OldHash = null;
string NewHash = null;
@@ -2308,8 +2336,10 @@
}
catch(Exception ex)
{
- log.Debug("ValidatePassPhrase : {0}", ex.Message);
- throw ex;
+ log.Debug("ValidatePassPhrase : {0} and return value is :{1}", ex.Message, Simias.Authentication.StatusCodes.PassPhraseInvalid.ToString());
+ return Simias.Authentication.StatusCodes.PassPhraseInvalid;
+ //throw ex;
+
}
//Compare
@@ -2513,9 +2543,19 @@
log.Debug("RECOVERY: Parsing Element :{0}", count);
PassphraseHash hash = new PassphraseHash();
+ log.Debug("length of KeyNodeList is :{0}", keyNodeList.Count.ToString());
+
XmlNode keyNode = keyNodeList[count++];
- string RecoveredCryptoKey = keyNode.InnerText;
-log.Debug("RecoveredCryptoKey {0}",RecoveredCryptoKey);
+ string RecoveredCryptoKey = null;
+ if (keyNode != null)
+ RecoveredCryptoKey = keyNode.InnerText;
+ else
+ {
+ log.Debug("keyNode is null");
+ continue;
+ }
+ log.Debug("RecoveredCryptoKey {0}",RecoveredCryptoKey);
+
string DecrypRecoveredCryptoKey = null;
if(OneTimePassphrase !=null && OneTimePassphrase !="")
{
@@ -2529,11 +2569,22 @@
//Verify the recovered key matches with the original key
Key HashKey = new Key(DecrypRecoveredCryptoKey);
string serverHash = svc.ServerGetCollectionHashKey(idNode.InnerText);
- if(serverHash == null)
- throw new CollectionStoreException("The specified cryptographic key does not found in server");
- if(HashKey.HashKey() != serverHash)
- throw new CollectionStoreException("The recovered cryptographic key does not match");
+ if (serverHash == null)
+ {
+ log.Debug("The specified cryptographic key does not found in server");
+ //throw new CollectionStoreException("The specified cryptographic key does not found in server");
+ }
+
+
+ if (HashKey.HashKey() != serverHash)
+ {
+ //throw new CollectionStoreException("The recovered cryptographic key does not match");
+ log.Debug("The recovered cryptographic key does not match");
+
+ }
+
+
log.Debug("RECOVERY: The recovery key macth with the server key");
//Encrypted the recovered key using the new passphrase
@@ -2549,7 +2600,9 @@
if(svc.SetiFolderCryptoKeys(DomainID, UserID, cKey)==false)
{
log.Debug("ImportiFoldersCryptoKeys failed in SetiFolderCryptoKeys:{0}", cKey.NodeID);
- throw new CollectionStoreException("The specified cryptographic key does not found");
+ log.Debug("The specified cryptographic key does not found");
+ //throw new CollectionStoreException("The specified cryptographic key does not found");
+
}
}
SetPassPhrase(NewPassphrase, null, null);
Modified: trunk/src/core/CollectionStore/Store.cs
===================================================================
--- trunk/src/core/CollectionStore/Store.cs 2010-04-21 13:40:57 UTC (rev 7340)
+++ trunk/src/core/CollectionStore/Store.cs 2010-04-21 13:45:30 UTC (rev 7341)
@@ -47,6 +47,7 @@
using Simias.Policy;
using Simias.Storage.Provider;
using Simias.Sync;
+using Simias.Sync.Delta;
using Persist = Simias.Storage.Provider;
@@ -1790,6 +1791,244 @@
}
#endregion
}
+
+
+ public static int ResetRootNode(string ifolderid)
+ {
+ try{
+ Store store = Store.GetStore();
+ //store.GetCollectionsByType( NodeTypes.Collection);
+ Collection col = store.GetCollectionByID( ifolderid);
+ if( col == null)
+ return 1;
+ ICSList results = col.Search( PropertyTags.Root, Syntax.String );
+ foreach ( ShallowNode shallowNode in results )
+ {
+ DirNode rootDir = new DirNode( col, shallowNode );
+ string currentpath = ((Property)rootDir.Properties.GetSingleProperty( PropertyTags.Root )).Value as string;
+ string storepath = StorePath;
+ //string suffix = Path.GetFileName( currentpath );
+ string suffix = Path.GetDirectoryName( currentpath );
+ suffix = Path.GetDirectoryName( suffix);
+ suffix = Path.GetDirectoryName(suffix );
+ suffix = currentpath.Substring(suffix.Length+1);
+ log.Info("currentpath is:{0}--store path is:{1} and suffix is:{2}", currentpath,storepath,suffix);
+
+ string newpath = Path.Combine(storepath,suffix);
+ Property p = new Property( PropertyTags.Root, newpath);
+ p.LocalProperty = true;
+ rootDir.Properties.ModifyNodeProperty( p );
+ col.Commit(rootDir);
+
+ log.Info("new path is:{0}", newpath);
+ break;
+ }
+ }
+ catch(Exception ex)
+ {
+ log.Info("Exception is:{0}--{1}", ex.Message, ex.StackTrace);
+ }
+ return 0;
+ }
+
+ public int RestoreData(string ifolderid, string nodeid, string relativepath, string basepath, string filetype, long length)
+ {
+ log.Info("Entered RestoreData.");
+ // string ifolderid = "b8123e0c-69ff-4dc0-b303-0d760092b0a5";
+ //string relativepath = "encryptedifolder/copydir.txt";
+ // string relativepath = "encryptedifolder/dir2/file3.txt";
+ // string nodeid = "d081e003-23b9-404a-8bb7-9832bb2cdc7113";
+ // string basepath = "/home/banderso/ifolder/recovery/recoverytool/testrecovery"; /// TODO: Add base path of the iFolder of the backed up data in xml file...
+ string backedpath = Path.Combine( basepath, relativepath);
+
+ log.Info("backedpath: {0}", backedpath);
+ if( filetype.Equals("FileNode"))
+ {
+ return RestoreFile(ifolderid, relativepath, nodeid, basepath, length);
+ }
+ else
+ {
+ return RestoreDirectory( ifolderid, relativepath, nodeid, basepath);
+ }
+ return 0;
+ }
+
+
+
+ public int RestoreDirectory(string ifolderid, string relativepath, string nodeid, string basepath)
+ {
+ string backedpath = Path.Combine( basepath, relativepath);
+ log.Debug("backedpath: {0}", backedpath);
+ /// Check whether the directory present on the target. If not create. else return;
+ Store store = Store.GetStore();
+ if(store == null)
+ return 1000;
+ Collection col = store.GetCollectionByID( ifolderid);
+ if( col == null)
+ return 21;
+
+ try
+ {
+ //verify whether Directory exist in new path, if return, else create.
+ string newbasepath = col.UnmanagedPath;
+ log.Debug("newbasepath: {0}", newbasepath);
+ string newpath = "";
+ newpath = Path.Combine(newbasepath, relativepath);
+ log.Debug("relativepath: {0} and newpath:{1}", relativepath, newpath);
+ if(!Directory.Exists(newpath))
+ {
+ log.Debug("directory doesn't Exist");
+ //create direcotry.
+ Directory.CreateDirectory(newpath);
+ log.Info("directory creation completed");
+ }
+ if(!Directory.Exists(newpath))
+ {
+ log.Debug("Error while creating Directory");
+ return 22;
+ }
+
+ Node dirNode = col.GetNodeByPath(relativepath);
+ if(null == dirNode)
+ {
+ log.Info("directory doesn't exist on new path :{0}",relativepath);
+ //Create directory node
+ DirNode parentnode = new DirNode( col.GetNodeByPath(Path.GetDirectoryName(relativepath)));
+ if(null != parentnode)
+ {
+ log.Debug("Parent directory exist on new path :{0}",relativepath);
+ DirNode dnode = new DirNode(col, parentnode, Path.GetFileName(newpath));
+ if(dnode != null)
+ col.Commit(dnode);
+ }
+ else
+ {
+ log.Debug("Parent directory doesn't exist on new path :{0}",relativepath);
+ return 24;
+ }
+
+ }
+ else
+ {
+ log.Debug("directory exist on new path :{0} ",relativepath);
+ return 0;
+ }
+ }
+ catch(Exception e1)
+ {
+ log.Debug("Exceptioni while creating directory: {0}--{1}", e1.Message, e1.StackTrace);
+ return 23;
+ }
+ return 0;
+ }
+
+ public int RestoreFile(string ifolderid, string relativepath, string nodeid, string basepath, long length)
+ {
+ log.Debug("Entered RestoreFile.");
+ // Read from the xml file
+ // string ifolderid = "b8123e0c-69ff-4dc0-b303-0d760092b0a5";
+ // string relativepath = "encryptedifolder/copydir.txt";
+ // string nodeid = "d081e003-23b9-404a-8bb7-9832bb2cdc7113";
+ // string basepath = "/home/banderso/ifolder/recovery/recoverytool/testrecovery"; /// TODO: Add base path of the iFolder of the backed up data in xml file...
+ string backedpath = Path.Combine( basepath, relativepath);
+ bool encrypted = false;
+ FileInfo fi = new FileInfo( backedpath);
+ long nodelength = fi.Length;
+ log.Info("Starting with datamove from {0}--{1}.", backedpath, nodelength);
+ if( !File.Exists(backedpath) && !Directory.Exists(backedpath))
+ return 2; /// Path does not exist...
+ Store store = Store.GetStore();
+ if( store == null)
+ return 1000;
+ Collection col = store.GetCollectionByID( ifolderid);
+ if( col == null)
+ return 1; // iFolder not present...
+ if( col.EncryptionAlgorithm != null && col.EncryptionAlgorithm != string.Empty)
+ {
+ nodelength = length;
+ }
+ try
+ {
+ string newbasepath = col.UnmanagedPath;
+ log.Debug("newbasepath: {0}", newbasepath);
+ string newpath = "";
+ Node n1 = col.GetNodeByID(nodeid);
+ FileNode node = null;
+ if( n1 != null)
+ node = new FileNode(n1);
+ if( node == null)
+ {
+ /// This is a new file. Direct copy and create node.
+ newpath = Path.Combine(newbasepath, relativepath);
+ log.Info("newpath: {0}", newpath);
+ if( File.Exists(newpath))
+ {
+ /// File with same name but different nodeID already exists.
+ /// may be a delet and upload of a file with same name has happened after backup is taken. skipping for now.
+ return 3;
+ }
+ }
+ else
+ {
+ /// The file is renamed after taking backup. so the file name is different but node id is same.
+ /// Get current file name with the node ID and overwrite this content with the backedup data.
+ newpath = node.GetFullPath(col);
+ log.Debug("newpath in else: {0}", newpath);
+ }
+
+ /// Check for the existence of the directory...
+ if( !Directory.Exists( Path.GetDirectoryName(newpath)))
+ {
+ log.Info("new path directory does not exist. {0}", Path.GetDirectoryName(newpath));
+ return 4;
+ }
+ log.Info("fetching parent dir node. {0}", Path.GetDirectoryName(relativepath));
+ /// Get the dirnode for the parent directory...
+ DirNode parentnode = new DirNode( col.GetNodeByPath(Path.GetDirectoryName(relativepath)));
+ if( parentnode == null)
+ return 6;
+ try
+ {
+ File.Copy( backedpath, newpath, true);
+ }
+ catch(Exception e)
+ {
+ log.Debug("Exception while copy: {0}--{1}", e.Message, e.StackTrace);
+ return 5;
+ }
+
+ /// Create the file node...
+ if( node == null)
+ {
+ log.Debug("Creating file node. parent ID: {0}", parentnode.ID);
+ node = new FileNode(col, parentnode, Path.GetFileName(newpath));
+ }
+ if( node == null)
+ return 7;
+ node.UpdateWebFileInfo(col, nodelength);
+ col.Commit(node);
+ if( col.EncryptionAlgorithm == string.Empty || col.EncryptionAlgorithm == null)
+ {
+ log.Debug("Creating hash map file for restored file: {0}", node.ID);
+ HashMap map = new HashMap(col, node);
+ map.CreateHashMapFile();
+ }
+ log.Debug("End restoredata.");
+ }
+ catch(Exception e1)
+ {
+ log.Info("Exception in restoredata: {0}--{1}", e1.Message, e1.StackTrace);
+ return 8;
+ }
+ return 0;
+
+ }
+
+
+
+
+
+
#endregion
}
Modified: trunk/src/core/SimiasClient/Makefile.am
===================================================================
--- trunk/src/core/SimiasClient/Makefile.am 2010-04-21 13:40:57 UTC (rev 7340)
+++ trunk/src/core/SimiasClient/Makefile.am 2010-04-21 13:45:30 UTC (rev 7341)
@@ -34,14 +34,8 @@
all: SimiasClient.dll
-if !DARWIN
$(srcdir)/SimiasService.cs: $(srcdir)/../WebService/Simias.wsdl
-endif
-if DARWIN
-$(srcdir)/SimiasService.cs: $(srcdir)/../WebService/Simias_darwin.wsdl
-endif
-
if WINDOWS
wsdl /out:SimiasService.cs $(srcdir)/../WebService/Simias.wsdl
endif
@@ -49,7 +43,7 @@
-$(WSDL) -nologo -out:SimiasService.cs $(srcdir)/../WebService/Simias.wsdl
endif
if DARWIN
- wsdl -nologo -out:SimiasService.cs $(srcdir)/../WebService/Simias_darwin.wsdl
+ wsdl -nologo -out:SimiasService.cs $(srcdir)/../WebService/Simias.wsdl
endif
$(srcdir)/SimiasService2.cs: $(srcdir)/../WebService/Simias.wsdl
Modified: trunk/src/core/SimiasClient/SimiasService.cs
===================================================================
--- trunk/src/core/SimiasClient/SimiasService.cs 2010-04-21 13:40:57 UTC (rev 7340)
+++ trunk/src/core/SimiasClient/SimiasService.cs 2010-04-21 13:45:30 UTC (rev 7341)
@@ -23,7 +23,7 @@
public class SimiasWebService : System.Web.Services.Protocols.SoapHttpClientProtocol {
public SimiasWebService() {
- this.Url = "http://127.0.0.1/simias10/Simias.asmx";
+ this.Url = "https://164.99.101.20/simias10/Simias.asmx";
}
/// <remarks>
@@ -1898,6 +1898,134 @@
object[] results = this.EndInvoke(asyncResult);
return ((int)(results[0]));
}
+
+ /// <remarks>
+///Gets the process ID for the current running process.
+///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://novell.com/simias/web/GetEntries", RequestNamespace="http://novell.com/simias/web/", ResponseNamespace="http://novell.com/simias/web/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public NodeEntrySet GetEntries(string ifolderID, int type, string relPath, int index, int max, string accessID) {
+ object[] results = this.Invoke("GetEntries", new object[] {
+ ifolderID,
+ type,
+ relPath,
+ index,
+ max,
+ accessID});
+ return ((NodeEntrySet)(results[0]));
+ }
+
+ public System.IAsyncResult BeginGetEntries(string ifolderID, int type, string relPath, int index, int max, string accessID, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("GetEntries", new object[] {
+ ifolderID,
+ type,
+ relPath,
+ index,
+ max,
+ accessID}, callback, asyncState);
+ }
+
+ public NodeEntrySet EndGetEntries(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((NodeEntrySet)(results[0]));
+ }
+
+ /// <remarks>
+///Get the Restore Status information for given ifolderid.
+///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://novell.com/simias/web/GetRestoreStatusForCollection", RequestNamespace="http://novell.com/simias/web/", ResponseNamespace="http://novell.com/simias/web/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public int GetRestoreStatusForCollection(string ifolderid, out int totalcount, out int finishedcount) {
+ object[] results = this.Invoke("GetRestoreStatusForCollection", new object[] {
+ ifolderid});
+ finishedcount = ((int)(results[2]));
+ totalcount = ((int)(results[1]));
+ return ((int)(results[0]));
+ }
+
+ public System.IAsyncResult BeginGetRestoreStatusForCollection(string ifolderid, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("GetRestoreStatusForCollection", new object[] {
+ ifolderid}, callback, asyncState);
+ }
+
+ public int EndGetRestoreStatusForCollection(System.IAsyncResult asyncResult, out int totalcount, out int finishedcount) {
+ object[] results = this.EndInvoke(asyncResult);
+ finishedcount = ((int)(results[2]));
+ totalcount = ((int)(results[1]));
+ return ((int)(results[0]));
+ }
+
+ /// <remarks>
+///Set the Restore Status information for given ifolderid.
+///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://novell.com/simias/web/SetRestoreStatusForCollection", RequestNamespace="http://novell.com/simias/web/", ResponseNamespace="http://novell.com/simias/web/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public int SetRestoreStatusForCollection(string ifolderid, int status, int totalcount, int finishedcount) {
+ object[] results = this.Invoke("SetRestoreStatusForCollection", new object[] {
+ ifolderid,
+ status,
+ totalcount,
+ finishedcount});
+ return ((int)(results[0]));
+ }
+
+ public System.IAsyncResult BeginSetRestoreStatusForCollection(string ifolderid, int status, int totalcount, int finishedcount, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("SetRestoreStatusForCollection", new object[] {
+ ifolderid,
+ status,
+ totalcount,
+ finishedcount}, callback, asyncState);
+ }
+
+ public int EndSetRestoreStatusForCollection(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((int)(results[0]));
+ }
+
+ /// <remarks>
+///Gets the process ID for the current running process.
+///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://novell.com/simias/web/ResetRootNode", RequestNamespace="http://novell.com/simias/web/", ResponseNamespace="http://novell.com/simias/web/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public int ResetRootNode(string ifolderid) {
+ object[] results = this.Invoke("ResetRootNode", new object[] {
+ ifolderid});
+ return ((int)(results[0]));
+ }
+
+ public System.IAsyncResult BeginResetRootNode(string ifolderid, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("ResetRootNode", new object[] {
+ ifolderid}, callback, asyncState);
+ }
+
+ public int EndResetRootNode(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((int)(results[0]));
+ }
+
+ /// <remarks>
+///Gets the process ID for the current running process.
+///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://novell.com/simias/web/GetEncryptionDetails", RequestNamespace="http://novell.com/simias/web/", ResponseNamespace="http://novell.com/simias/web/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public bool GetEncryptionDetails(string ifolderid, out string eKey, out string eBlob, out string eAlgorithm, out string rKey) {
+ object[] results = this.Invoke("GetEncryptionDetails", new object[] {
+ ifolderid});
+ rKey = ((string)(results[4]));
+ eAlgorithm = ((string)(results[3]));
+ eBlob = ((string)(results[2]));
+ eKey = ((string)(results[1]));
+ return ((bool)(results[0]));
+ }
+
+ public System.IAsyncResult BeginGetEncryptionDetails(string ifolderid, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("GetEncryptionDetails", new object[] {
+ ifolderid}, callback, asyncState);
+ }
+
+ public bool EndGetEncryptionDetails(System.IAsyncResult asyncResult, out string eKey, out string eBlob, out string eAlgorithm, out string rKey) {
+ object[] results = this.EndInvoke(asyncResult);
+ rKey = ((string)(results[4]));
+ eAlgorithm = ((string)(results[3]));
+ eBlob = ((string)(results[2]));
+ eKey = ((string)(results[1]));
+ return ((bool)(results[0]));
+ }
}
/// <remarks/>
@@ -2229,3 +2357,34 @@
/// <remarks/>
public string REDEK;
}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://novell.com/simias/web/")]
+public class NodeEntrySet {
+
+ /// <remarks/>
+ public NodeEntry[] Items;
+
+ /// <remarks/>
+ public long Count;
+}
+
+/// <remarks/>
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://novell.com/simias/web/")]
+public class NodeEntry {
+
+ /// <remarks/>
+ public string ID;
+
+ /// <remarks/>
+ public string Name;
+
+ /// <remarks/>
+ public long Length;
+
+ /// <remarks/>
+ public string Type;
+
+ /// <remarks/>
+ public string RelativePath;
+}
Modified: trunk/src/core/SimiasClient/SimiasService2.cs
===================================================================
--- trunk/src/core/SimiasClient/SimiasService2.cs 2010-04-21 13:40:57 UTC (rev 7340)
+++ trunk/src/core/SimiasClient/SimiasService2.cs 2010-04-21 13:45:30 UTC (rev 7341)
@@ -191,8 +191,18 @@
private System.Threading.SendOrPostCallback GetSimiasProcessIDOperationCompleted;
+ private System.Threading.SendOrPostCallback GetEntriesOperationCompleted;
+
+ private System.Threading.SendOrPostCallback GetRestoreStatusForCollectionOperationCompleted;
+
+ private System.Threading.SendOrPostCallback SetRestoreStatusForCollectionOperationCompleted;
+
+ private System.Threading.SendOrPostCallback ResetRootNodeOperationCompleted;
+
+ private System.Threading.SendOrPostCallback GetEncryptionDetailsOperationCompleted;
+
public SimiasWebService() {
- this.Url = "http://127.0.0.1/simias10/Simias.asmx";
+ this.Url = "https://164.99.101.20/simias10/Simias.asmx";
}
public event PingSimiasCompletedEventHandler PingSimiasCompleted;
@@ -363,6 +373,16 @@
public event GetSimiasProcessIDCompletedEventHandler GetSimiasProcessIDCompleted;
+ public event GetEntriesCompletedEventHandler GetEntriesCompleted;
+
+ public event GetRestoreStatusForCollectionCompletedEventHandler GetRestoreStatusForCollectionCompleted;
+
+ public event SetRestoreStatusForCollectionCompletedEventHandler SetRestoreStatusForCollectionCompleted;
+
+ public event ResetRootNodeCompletedEventHandler ResetRootNodeCompleted;
+
+ public event GetEncryptionDetailsCompletedEventHandler GetEncryptionDetailsCompleted;
+
/// <remarks>
///Allows a client to ping to make sure the Web Service is up and running
///</remarks>
@@ -3931,6 +3951,237 @@
this.GetSimiasProcessIDCompleted(this, new GetSimiasProcessIDCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
+
+ /// <remarks>
+///Gets the process ID for the current running process.
+///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://novell.com/simias/web/GetEntries", RequestNamespace="http://novell.com/simias/web/", ResponseNamespace="http://novell.com/simias/web/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public NodeEntrySet GetEntries(string ifolderID, int type, string relPath, int index, int max, string accessID) {
+ object[] results = this.Invoke("GetEntries", new object[] {
+ ifolderID,
+ type,
+ relPath,
+ index,
+ max,
+ accessID});
+ return ((NodeEntrySet)(results[0]));
+ }
+
+ public System.IAsyncResult BeginGetEntries(string ifolderID, int type, string relPath, int index, int max, string accessID, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("GetEntries", new object[] {
+ ifolderID,
+ type,
+ relPath,
+ index,
+ max,
+ accessID}, callback, asyncState);
+ }
+
+ public NodeEntrySet EndGetEntries(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((NodeEntrySet)(results[0]));
+ }
+
+ public void GetEntriesAsync(string ifolderID, int type, string relPath, int index, int max, string accessID) {
+ this.GetEntriesAsync(ifolderID, type, relPath, index, max, accessID, null);
+ }
+
+ public void GetEntriesAsync(string ifolderID, int type, string relPath, int index, int max, string accessID, object userState) {
+ if ((this.GetEntriesOperationCompleted == null)) {
+ this.GetEntriesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEntriesCompleted);
+ }
+ this.InvokeAsync("GetEntries", new object[] {
+ ifolderID,
+ type,
+ relPath,
+ index,
+ max,
+ accessID}, this.GetEntriesOperationCompleted, userState);
+ }
+
+ private void OnGetEntriesCompleted(object arg) {
+ if ((this.GetEntriesCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.GetEntriesCompleted(this, new GetEntriesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ /// <remarks>
+///Get the Restore Status information for given ifolderid.
+///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://novell.com/simias/web/GetRestoreStatusForCollection", RequestNamespace="http://novell.com/simias/web/", ResponseNamespace="http://novell.com/simias/web/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public int GetRestoreStatusForCollection(string ifolderid, out int totalcount, out int finishedcount) {
+ object[] results = this.Invoke("GetRestoreStatusForCollection", new object[] {
+ ifolderid});
+ finishedcount = ((int)(results[2]));
+ totalcount = ((int)(results[1]));
+ return ((int)(results[0]));
+ }
+
+ public System.IAsyncResult BeginGetRestoreStatusForCollection(string ifolderid, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("GetRestoreStatusForCollection", new object[] {
+ ifolderid}, callback, asyncState);
+ }
+
+ public int EndGetRestoreStatusForCollection(System.IAsyncResult asyncResult, out int totalcount, out int finishedcount) {
+ object[] results = this.EndInvoke(asyncResult);
+ finishedcount = ((int)(results[2]));
+ totalcount = ((int)(results[1]));
+ return ((int)(results[0]));
+ }
+
+ public void GetRestoreStatusForCollectionAsync(string ifolderid) {
+ this.GetRestoreStatusForCollectionAsync(ifolderid, null);
+ }
+
+ public void GetRestoreStatusForCollectionAsync(string ifolderid, object userState) {
+ if ((this.GetRestoreStatusForCollectionOperationCompleted == null)) {
+ this.GetRestoreStatusForCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRestoreStatusForCollectionCompleted);
+ }
+ this.InvokeAsync("GetRestoreStatusForCollection", new object[] {
+ ifolderid}, this.GetRestoreStatusForCollectionOperationCompleted, userState);
+ }
+
+ private void OnGetRestoreStatusForCollectionCompleted(object arg) {
+ if ((this.GetRestoreStatusForCollectionCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.GetRestoreStatusForCollectionCompleted(this, new GetRestoreStatusForCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ /// <remarks>
+///Set the Restore Status information for given ifolderid.
+///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://novell.com/simias/web/SetRestoreStatusForCollection", RequestNamespace="http://novell.com/simias/web/", ResponseNamespace="http://novell.com/simias/web/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public int SetRestoreStatusForCollection(string ifolderid, int status, int totalcount, int finishedcount) {
+ object[] results = this.Invoke("SetRestoreStatusForCollection", new object[] {
+ ifolderid,
+ status,
+ totalcount,
+ finishedcount});
+ return ((int)(results[0]));
+ }
+
+ public System.IAsyncResult BeginSetRestoreStatusForCollection(string ifolderid, int status, int totalcount, int finishedcount, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("SetRestoreStatusForCollection", new object[] {
+ ifolderid,
+ status,
+ totalcount,
+ finishedcount}, callback, asyncState);
+ }
+
+ public int EndSetRestoreStatusForCollection(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((int)(results[0]));
+ }
+
+ public void SetRestoreStatusForCollectionAsync(string ifolderid, int status, int totalcount, int finishedcount) {
+ this.SetRestoreStatusForCollectionAsync(ifolderid, status, totalcount, finishedcount, null);
+ }
+
+ public void SetRestoreStatusForCollectionAsync(string ifolderid, int status, int totalcount, int finishedcount, object userState) {
+ if ((this.SetRestoreStatusForCollectionOperationCompleted == null)) {
+ this.SetRestoreStatusForCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetRestoreStatusForCollectionCompleted);
+ }
+ this.InvokeAsync("SetRestoreStatusForCollection", new object[] {
+ ifolderid,
+ status,
+ totalcount,
+ finishedcount}, this.SetRestoreStatusForCollectionOperationCompleted, userState);
+ }
+
+ private void OnSetRestoreStatusForCollectionCompleted(object arg) {
+ if ((this.SetRestoreStatusForCollectionCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.SetRestoreStatusForCollectionCompleted(this, new SetRestoreStatusForCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ /// <remarks>
+///Gets the process ID for the current running process.
+///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://novell.com/simias/web/ResetRootNode", RequestNamespace="http://novell.com/simias/web/", ResponseNamespace="http://novell.com/simias/web/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public int ResetRootNode(string ifolderid) {
+ object[] results = this.Invoke("ResetRootNode", new object[] {
+ ifolderid});
+ return ((int)(results[0]));
+ }
+
+ public System.IAsyncResult BeginResetRootNode(string ifolderid, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("ResetRootNode", new object[] {
+ ifolderid}, callback, asyncState);
+ }
+
+ public int EndResetRootNode(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((int)(results[0]));
+ }
+
+ public void ResetRootNodeAsync(string ifolderid) {
+ this.ResetRootNodeAsync(ifolderid, null);
+ }
+
+ public void ResetRootNodeAsync(string ifolderid, object userState) {
+ if ((this.ResetRootNodeOperationCompleted == null)) {
+ this.ResetRootNodeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnResetRootNodeCompleted);
+ }
+ this.InvokeAsync("ResetRootNode", new object[] {
+ ifolderid}, this.ResetRootNodeOperationCompleted, userState);
+ }
+
+ private void OnResetRootNodeCompleted(object arg) {
+ if ((this.ResetRootNodeCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.ResetRootNodeCompleted(this, new ResetRootNodeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ /// <remarks>
+///Gets the process ID for the current running process.
+///</remarks>
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://novell.com/simias/web/GetEncryptionDetails", RequestNamespace="http://novell.com/simias/web/", ResponseNamespace="http://novell.com/simias/web/", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, Use=System.Web.Services.Description.SoapBindingUse.Literal)]
+ public bool GetEncryptionDetails(string ifolderid, out string eKey, out string eBlob, out string eAlgorithm, out string rKey) {
+ object[] results = this.Invoke("GetEncryptionDetails", new object[] {
+ ifolderid});
+ rKey = ((string)(results[4]));
+ eAlgorithm = ((string)(results[3]));
+ eBlob = ((string)(results[2]));
+ eKey = ((string)(results[1]));
+ return ((bool)(results[0]));
+ }
+
+ public System.IAsyncResult BeginGetEncryptionDetails(string ifolderid, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("GetEncryptionDetails", new object[] {
+ ifolderid}, callback, asyncState);
+ }
+
+ public bool EndGetEncryptionDetails(System.IAsyncResult asyncResult, out string eKey, out string eBlob, out string eAlgorithm, out string rKey) {
+ object[] results = this.EndInvoke(asyncResult);
+ rKey = ((string)(results[4]));
+ eAlgorithm = ((string)(results[3]));
+ eBlob = ((string)(results[2]));
+ eKey = ((string)(results[1]));
+ return ((bool)(results[0]));
+ }
+
+ public void GetEncryptionDetailsAsync(string ifolderid) {
+ this.GetEncryptionDetailsAsync(ifolderid, null);
+ }
+
+ public void GetEncryptionDetailsAsync(string ifolderid, object userState) {
+ if ((this.GetEncryptionDetailsOperationCompleted == null)) {
+ this.GetEncryptionDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEncryptionDetailsCompleted);
+ }
+ this.InvokeAsync("GetEncryptionDetails", new object[] {
+ ifolderid}, this.GetEncryptionDetailsOperationCompleted, userState);
+ }
+
+ private void OnGetEncryptionDetailsCompleted(object arg) {
+ if ((this.GetEncryptionDetailsCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.GetEncryptionDetailsCompleted(this, new GetEncryptionDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
}
/// <remarks/>
@@ -4622,6 +4873,108 @@
}
}
+/// <remarks/>
+[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1433")]
+[System.SerializableAttribute()]
+[System.Diagnostics.DebuggerStepThroughAttribute()]
+[System.ComponentModel.DesignerCategoryAttribute("code")]
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://novell.com/simias/web/")]
+public partial class NodeEntrySet {
+
+ private NodeEntry[] itemsField;
+
+ private long countField5;
+
+ /// <remarks/>
+ public NodeEntry[] Items {
+ get {
+ return this.itemsField;
+ }
+ set {
+ this.itemsField = value;
+ }
+ }
+
+ /// <remarks/>
+ public long Count {
+ get {
+ return this.countField5;
+ }
+ set {
+ this.countField5 = value;
+ }
+ }
+}
+
+/// <remarks/>
+[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1433")]
+[System.SerializableAttribute()]
+[System.Diagnostics.DebuggerStepThroughAttribute()]
+[System.ComponentModel.DesignerCategoryAttribute("code")]
+[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://novell.com/simias/web/")]
+public partial class NodeEntry {
+
+ private string iDField1;
+
+ private string nameField3;
+
+ private long lengthField;
+
+ private string typeField3;
+
+ private string relativePathField;
+
+ /// <remarks/>
+ public string ID {
+ get {
+ return this.iDField1;
+ }
+ set {
+ this.iDField1 = value;
+ }
+ }
+
+ /// <remarks/>
+ public string Name {
+ get {
+ return this.nameField3;
+ }
+ set {
+ this.nameField3 = value;
+ }
+ }
+
+ /// <remarks/>
+ public long Length {
+ get {
+ return this.lengthField;
+ }
+ set {
+ this.lengthField = value;
+ }
+ }
+
+ /// <remarks/>
+ public string Type {
+ get {
+ return this.typeField3;
+ }
+ set {
+ this.typeField3 = value;
+ }
+ }
+
+ /// <remarks/>
+ public string RelativePath {
+ get {
+ return this.relativePathField;
+ }
+ set {
+ this.relativePathField = value;
+ }
+ }
+}
+
public delegate void PingSimiasCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs args);
public delegate void AddMemberToDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs args);
@@ -5989,3 +6342,140 @@
}
public delegate void GetSimiasProcessIDCompletedEventHandler(object sender, GetSimiasProcessIDCompletedEventArgs args);
+
+public partial class GetEntriesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal GetEntriesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ public NodeEntrySet Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((NodeEntrySet)(this.results[0]));
+ }
+ }
+}
+
+public delegate void GetEntriesCompletedEventHandler(object sender, GetEntriesCompletedEventArgs args);
+
+public partial class GetRestoreStatusForCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal GetRestoreStatusForCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ public int Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((int)(this.results[0]));
+ }
+ }
+
+ public int totalcount {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((int)(this.results[1]));
+ }
+ }
+
+ public int finishedcount {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((int)(this.results[2]));
+ }
+ }
+}
+
+public delegate void GetRestoreStatusForCollectionCompletedEventHandler(object sender, GetRestoreStatusForCollectionCompletedEventArgs args);
+
+public partial class SetRestoreStatusForCollectionCompletedEventArgs : System.Compon...
[truncated message content] |
|
From: <he...@us...> - 2010-04-21 13:41:04
|
Revision: 7340
http://simias.svn.sourceforge.net/simias/?rev=7340&view=rev
Author: hegdegg
Date: 2010-04-21 13:40:57 +0000 (Wed, 21 Apr 2010)
Log Message:
-----------
mac mono version upgrade to 2.4.2.3
Modified Paths:
--------------
trunk/configure.in
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2010-04-21 12:45:18 UTC (rev 7339)
+++ trunk/configure.in 2010-04-21 13:40:57 UTC (rev 7340)
@@ -50,8 +50,8 @@
;;
darwin*)
SIMIAS_OS='darwin'
- AC_CHECK_PROG(CSC, mcs, mcs)
- test -z "$CSC" && AC_MSG_ERROR([no C Sharp compiler: mcs not found in \$PATH])
+ AC_CHECK_PROG(CSC, gmcs, gmcs)
+ test -z "$CSC" && AC_MSG_ERROR([no C Sharp compiler: gmcs not found in \$PATH])
export PKG_CONFIG_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib/pkgconfig:$PKG_CONFIG_PATH"
PKG_CONFIG_DIR='lib'
;;
@@ -72,7 +72,11 @@
AM_CONDITIONAL(DARWIN, test "$SIMIAS_OS" = "darwin")
AM_CONDITIONAL(DARWIN_X86, test "$host_cpu" = "i686")
if test "$runasclient" = "TRUE"; then
- AM_CONDITIONAL(MONO, test "$CSC" = "mcs")
+ if test "$host_os" = "darwin"; then
+ AM_CONDITIONAL(MONO, test "$CSC" = "gmcs")
+ else
+ AM_CONDITIONAL(MONO, test "$CSC" = "mcs")
+ fi
else
if pkg-config --atleast-version=2.4 mono > /dev/null 2>&1
then
@@ -157,17 +161,13 @@
CSC_EXEFLAG=/target:exe
CSC_LIBFLAG=/target:library
CSC_WINEXEFLAG=/target:winexe
- CSCFLAGS='/d:MONO /warn:4 /d:TRACE'
+ CSCFLAGS='/d:MONO /warn:4 /d:TRACE /d:MONONATIVE'
CSCFLAGS_DEBUG="/debug+ /d:DEBUG"
CSCFLAGS_OPTIMIZE="/optimize+"
MONO=mono
MONO_DEBUG='mono --debug'
MONO_PATH=
SYSTEM_XML='System.Xml.dll'
- if pkg-config --atleast-version=1.1.13 mono > /dev/null 2>&1
- then
- CSCFLAGS="$CSCFLAGS /d:MONONATIVE"
- fi
;;
mcs)
CSC_EXEFLAG=/target:exe
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-04-21 12:45:24
|
Revision: 7339
http://simias.svn.sourceforge.net/simias/?rev=7339&view=rev
Author: hegdegg
Date: 2010-04-21 12:45:18 +0000 (Wed, 21 Apr 2010)
Log Message:
-----------
Using the correct method for GetLocalHost()
Modified Paths:
--------------
trunk/src/webservices/iFolderServer.cs
Modified: trunk/src/webservices/iFolderServer.cs
===================================================================
--- trunk/src/webservices/iFolderServer.cs 2010-04-21 12:13:10 UTC (rev 7338)
+++ trunk/src/webservices/iFolderServer.cs 2010-04-21 12:45:18 UTC (rev 7339)
@@ -832,7 +832,7 @@
log.Error("Set Master store : {0}", HostID);
Domain domain = store.GetDomain(store.DefaultDomain);
//HostNode lHostNode = HostNode.GetHostByID(domain.ID, HostID);
- HostNode lHostNode = HostNode.GetHostLocalHost();
+ HostNode lHostNode = HostNode.GetLocalHost();
lHostNode.IsMasterHost = Value;
domain.Commit(lHostNode);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-04-21 12:13:23
|
Revision: 7338
http://simias.svn.sourceforge.net/simias/?rev=7338&view=rev
Author: hegdegg
Date: 2010-04-21 12:13:10 +0000 (Wed, 21 Apr 2010)
Log Message:
-----------
Fixing the incorrect merge.
Modified Paths:
--------------
trunk/src/webservices/iFolderServer.cs
Modified: trunk/src/webservices/iFolderServer.cs
===================================================================
--- trunk/src/webservices/iFolderServer.cs 2010-04-21 11:56:09 UTC (rev 7337)
+++ trunk/src/webservices/iFolderServer.cs 2010-04-21 12:13:10 UTC (rev 7338)
@@ -1169,7 +1169,6 @@
string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
domainService.Credentials = new NetworkCredential(iFolderUserBase64, iFolderPassBase64);
- domainService.Credentials = new NetworkCredential(username, password);
domainService.PreAuthenticate = true;
publicUrl = domainService.GetHomeServer( username ).PublicAddress;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-04-21 11:56:15
|
Revision: 7337
http://simias.svn.sourceforge.net/simias/?rev=7337&view=rev
Author: hegdegg
Date: 2010-04-21 11:56:09 +0000 (Wed, 21 Apr 2010)
Log Message:
-----------
Adding back the missed function ConfirmDeleteion()
Modified Paths:
--------------
trunk/src/admin/ServerDetails.aspx
Modified: trunk/src/admin/ServerDetails.aspx
===================================================================
--- trunk/src/admin/ServerDetails.aspx 2010-04-21 11:46:37 UTC (rev 7336)
+++ trunk/src/admin/ServerDetails.aspx 2010-04-21 11:56:09 UTC (rev 7337)
@@ -38,6 +38,11 @@
document.getElementById( "CancelLdapDetailsButton" ).disabled = false;
}
+ function ConfirmDeletion()
+ {
+ return alert("<%= GetString("CONFIRMDELETION") %>");
+ }
+
function ConfirmChangeMaster()
{
return alert("<%= GetString("CONFIRMCHANGEMASTER") %>");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-04-21 11:46:44
|
Revision: 7336
http://simias.svn.sourceforge.net/simias/?rev=7336&view=rev
Author: hegdegg
Date: 2010-04-21 11:46:37 +0000 (Wed, 21 Apr 2010)
Log Message:
-----------
UI changes for changing slave server to master.
Modified Paths:
--------------
trunk/src/admin/ServerDetails.aspx
trunk/src/admin/ServerDetails.aspx.cs
trunk/src/admin/css/iFolderAdmin.css
trunk/src/admin/iFolderAdmin.resx
trunk/src/admin/iFolderWebLogger.cs
Modified: trunk/src/admin/ServerDetails.aspx
===================================================================
--- trunk/src/admin/ServerDetails.aspx 2010-04-21 11:45:26 UTC (rev 7335)
+++ trunk/src/admin/ServerDetails.aspx 2010-04-21 11:46:37 UTC (rev 7336)
@@ -38,14 +38,13 @@
document.getElementById( "CancelLdapDetailsButton" ).disabled = false;
}
- function ConfirmDeletion()
- {
- return alert("<%= GetString("CONFIRMDELETION") %>");
- }
+ function ConfirmChangeMaster()
+ {
+ return alert("<%= GetString("CONFIRMCHANGEMASTER") %>");
+ }
</script>
-
</head>
<body id="server" runat="server">
@@ -85,6 +84,13 @@
<td>
<asp:Literal ID="Type" Runat="server" />
+
+ <asp:LinkButton
+ ID="ChangeMasterButton"
+ Runat="server"
+ CssClass="changemasterbuttons"
+ Enabled="True"
+ />
</td>
</tr>
Modified: trunk/src/admin/ServerDetails.aspx.cs
===================================================================
--- trunk/src/admin/ServerDetails.aspx.cs 2010-04-21 11:45:26 UTC (rev 7335)
+++ trunk/src/admin/ServerDetails.aspx.cs 2010-04-21 11:46:37 UTC (rev 7336)
@@ -39,6 +39,7 @@
using System.Net;
using System.Resources;
using System.Text;
+using System.Threading;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
@@ -53,6 +54,8 @@
public class ServerDetails : System.Web.UI.Page
{
#region Class Members
+ private static readonly iFolderWebLogger log = new iFolderWebLogger(
+ System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
/// <summary>
/// iFolder Connection
@@ -251,6 +254,11 @@
protected LinkButton SyncNowButton;
/// <summary>
+ /// External Identity ChangeMasterButton
+ /// </summary>
+ protected LinkButton ChangeMasterButton;
+
+ /// <summary>
/// Server Details cancel button control.
/// </summary>
protected Button CancelServerDetailsButton;
@@ -601,12 +609,14 @@
MasterIP.Visible = MasterIP.Enabled = true;
MasterIP.Text = ldapInfo.MasterURL;
MasterUri.Text = GetString( "MASTERURI" );
+ ChangeMasterButton.Enabled = true;
}
else
{
MasterIP.Enabled = false;
MasterIP.Text = "";
MasterUri.Text = "";
+ ChangeMasterButton.Enabled = false;
}
//LoggedOnUsersCount.Text = "(Not Implemented)";
@@ -750,6 +760,7 @@
LdapEditButton.Text = GetString( "EDIT" );
LdapEditButton.Enabled = true;
SyncNowButton.Text = GetString ("SYNCNOW");
+ ChangeMasterButton.Text = GetString ("CHANGEMASTER");
DisableButton.Text = GetString( "DISABLE" );
DeleteButton.Text = GetString( "DELETE" );
@@ -889,7 +900,6 @@
}
DeleteButton.Attributes["onclick"] = "return ConfirmDeletion();";
-
//TODO : future!
//GetTailData();
}
@@ -1041,43 +1051,42 @@
/// <param name="e"></param>
protected void OnSaveServerDetailsButton_Click( object source, EventArgs e )
{
-
try
- {
- string MastersIP = "";
- iFolderServer server = web.GetServer ( ServerID);
+ {
+ string MastersIP = "";
+ iFolderServer server = web.GetServer ( ServerID);
remoteweb.PreAuthenticate = true;
remoteweb.Credentials = web.Credentials;
- remoteweb.Url = server.PublicUrl + "/iFolderAdmin.asmx";
-
+ remoteweb.Url = server.PublicUrl + "/iFolderAdmin.asmx";
+
redirectUrl = server.PublicUrl;
- remoteweb.GetAuthenticatedUser();
+ remoteweb.GetAuthenticatedUser();
server = remoteweb.GetServer ( ServerID);
- if(! server.IsMaster)
- {
+ if(! server.IsMaster)
+ {
MastersIP = MasterIP.Text.Trim();
- }
- bool ReturnStatus = remoteweb.SetIPDetails(PrivateIP.Text.Trim() , PublicIP.Text.Trim(), MastersIP);
- if (ReturnStatus == true)
- {
- TopNav.ShowInfo(GetString("RESTARTSERVER"));
- return;
- }
- else
- {
- TopNav.ShowInfo(GetString("UNABLETOEDITIPDETAILS"));
- return;
- }
- }
- catch
- {
- TopNav.ShowError(GetString("UNABLETOEDITIPDETAILS"));
- return;
- }
-
+ }
+ log.Info("remote web = {0}", remoteweb.Url);
+ bool ReturnStatus = remoteweb.SetIPDetails(PrivateIP.Text.Trim() , PublicIP.Text.Trim(), MastersIP);
+ if (ReturnStatus == true)
+ {
+ TopNav.ShowInfo(GetString("RESTARTSERVER"));
+ return;
+ }
+ else
+ {
+ TopNav.ShowInfo(GetString("UNABLETOEDITIPDETAILS"));
+ return;
+ }
+ }
+ catch
+ {
+ TopNav.ShowError(GetString("UNABLETOEDITIPDETAILS"));
+ return;
+ }
}
/// <summary>
@@ -1088,9 +1097,6 @@
protected void OnCancelServerDetailsButton_Click( object source, EventArgs e )
{
GetServerDetails();
-
- //BuildBreadCrumbList( serverName );
-
}
/// <summary>
@@ -1168,19 +1174,257 @@
}
+ protected void ChangeMaster_PreRender(object source, EventArgs e)
+ {
+ // TODO : get this stuff from a resource
+ // GetString("CONFIRMCHANGEMASTER")
+ ChangeMasterButton.Attributes["onclick"] = "javascript:return confirm('The selected server will be designated as a Master Server. Do you want to continue? Click OK to continue or Cancel to quit.');";
+ }
+
/// <summary>
+ /// Event that gets called when the ChangeMasterButton is clicked
+ /// Here all the calls are made to respective master and slave servers
+ /// to update the required details to turn it into new Master or new
+ /// Slave. After this all other servers are updated with new master
+ /// server information.
+ /// TODO: ldapcontext info update could be clubbed here, but at this
+ /// moment its opted out. Admin has to update the context once this
+ /// operation is successful
+ /// </summary>
+ /// <param name="source"></param>
+ /// <param name="e"></param>
+ protected void OnChangeMasterButton_Click( object source, EventArgs e )
+ {
+ log.Info("Change Master Server process Initiated");
+ bool currentMasterUpdateComplete = false, newMasterUpdateComplete = false;
+
+ string HostID = null, newServerPublicUrl = null;
+ iFolderServer mServer = null, newmServer=null;
+ try
+ {
+ try
+ {
+ //check server ID here
+ newmServer = web.GetServer(ServerID);
+ mServer = web.GetMasterServer();
+ }
+ catch(Exception ex)
+ {
+ // for some unknow reason first call fails randomly...so tring
+ // it again.
+ log.Info("Caught exception while trying to get Master server and slected server, retrying");
+ newmServer = web.GetServer(ServerID);
+ mServer = web.GetMasterServer();
+ }
+
+ if ( newmServer != null && mServer != null &&
+ ServerID != null && (newServerPublicUrl = newmServer.PublicUrl) != null)
+ {
+ log.Info("New Master Server ID = {0}", ServerID);
+ log.Info("Current Master Server Url : {0}", mServer.PublicUrl);
+ log.Info("New Master Server Url : {0}", newmServer.PublicUrl);
+
+ // First Set current Master server to Slave
+ iFolderAdmin currentMasterServer = new iFolderAdmin();
+ currentMasterServer.PreAuthenticate = true;
+ currentMasterServer.Credentials = web.Credentials;
+ currentMasterServer.Url = mServer.PublicUrl + "/iFolderAdmin.asmx";
+ log.Info("Current Master Server admin service Url = {0}", currentMasterServer.Url);
+
+ log.Info("Setting as Slave server...");
+ try
+ {
+ if( !currentMasterServer.SetAsSlaveServer(ServerID, newServerPublicUrl))
+ {
+ log.Info("Unable to set the server as slave, retry");
+ TopNav.ShowError(GetString("UNABLETOSETASSLAVE"));
+ return;
+ }
+ }
+ catch(WebException ex)
+ {
+ log.Info("Exception while SetAsSlaveServer");
+ HttpWebResponse htpw = (HttpWebResponse)(ex.Response);
+ if(ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ TopNav.ShowError(String.Format("WebException {0}", htpw.StatusDescription));
+ }
+ if(ex.Status == WebExceptionStatus.SendFailure)
+ {
+ UriBuilder turl = new UriBuilder(mServer.PublicUrl);
+ if(turl.Scheme == Uri.UriSchemeHttps) //check it should be http
+ {
+ turl.Scheme = Uri.UriSchemeHttp;
+ // non standard port does not work
+ turl.Port = 80;
+ }
+ else
+ {
+ turl.Scheme = Uri.UriSchemeHttps;
+ turl.Port = 443;
+ }
+ currentMasterServer.Url = turl.ToString();
+ redirectUrl = currentMasterServer.Url;
+ currentMasterServer.Url = currentMasterServer.Url + "/iFolderAdmin.asmx";
+
+ try
+ {
+ if( !currentMasterServer.SetAsSlaveServer(ServerID, newServerPublicUrl))
+ {
+ log.Info("Unable to set the server as slave, retry");
+ TopNav.ShowError(GetString("UNABLETOSETASSLAVE"));
+ return;
+ }
+ }
+ catch{
+ log.Info("Exception while SetAsSlave");
+ return;
+ }
+ }
+ }
+
+ currentMasterUpdateComplete = true;
+ log.Info("Set as Slave Server Complete.");
+
+ log.Info("Setting selected server as Master Server...");
+ // Then, Set the New Master Server
+ iFolderAdmin newMasterServer = new iFolderAdmin ();
+ newMasterServer.PreAuthenticate = true;
+ newMasterServer.Credentials = web.Credentials;
+ newMasterServer.Url = newServerPublicUrl + "/iFolderAdmin.asmx";
+ log.Info("New Master Server admin service Url = {0}", newMasterServer.Url);
+ try
+ {
+ if(!newMasterServer.SetAsMasterServer(ServerID))
+ {
+ log.Info("Unable to set the server as Master, retry");
+ }
+ }
+ catch (WebException ex)
+ {
+ log.Info("Exception while SetAsMasterServer");
+ HttpWebResponse htpw = (HttpWebResponse)(ex.Response);
+ if(ex.Status == WebExceptionStatus.ProtocolError)
+ {
+ TopNav.ShowInfo (String.Format("WebException {0}", htpw.StatusDescription));
+ }
+ if(ex.Status == WebExceptionStatus.SendFailure)
+ {
+ UriBuilder turl = new UriBuilder(newmServer.PublicUrl);
+ // non standard port does not work ....
+ if(turl.Scheme == Uri.UriSchemeHttps)
+ {
+ turl.Scheme = Uri.UriSchemeHttp;
+ turl.Port = 80;
+ }
+ else
+ {
+ turl.Scheme = Uri.UriSchemeHttps;
+ turl.Port = 443;
+ }
+ newMasterServer.Url = turl.ToString();
+ redirectUrl = newMasterServer.Url;
+ newMasterServer.Url = newMasterServer.Url + "/iFolderAdmin.asmx";
+ try
+ {
+ newMasterServer.SetAsMasterServer(ServerID);
+ }
+ catch
+ {
+ TopNav.ShowError(String.Format (GetString("CONNECTFAILED"), newMasterServer.Url));
+ }
+ }
+ }
+
+ newMasterUpdateComplete = true;
+
+ // Master and Slave updated, now set the Master node attribute for new Master host on both
+ // current master and new master
+ if ( currentMasterServer.SetMasterNodeAttribute(newmServer.ID, true ))
+ {
+ int count = 0;
+ while (newMasterServer.GetMasterNodeAttribute(newmServer.ID) != true )
+ {
+ TopNav.ShowInfo(GetString("MASTERNODEUPDATEWAIT"));
+ log.Info("Waiting for master node attrituge to sync acress old and new master server");
+ Thread.Sleep(1000);
+ count ++;
+ if (count > 15)
+ {
+ log.Info("Unable to get Master node attribute from the new master server, you may have to retry the operation");
+ //break; ///come out from here .....
+ TopNav.ShowError(String.Format("CHANGEMASTERRETRY"));
+ return;
+ }
+ }
+ log.Info("Set as Master Server Complete");
+ }
+
+ //Master and Slave updated and set, now we will let all other slaves
+ //know about the changes.
+ iFolderServer[] iFolderServers = web.GetServers();
+ foreach(iFolderServer ifs in iFolderServers)
+ {
+ if ( ifs.HostName != newmServer.HostName)
+ {
+ log.Info("Updating new master url on : {0}", ifs.PublicUrl);
+ iFolderAdmin otherSlaveServers = new iFolderAdmin();
+ otherSlaveServers.PreAuthenticate = true;
+ otherSlaveServers.Credentials = web.Credentials;
+ otherSlaveServers.Url = ifs.PublicUrl + "/iFolderAdmin.asmx";
+ log.Info("Connecting to : {0}", otherSlaveServers.Url);
+ try
+ {
+ otherSlaveServers.SetMasterServerUrl(ServerID, newServerPublicUrl);
+ }catch(Exception ex)
+ {
+ log.Info("Update master serverurl on {0} failed ", ifs.PublicUrl);
+ TopNav.ShowError(String.Format(GetString("UPDATEMASTERURLONSLAVESFAILED"), ifs.PublicUrl));
+ }
+ // collect all failed url and print once.
+ }
+ }
+ //refresh server deatils
+ //GetServerDetails();
+ //disable the button so the user does not click it again.
+ ChangeMasterButton.Enabled = false;
+ TopNav.ShowInfo (String.Format (GetString ("CHANGEMASTERSUCCESSFUL"), newServerPublicUrl));
+ }
+ else
+ {
+ log.Info(String.Format ("Unable to get new Master ServerID and newServerPublicUrl, retry"));
+ TopNav.ShowError(GetString("CHANGEMASTERINFOFAILED"));
+ ChangeMasterButton.Enabled = false;
+ }
+ }
+ finally
+ {
+ try
+ {
+ //this is just to get all the changes done on both the
+ //servers. does nothing other than logging. Will be useful
+ //for debuggind in case of any error
+ web.VerifyChangeMaster(mServer.ID, newmServer.ID);
+ }
+ catch{}
+ log.Info("Change Master Server process Complete");
+ }
+ return;
+ }
+
+ /// <summary>
/// Event that gets called when the SyncNow button is clicked.
/// </summary>
/// <param name="source"></param>
/// <param name="e"></param>
protected void OnSyncNowButton_Click( object source, EventArgs e )
{
- iFolderServer server = web.GetServer ( ServerID);
- remoteweb.PreAuthenticate = true;
- remoteweb.Credentials = web.Credentials;
- remoteweb.Url = server.PublicUrl + "/iFolderAdmin.asmx";
- remoteweb.GetAuthenticatedUser();
- remoteweb.IdentitySyncNow ();
+ iFolderServer server = web.GetServer ( ServerID);
+ remoteweb.PreAuthenticate = true;
+ remoteweb.Credentials = web.Credentials;
+ remoteweb.Url = server.PublicUrl + "/iFolderAdmin.asmx";
+ remoteweb.GetAuthenticatedUser();
+ remoteweb.IdentitySyncNow ();
}
/// <summary>
@@ -1413,16 +1657,17 @@
// Set the render event to happen only on page load.
Page.PreRender += new EventHandler( Page_PreRender );
}
-
DataPathsFooter.PageFirstClick += new ImageClickEventHandler( PageFirstButton_Click );
- DataPathsFooter.PagePreviousClick += new ImageClickEventHandler( PagePreviousButton_Click );
- DataPathsFooter.PageNextClick += new ImageClickEventHandler( PageNextButton_Click );
- DataPathsFooter.PageLastClick += new ImageClickEventHandler( PageLastButton_Click );
+ DataPathsFooter.PagePreviousClick += new ImageClickEventHandler( PagePreviousButton_Click );
+ DataPathsFooter.PageNextClick += new ImageClickEventHandler( PageNextButton_Click );
+ DataPathsFooter.PageLastClick += new ImageClickEventHandler( PageLastButton_Click );
this.Load += new System.EventHandler(this.Page_Load);
this.Unload += new System.EventHandler (this.Page_Unload);
this.SyncNowButton.Click += new System.EventHandler(this.OnSyncNowButton_Click);
+ this.ChangeMasterButton.PreRender += new EventHandler(this.ChangeMaster_PreRender);
+ this.ChangeMasterButton.Click += new System.EventHandler(this.OnChangeMasterButton_Click);
this.ViewLogButton.Click += new System.EventHandler(this.ViewLogFile);
}
#endregion
Modified: trunk/src/admin/css/iFolderAdmin.css
===================================================================
--- trunk/src/admin/css/iFolderAdmin.css 2010-04-21 11:45:26 UTC (rev 7335)
+++ trunk/src/admin/css/iFolderAdmin.css 2010-04-21 11:46:37 UTC (rev 7336)
@@ -43,6 +43,7 @@
width: 6.0em;
margin-left: 4px;
margin-top: 6px;
+ font-weight: bold;
}
.ldapeditifolderbuttons
Modified: trunk/src/admin/iFolderAdmin.resx
===================================================================
--- trunk/src/admin/iFolderAdmin.resx 2010-04-21 11:45:26 UTC (rev 7335)
+++ trunk/src/admin/iFolderAdmin.resx 2010-04-21 11:46:37 UTC (rev 7336)
@@ -1275,5 +1275,38 @@
<data name="WAITING">
<value>Waiting</value>
</data>
+ <data name="CHANGEMASTER">
+ <value>Set as Master</value>
+ </data>
+ <data name="UNABLETOSETASSLAVE">
+ <value>Unable to set as slave server. Retry the operation.</value>
+ </data>
+ <data name="CONFIGFILEUPDATEFAILED">
+ <value>Unable to update configuration file. Update the simias.config file manually.</value>
+ </data>
+ <data name="CONNECTIONFAILED">
+ <value>Unable to connect to server {0}.</value>
+ </data>
+ <data name="CHANGEMASTERNOINFOFAILED">
+ <value>Unable to get Server ID and New Server Public URL.</value>
+ </data>
+ <data name="CHANGEMASTERSUCCESSFUL">
+ <value>Successfully changed the Master and Slave. New Master is {0}. Restart all servers for the changes to take effect.</value>
+ </data>
+ <data name="CHANGEMASTERFAILED">
+ <value>Unable to change the Master and Slave. Check log files for more information.</value>
+ </data>
+ <data name="CONFIRMCHANGEMASTER">
+ <value>The selected server will be designated as a Master Server. Do you want to continue? Click OK to continue or Cancel to quit.</value>
+ </data>
+ <data name="UPDATEMASTERURLONSLAVESFAILED">
+ <value>Unable to update new master URL on server {0}. Update master IP in this server manually.</value>
+ </data>
+ <data name="MASTERNODEUPDATEWAIT">
+ <value>Waiting for master node attribute to synchronize to new master and slaves.</value>
+ </data>
+ <data name="CHANGEMASTERRETRY">
+ <value>Unable to update master node attribute on Master and slave. Retry the operation.</value>
+ </data>
</data>
</root>
Modified: trunk/src/admin/iFolderWebLogger.cs
===================================================================
--- trunk/src/admin/iFolderWebLogger.cs 2010-04-21 11:45:26 UTC (rev 7335)
+++ trunk/src/admin/iFolderWebLogger.cs 2010-04-21 11:46:37 UTC (rev 7336)
@@ -250,5 +250,16 @@
log.Fatal(Format(context, format, args), e);
}
}
+ private string Format(string format, params object[] args)
+ {
+ return String.Format(String.Format("[{0}] ", format), args);
+ }
+ public void Info(string format, params object[] args)
+ {
+ if (log.IsInfoEnabled)
+ {
+ log.Info(Format(format, args));
+ }
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-04-21 11:45:32
|
Revision: 7335
http://simias.svn.sourceforge.net/simias/?rev=7335&view=rev
Author: hegdegg
Date: 2010-04-21 11:45:26 +0000 (Wed, 21 Apr 2010)
Log Message:
-----------
Changes to make slave server as master.
Modified Paths:
--------------
trunk/src/core/CollectionStore/Collection.cs
trunk/src/core/CollectionStore/HostNode.cs
trunk/src/core/Storage/PropertyTags.cs
trunk/src/server/Simias.Server/Catalog.cs
trunk/src/webservices/iFolderAdmin.asmx.cs
trunk/src/webservices/iFolderAdminLocal.asmx.cs
trunk/src/webservices/iFolderServer.cs
Modified: trunk/src/core/CollectionStore/Collection.cs
===================================================================
--- trunk/src/core/CollectionStore/Collection.cs 2010-04-21 05:44:54 UTC (rev 7334)
+++ trunk/src/core/CollectionStore/Collection.cs 2010-04-21 11:45:26 UTC (rev 7335)
@@ -676,6 +676,7 @@
}
}
+
/// <summary>
/// Get or Set the HostID for this collection.
/// </summary>
@@ -699,10 +700,52 @@
p.LocalProperty = true;
properties.ModifyNodeProperty( p );
}
+ else
+ {
+ Property p = properties.FindSingleValue( PropertyTags.HostID);
+ if ( p != null )
+ {
+ p.DeleteProperty();
+ }
+ }
}
}
/// <summary>
+ /// Get or Set the HostUri for this collection.
+ /// </summary>
+ public string HostUri
+ {
+ get
+ {
+ string hostUri = null;
+ Property p = properties.FindSingleValue( PropertyTags.HostUri );
+ if (p != null)
+ {
+ hostUri = p.ToString();
+ }
+ return hostUri;
+ }
+ set
+ {
+ if (value != null && value.Length != 0)
+ {
+ Property p = new Property( PropertyTags.HostUri, value );
+ p.LocalProperty = true;
+ properties.ModifyNodeProperty( p );
+ }
+ else
+ {
+ Property p = properties.FindSingleValue( PropertyTags.HostUri);
+ if ( p != null )
+ {
+ p.DeleteProperty();
+ }
+ }
+ }
+ }
+
+ /// <summary>
/// Gets or Sets if SSL should be used.
/// </summary>
public bool UseSSL
Modified: trunk/src/core/CollectionStore/HostNode.cs
===================================================================
--- trunk/src/core/CollectionStore/HostNode.cs 2010-04-21 05:44:54 UTC (rev 7334)
+++ trunk/src/core/CollectionStore/HostNode.cs 2010-04-21 11:45:26 UTC (rev 7335)
@@ -52,6 +52,19 @@
const string LocalHostTag = "LocalHost";
#endregion
+ public enum changeMasterStates
+ {
+ /// <summary>
+ /// Changemaster process started
+ /// </summary>
+ Started,
+
+ /// <summary>
+ /// Changemaster all updates complete
+ /// </summary>
+ Complete
+ };
+
#region Properties
/// <summary>
/// Gets/Sets the public address for this host.
@@ -92,6 +105,26 @@
Properties.ModifyNodeProperty(new Property(PropertyTags.PrivateUrl, value));
}
}
+ /// <summary>
+ /// Gets/Sets the Master server address for this host.
+ /// </summary>
+ public string MasterUrl
+ {
+ get
+ {
+ Property pa = Properties.GetSingleProperty(PropertyTags.MasterUrl);
+ if (pa != null)
+ {
+ return pa.Value.ToString();
+ }
+ throw new NotExistException(PropertyTags.MasterUrl);
+ }
+ set
+ {
+ Properties.ModifyNodeProperty(new Property(PropertyTags.MasterUrl, value));
+ }
+ }
+ /// <summary>
/// <summary>
/// Gets/Sets if HostNode is the Master Host.
@@ -109,7 +142,14 @@
}
set
{
- Properties.ModifyNodeProperty(new Property(PropertyTags.MasterHost, value));
+ if ( value )
+ {
+ Properties.ModifyNodeProperty(new Property(PropertyTags.MasterHost, value));
+ }
+ else
+ {
+ properties.DeleteSingleNodeProperty( PropertyTags.MasterHost);
+ }
}
}
@@ -135,6 +175,33 @@
}
}
+
+ /// <summary>
+ /// Gets/Sets ChangeMasterState
+ /// </summary>
+ public int ChangeMasterState
+ {
+ get
+ {
+ Property pa = Properties.GetSingleProperty(PropertyTags.ChangeMasterState);
+ int value= (pa!=null) ? (int) pa.Value:(int)-1;
+ return value;
+ }
+ set
+ {
+ if ( value != -1)
+ {
+ Properties.ModifyNodeProperty(new Property(PropertyTags.ChangeMasterState, value));
+ }
+ else
+ {
+ properties.DeleteSingleNodeProperty( PropertyTags.ChangeMasterState);
+ }
+ }
+ }
+
+
+
#endregion
#region Constructors
Modified: trunk/src/core/Storage/PropertyTags.cs
===================================================================
--- trunk/src/core/Storage/PropertyTags.cs 2010-04-21 05:44:54 UTC (rev 7334)
+++ trunk/src/core/Storage/PropertyTags.cs 2010-04-21 11:45:26 UTC (rev 7335)
@@ -274,6 +274,11 @@
/// <summary>
/// Well known property name.
/// </summary>
+ static public string HostUri = "HostUri";
+
+ /// <summary>
+ /// Well known property name.
+ /// </summary>
static public string Journal = "JournalNode";
/// <summary>
@@ -483,6 +488,11 @@
/// <summary>
/// Well known property name.
/// </summary>
+ static public string ChangeMasterState = "ChangeMasterState";
+
+ /// <summary>
+ /// Well known property name.
+ /// </summary>
static public string AggregateDiskQuota = "AggregateDiskQuota";
@@ -568,6 +578,7 @@
systemPropertyTable.Add( DomainVersion, null );
systemPropertyTable.Add( UseSSL, null);
systemPropertyTable.Add( MasterHost, null);
+ systemPropertyTable.Add( ChangeMasterState, null);
}
#endregion
Modified: trunk/src/server/Simias.Server/Catalog.cs
===================================================================
--- trunk/src/server/Simias.Server/Catalog.cs 2010-04-21 05:44:54 UTC (rev 7334)
+++ trunk/src/server/Simias.Server/Catalog.cs 2010-04-21 11:45:26 UTC (rev 7335)
@@ -69,7 +69,7 @@
private static Store store;
private static Domain domain;
private static Collection catalog;
- internal static string catalogID = "a93266fd-55de-4590-b1c7-428f2fed815d";
+ public static string catalogID = "a93266fd-55de-4590-b1c7-428f2fed815d";
internal static string catalogName = "Collection Catalogue";
private static CollectionSyncClient syncClient;
@@ -100,6 +100,25 @@
}
#endregion
+ static internal string SyncRoleProperty = "Sync Role";
+ /// <summary>
+ /// Set/Get the SyncRol
+ /// </summary>
+ public SyncRoles SyncRole
+ {
+ get
+ {
+ Collection col = store.GetCollectionByID( catalogID );
+ return (col != null)?(SyncRoles)col.Properties.GetSingleProperty( SyncRoleProperty ).Value :(Simias.Sync.SyncRoles.None);
+ }
+ set
+ {
+ Collection col = store.GetCollectionByID( catalogID );
+ Property hprop = new Property( SyncRoleProperty, value );
+ col.Properties.ModifyProperty( hprop );
+ col.Commit();
+ }
+ }
#region Private Methods
/// <summary>
/// Event handler to handle an event
@@ -1193,18 +1212,18 @@
/// Delete a catalog entry for the specified collection
/// </summary>
static public void DeleteEntryByCollectionID( string CollectionID )
- {
- log.Debug("In DeleteEntryByCollectionID ...");
- Collection c = store.GetCollectionByID(CollectionID);
- CatalogEntry entry = GetEntryByCollectionID(CollectionID);
- if(entry != null)
- {
- catalog.Commit(catalog.Delete(entry));
- c.Commit(c.Delete());
- }
- log.Debug("Out of DeleteEntryByCollectionID ...");
- return ;
- }
+ {
+ log.Debug("In DeleteEntryByCollectionID ...");
+ Collection c = store.GetCollectionByID(CollectionID);
+ CatalogEntry entry = GetEntryByCollectionID(CollectionID);
+ if(entry != null)
+ {
+ catalog.Commit(catalog.Delete(entry));
+ c.Commit(c.Delete());
+ }
+ log.Debug("Out of DeleteEntryByCollectionID ...");
+ return ;
+ }
#endregion
}
@@ -1268,7 +1287,7 @@
{
log.Debug("Changing the host ID to: {0}", value);
Property hprop = new Property( HostProperty, value );
- this.Properties.ModifyProperty( hprop );
+ this.Properties.ModifyProperty( hprop );
catalog.Commit(this);
}
}
Modified: trunk/src/webservices/iFolderAdmin.asmx.cs
===================================================================
--- trunk/src/webservices/iFolderAdmin.asmx.cs 2010-04-21 05:44:54 UTC (rev 7334)
+++ trunk/src/webservices/iFolderAdmin.asmx.cs 2010-04-21 11:45:26 UTC (rev 7335)
@@ -682,6 +682,79 @@
return base.SetIPDetails(privateIP, publicIP, MastersIP);
}
+ /// <summary>
+ /// Get the Master Server
+ /// </summary>
+ /// <returns>true/false</returns>
+ [WebMethod(Description="gets the Master server", EnableSession=true)]
+ public override iFolderServer GetMasterServer ()
+ {
+ return base.GetMasterServer();
+ }
+
+ /// <summary>
+ /// Set the Master Url for node
+ /// </summary>
+ /// <returns>true/false</returns>
+ [WebMethod(Description="sets the MasterUrl for the server", EnableSession=true)]
+ public override bool SetMasterServerUrl (string HostID, string MasterUrl)
+ {
+ return base.SetMasterServerUrl (HostID, MasterUrl);
+ }
+
+ /// <summary>
+ /// Sets this server as Master Server
+ /// </summary>
+ /// <param name="HostID"> ID(Ace value) of the server</param>
+ /// <returns>true on success/false on failure</returns>
+ [WebMethod(Description= "set the new master server", EnableSession = true)]
+ public override bool SetAsMasterServer(string hostID)
+ {
+ return base.SetAsMasterServer(hostID);
+ }
+
+ /// <summary>
+ /// Sets this server as Slave Server
+ /// </summary>
+ /// <param name="HostID"> ID(Ace value) of the new server</param>
+ /// <param name="newMasterPublicUrl"> public url of the new master server</param>
+ /// <returns>true on success/false on failure</returns>
+ [WebMethod(Description= "set the server as Slave", EnableSession = true)]
+ public override bool SetAsSlaveServer(string newMasterHostID, string newMasterPublicUrl)
+ {
+ return base.SetAsSlaveServer(newMasterHostID, newMasterPublicUrl);
+ }
+
+ /// <summary>
+ /// Set the Master Url for node
+ /// </summary>
+ /// <returns>true/false</returns>
+ [WebMethod(Description="sets the Master node attriute for the host", EnableSession=true)]
+ public override bool SetMasterNodeAttribute(string HostID, bool Value)
+ {
+ return base.SetMasterNodeAttribute (HostID, Value);
+ }
+
+ /// <summary>
+ /// Get the value of IsMaster for this server
+ /// </summary>
+ /// <returns>true/false</returns>
+ [WebMethod(Description="Get the MasterNodeAttributes for the host", EnableSession=true)]
+ public override bool GetMasterNodeAttribute (string HostID)
+ {
+ return base.GetMasterNodeAttribute (HostID);
+ }
+
+ /// <summary>
+ /// Verify attributes of servers
+ /// </summary>
+ /// <returns>true/false</returns>
+ [WebMethod(Description="Get the Attributes for the host", EnableSession=true)]
+ public override bool VerifyChangeMaster(string currentMasterHostID, string newMasterHostID)
+ {
+ return base.VerifyChangeMaster( currentMasterHostID, newMasterHostID);
+ }
+
/// <summary>
/// Get information about a user using an id or username.
/// </summary>
Modified: trunk/src/webservices/iFolderAdminLocal.asmx.cs
===================================================================
--- trunk/src/webservices/iFolderAdminLocal.asmx.cs 2010-04-21 05:44:54 UTC (rev 7334)
+++ trunk/src/webservices/iFolderAdminLocal.asmx.cs 2010-04-21 11:45:26 UTC (rev 7335)
@@ -1842,6 +1842,118 @@
return result;
}
+ /// <summary>
+ /// Get the Master Server
+ /// </summary>
+ /// <returns>true/false</returns>
+ [WebMethod(Description="gets the Master server", EnableSession=true)]
+ public virtual iFolderServer GetMasterServer ()
+ {
+ return iFolderServer.GetMasterServer();
+ }
+
+
+ /// <summary>
+ /// set the Master Url on this node.
+ /// </summary>
+ /// <returns>true/false</returns>
+ [WebMethod(Description= "set the Master Url", EnableSession = true)]
+ public virtual bool SetMasterServerUrl (string HostID, string MasterUrl)
+ {
+ bool result = false;
+ try
+ {
+ result = iFolderServer.SetMasterServerUrl (HostID, MasterUrl);
+ }
+ catch (Exception e)
+ {
+ SmartException.Throw (e);
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// Sets this server as Master Server
+ /// </summary>
+ /// <param name="HostID"> ID(Ace value) of the server</param>
+ /// <returns>true on success/false on failure</returns>
+ [WebMethod(Description= "set the new master server", EnableSession = true)]
+ public virtual bool SetAsMasterServer(string hostID)
+ {
+ return iFolderServer.SetAsMasterServer( hostID );
+ }
+
+ /// <summary>
+ /// Sets this server as Slave Server
+ /// </summary>
+ /// <param name="HostID"> ID(Ace value) of the new server</param>
+ /// <param name="newMasterPublicUrl"> public url of the new master server</param>
+ /// <returns>true on success/false on failure</returns>
+ [WebMethod(Description= "set the HostID on Domain", EnableSession = true)]
+ public virtual bool SetAsSlaveServer(string newMasterHostID, string newMasterPublicUrl)
+ {
+ return iFolderServer.SetAsSlaveServer(newMasterHostID, newMasterPublicUrl);
+ }
+
+ /// <summary>
+ /// set the MasterNodeAttribute
+ /// </summary>
+ /// <returns>true/false</returns>
+ [WebMethod(Description= "set the Master node attribute", EnableSession = true)]
+ public virtual bool SetMasterNodeAttribute (string HostID, bool Value)
+ {
+ bool result = false;
+
+ try
+ {
+ result = iFolderServer.SetMasterNodeAttribute (HostID, Value);
+ }
+ catch (Exception e)
+ {
+ SmartException.Throw (e);
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// get the MasterNodeAttribute
+ /// </summary>
+ /// <returns>true/false</returns>
+ [WebMethod(Description= "get the Master node attribute", EnableSession = true)]
+ public virtual bool GetMasterNodeAttribute (string HostID)
+ {
+ bool result = false;
+
+ try
+ {
+ result = iFolderServer.GetMasterNodeAttribute (HostID);
+ }
+ catch (Exception e)
+ {
+ SmartException.Throw (e);
+ }
+ return result;
+ }
+
+ /// <summary>
+ /// get the server attributes
+ /// </summary>
+ /// <returns>true/false</returns>
+ [WebMethod(Description= "get the node attributes", EnableSession = true)]
+ public virtual bool VerifyChangeMaster(string cmHostID, string nmHostID)
+ {
+ bool result = false;
+
+ try
+ {
+ result = iFolderServer.VerifyChangeMaster(cmHostID, nmHostID);
+ }
+ catch (Exception e)
+ {
+ SmartException.Throw (e);
+ }
+ return result;
+ }
/// <summary>
/// DisablePast Sharing for the system
/// </summary>
Modified: trunk/src/webservices/iFolderServer.cs
===================================================================
--- trunk/src/webservices/iFolderServer.cs 2010-04-21 05:44:54 UTC (rev 7334)
+++ trunk/src/webservices/iFolderServer.cs 2010-04-21 11:45:26 UTC (rev 7335)
@@ -41,6 +41,7 @@
using Simias.Client;
using Simias.Storage;
using Simias.Server;
+using Simias.Sync;
using Simias.LdapProvider;
namespace iFolder.WebService
@@ -86,6 +87,7 @@
[Serializable]
public class iFolderServer
{
+ internal static string catalogID = "a93266fd-55de-4590-b1c7-428f2fed815d"; //TODO: refer.
/// <summary>
/// iFolder Log Instance
/// </summary>
@@ -605,6 +607,9 @@
privateUrl = AddVirtualPath( privateUrl );
publicUrl = AddVirtualPath( publicUrl );
+ log.Debug("private Url = {0}", privateUrl);
+ log.Debug("public url = {0}", publicUrl);
+
string SimiasConfigFilePath = Path.Combine ( Store.StorePath, "Simias.config");
if ( File.Exists( Path.Combine( Store.StorePath, Simias.Configuration.DefaultConfigFileName ) ) == true )
{
@@ -651,15 +656,254 @@
return UpdateStatus;
}
+
/// <summary>
+ /// This method is used to set the Master server url into simias.config file.
+ /// </summary>
+ /// <returns>true/false based upon the success/failure </returns>
+ public static bool SetMasterServerUrl (string HostID, string MasterUrl)
+ {
+ bool UpdateStatus = false;
+ string ServerSection="Server";
+ string MasterAddressKey = "MasterAddress";
+
+ if (MasterUrl != null && !MasterUrl.ToLower().StartsWith(Uri.UriSchemeHttps))
+ {
+ MasterUrl = (new UriBuilder(Uri.UriSchemeHttps, MasterUrl)).ToString();
+ }
+ try
+ {
+ Store store = Store.GetStore();
+ Domain domain = store.GetDomain(store.DefaultDomain);
+ HostNode localhostNode = HostNode.GetLocalHost();
+ domain.HostID = HostID;
+ domain.HostUri = MasterUrl;
+ domain.Commit();
+
+ string SimiasConfigFilePath = Path.Combine ( Store.StorePath, "Simias.config");
+ if ( File.Exists( Path.Combine( Store.StorePath, Simias.Configuration.DefaultConfigFileName ) ) == true )
+ {
+ SimiasConfigFilePath = Path.Combine( Store.StorePath, Simias.Configuration.DefaultConfigFileName );
+ }
+ XmlDocument document = new XmlDocument();
+ document.Load(SimiasConfigFilePath );
+ UpdateStatus = SetConfigValueWithSSL( document, ServerSection, MasterAddressKey, MasterUrl );
+ if(UpdateStatus == false) return false;
+ CommitConfiguration( document , SimiasConfigFilePath);
+ UpdateStatus = true;
+ }
+ catch(Exception ex)
+ {
+ SmartException.Throw(ex);
+ }
+ return UpdateStatus;
+ }
+
+ /// <summary>
+ /// This method is used to set the Current Server as Slave Server
+ /// To be called while setting the Master as Slave and creating a new master server
+ /// Ensure to make this call on the server which is Master Server
+ /// <param name ="newMasterHostID">HostID (Ace value) of the new Master Server </param>
+ /// <param name ="newMasterMasterPublicUrl">New Masters Public Url, this is to be set as HostUri on the current server domain
+ /// for this server to connect to new Master Server </param>
+ /// </summary>
+ /// <returns>true/false based upon the success/failure </returns>
+ public static bool SetAsSlaveServer(string newMasterHostID, string newMasterPublicUrl)
+ {
+ log.Info("Starting SetAsSlave.....");
+
+ try
+ {
+ Store store = Store.GetStore();
+ Domain domain = store.GetDomain(store.DefaultDomain);
+ Collection cat = store.GetCollectionByID(catalogID); //Simias.Server.Catalog.catalogID);
+
+ HostNode localhostNode = HostNode.GetLocalHost();
+
+ localhostNode.ChangeMasterState = (int)HostNode.changeMasterStates.Started;
+ domain.Commit(localhostNode);
+
+ //Setting the Maset node attribute to slave
+ localhostNode.IsMasterHost = false;
+
+ // HostID of the newMaster is updated in doman HostID
+ domain.HostID = newMasterHostID;
+ log.Info("Settting HostID with new Master Server HostID : {0}", domain.HostID);
+
+ // public url of the newmaster is updated in domain HostUri
+ domain.HostUri = newMasterPublicUrl;
+ log.Info("Setting HostUri with new Master Servers Public Url : {0}", domain.HostUri);
+
+ // Sync Roles updated for each of the collections.
+
+ //Updating the domain.
+ domain.Role = Simias.Sync.SyncRoles.Slave;
+ log.Info("Setting SyncRole on the Domain to Slave ({0})", domain.Role);
+
+ // Updating Catalog
+ cat.Role = Simias.Sync.SyncRoles.Slave;
+ log.Info("Setting SyncRole on the catalog");
+
+ domain.Commit();
+ cat.Commit(cat);
+ log.Info("Commiting all value to set this server ({0} as Slave Server", localhostNode.Name);
+
+
+ localhostNode.ChangeMasterState = (int)HostNode.changeMasterStates.Complete;
+ domain.Commit(localhostNode);
+ }
+ catch(Exception ex)
+ {
+ log.Error("Exception while running SetAsSlave : {0} : {1} ", ex.Message, ex.StackTrace);
+ return false;
+ }
+ return true;
+ }
+
+ /// <summary>
+ /// This method is used to set the Current Slave Server as Master
+ /// To be called while setting the Master as Slave and creating a new master server
+ /// Ensure to make this call on the server which is Slave Server
+ /// <param name ="HostID">HostID (Ace value) of the new Master Server </param>
+ /// for this server to connect to new Master Server </param>
+ /// </summary>
+ /// <returns>true/false based upon the success/failure </returns>
+ public static bool SetAsMasterServer(string HostID)
+ {
+ log.Info("Starting SetAsMasterServer");
+ log.Info(" HostName = {0}", HostID);
+
+ try
+ {
+ Store store = Store.GetStore();
+ Domain domain = store.GetDomain(store.DefaultDomain);
+ Collection cat = store.GetCollectionByID(catalogID); //Simias.Server.Catalog.catalogID);
+
+ HostNode localhostNode = HostNode.GetHostByID(domain.ID, HostID);
+
+ localhostNode.ChangeMasterState = (int)HostNode.changeMasterStates.Started;
+ domain.Commit(localhostNode);
+ log.Info("ChangeMasterState tag set to Started on this server");
+
+ // MasterNodeAttribute updated on this server.
+ localhostNode.IsMasterHost = true;
+ log.Info("Master Node Attribute set on New Master");
+
+ // Sync Roles updated for each of the collections.
+
+ //Updating the domain.
+ domain.Role = Simias.Sync.SyncRoles.Master;
+ log.Info("Setting SyncRole on the Domain");
+
+ // Updating Catalog
+ cat.Role = Simias.Sync.SyncRoles.Master;
+ log.Info("Setting SyncRole on the catalog");
+
+ // Remove the HostId
+ domain.HostID = "";
+ log.Info("Removing the HostID entry from Slave server");
+
+ // Remove the HostUrl
+ domain.HostUri = "";
+ log.Info("Removing the HostUri entry from Slave server");
+
+ domain.Commit();
+ domain.Commit(localhostNode);
+ cat.Commit(cat);
+ log.Info("This server is set as Master server successfully.");
+
+ localhostNode.ChangeMasterState = (int)HostNode.changeMasterStates.Complete;
+ domain.Commit(localhostNode);
+ log.Info("ChangeMasterState tag updated on this server");
+ }
+ catch(Exception ex)
+ {
+ log.Error("Exception while setting new Master Server :{0} : {1}", ex.Message, ex.StackTrace);
+ return false;
+ }
+ return true;
+ }
+
+ public static bool SetMasterNodeAttribute (string HostID, bool Value)
+ {
+ try
+ {
+ Store store = Store.GetStore();
+ log.Error("Set Master store : {0}", HostID);
+ Domain domain = store.GetDomain(store.DefaultDomain);
+ //HostNode lHostNode = HostNode.GetHostByID(domain.ID, HostID);
+ HostNode lHostNode = HostNode.GetHostLocalHost();
+ lHostNode.IsMasterHost = Value;
+ domain.Commit(lHostNode);
+ }
+ catch (Exception ex)
+ {
+ log.Error("Unable to set Master Node Attribute :{0} :{1}", ex.Message, ex.StackTrace);
+ return false;
+ }
+ return true;
+ }
+
+ public static bool GetMasterNodeAttribute(string HostID)
+ {
+ try
+ {
+ Store store = Store.GetStore();
+ Domain domain = store.GetDomain(store.DefaultDomain);
+ HostNode lHostNode = HostNode.GetHostByID(domain.ID, HostID);
+ return lHostNode.IsMasterHost ;
+ }
+ catch(Exception ex)
+ {
+ throw ex;
+ }
+ }
+
+ public static bool VerifyChangeMaster(string currentMasterID, string newMasterID)
+ {
+ bool retval = true;
+ log.Info("Verifying all values after Changing Master and Slave Server");
+ try
+ {
+ Store store = Store.GetStore();
+ Domain domain = store.GetDomain(store.DefaultDomain);
+ Collection cat = store.GetCollectionByID(catalogID); //Simias.Server.Catalog.catalogID);
+
+ HostNode currentMasterNode = HostNode.GetHostByID(domain.ID, currentMasterID);
+ HostNode newMasterNode = HostNode.GetHostByID(domain.ID, newMasterID);
+
+ log.Info("Domain attributes");
+ log.Info("HostID : {0}", domain.HostID);
+ log.Info("HostUrl : {0}", domain.HostUri);
+ log.Info("Domain Sync Role : {0}", domain.Role);
+
+ log.Info("Catalog attributes");
+ log.Info("Catalog Sync Role : {0}", cat.Role);
+
+ log.Info("Current Master node attributes");
+ log.Info("Name : {0}", currentMasterNode.Name);
+ log.Info("IsMasterHost : {0}", currentMasterNode.IsMasterHost);
+ log.Info("ChangeMasterState : {0}", currentMasterNode.ChangeMasterState);
+
+ log.Info("New Master node attributes");
+ log.Info("Name : {0}", newMasterNode.Name);
+ log.Info("IsMasterHost : {0}", newMasterNode.IsMasterHost);
+ log.Info("ChangeMasterState : {0}", newMasterNode.ChangeMasterState);
+ }
+ catch (Exception ex)
+ {
+ log.Error("Uable to verify change master");
+ retval = false;
+ throw ex;
+ }
+ return retval;
+ }
+
+ /// <summary>
/// Update the Master Url in the local store
/// </summary>
- /// <param name="masterUrl">
- /// A <see cref="System.String"/>
- /// </param>
- /// /// <returns>
- /// A <see cref="System.Boolean"/>
- /// </returns>
+ /// <param name="masterUrl"> url of the master server for the domain </param>
+ /// /// <returns> true/false on success/failure </returns>
private static bool UpdateMasterURL( string masterUrl)
{
bool retVal = true;;
@@ -673,11 +917,11 @@
}
catch (Exception ex)
{
- log.Debug("Exception in UpdateMasterURL" + ex.Message);
retVal = false;
}
return retVal;
}
+
/// <summary>
/// Adds simias10 into the path
/// </summary>
@@ -727,6 +971,7 @@
}
catch(Exception ex)
{
+ log.Error("Ex at SetConfigValuewithSSL");
SmartException.Throw(ex);
}
return updated;
@@ -741,124 +986,149 @@
/// <param name="configValue">value</param>
/// <returns>true if successful</returns>
private static bool SetConfigValue(XmlDocument document, string section, string key, string configValue)
- {
+ {
bool status = false;
// xml tags
- string SectionTag = "section";
- string SettingTag = "setting";
- string NameAttr = "name";
- string ValueAttr = "value";
+ string SectionTag = "section";
+ string SettingTag = "setting";
+ string NameAttr = "name";
+ string ValueAttr = "value";
// Build an xpath for the setting.
- string str = string.Format("//{0}[@{1}='{2}']/{3}[@{1}='{4}']", SectionTag, NameAttr, section, SettingTag, key);
- XmlElement element = ( XmlElement )document.DocumentElement.SelectSingleNode(str);
- if ( configValue == null )
- {
- // If a null value is passed in, remove the element.
- try
- {
- element.ParentNode.RemoveChild( element );
- }
- catch {}
- }
- else
- {
- if (element != null)
- {
- element.SetAttribute(ValueAttr, configValue);
- status = true;
- }
- else
- {
- // The setting doesn't exist, so create it.
- element = document.CreateElement(SettingTag);
- element.SetAttribute(NameAttr, key);
- element.SetAttribute(ValueAttr, configValue);
- str = string.Format("//{0}[@{1}='{2}']", SectionTag, NameAttr, section);
- XmlElement eSection = (XmlElement)document.DocumentElement.SelectSingleNode(str);
- if ( eSection == null )
- {
- // If the section doesn't exist, create it.
- eSection = document.CreateElement( SectionTag );
- eSection.SetAttribute( NameAttr, section );
- document.DocumentElement.AppendChild( eSection );
- }
+ string str = string.Format("//{0}[@{1}='{2}']/{3}[@{1}='{4}']", SectionTag, NameAttr, section, SettingTag, key);
+ XmlElement element = ( XmlElement )document.DocumentElement.SelectSingleNode(str);
+ if ( configValue == null )
+ {
+ // If a null value is passed in, remove the element.
+ try
+ {
+ element.ParentNode.RemoveChild( element );
+ }
+ catch {}
+ }
+ else
+ {
+ if (element != null)
+ {
+ element.SetAttribute(ValueAttr, configValue);
+ status = true;
+ }
+ else
+ {
+ // The setting doesn't exist, so create it.
+ element = document.CreateElement(SettingTag);
+ element.SetAttribute(NameAttr, key);
+ element.SetAttribute(ValueAttr, configValue);
+ str = string.Format("//{0}[@{1}='{2}']", SectionTag, NameAttr, section);
+ XmlElement eSection = (XmlElement)document.DocumentElement.SelectSingleNode(str);
+ if ( eSection == null )
+ {
+ // If the section doesn't exist, create it.
+ eSection = document.CreateElement( SectionTag );
+ eSection.SetAttribute( NameAttr, section );
+ document.DocumentElement.AppendChild( eSection );
+ }
- eSection.AppendChild(element);
- status = true;
- }
- }
-
+ eSection.AppendChild(element);
+ status = true;
+ }
+ }
+
return status;
}
- /// <summary>
- /// Set up ssl for master server
- /// </summary>
- /// <param name="masterAddress">address of the master server</param>
- private static void SetupSSLForMaster(string masterAddress)
- {
- if (masterAddress.ToLower().StartsWith(Uri.UriSchemeHttps))
- {
- string machineArch = Environment.GetEnvironmentVariable("HOSTTYPE");
- string webPath = ( machineArch.IndexOf("_64" ) > 0 ? Path.GetFullPath("../../../../lib64/simias/web"): Path.GetFullPath("../../../../lib/simias/web"));
- // swap policy
- ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
+ private static string GetServerArch()
+ {
+ string machArch = null;
+ try
+ {
- // connect
- HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create(masterAddress);
+ string path = Path.GetFullPath("/etc/apache2/conf.d/simias.conf");
- try
- {
- request.GetResponse();
- }
- catch
- {
- // ignore
- }
+ TextReader reader = (TextReader)File.OpenText(path);
+
+ if(reader == null)
+ return null;
+
+ string line;
- // restore policy
+ while((line = reader.ReadLine()) != null)
+ {
+ if (line.StartsWith("Alias"))
+ {
+ machArch = (line.IndexOf("lib64") >= 0) ? "x86_64" : "x86_32";
+ break;
+ }
+ }
+
+ reader.Close();
+ }catch
+ {
+ }
+ return machArch;
+ }
- // service point
- ServicePoint sp = request.ServicePoint;
- if(sp == null) throw new Exception("sp is null for master "+masterAddress);
- if(sp.Certificate == null) throw new Exception("sp.Certificate is null for master "+masterAddress);
- if ((sp != null) && (sp.Certificate != null))
- {
- string path = Path.GetFullPath(Path.Combine(webPath, "web.config"));
- string certRawDetail = Convert.ToBase64String(sp.Certificate.GetRawCertData());
- string certDetail = sp.Certificate.ToString(true);
+ /// <summary>
+ /// Set up ssl for master server
+ /// </summary>
+ /// <param name="masterAddress">address of the master server</param>
+ private static void SetupSSLForMaster(string masterAddress)
+ {
+ if (masterAddress.ToLower().StartsWith(Uri.UriSchemeHttps))
+ {
+ string machineArch = GetServerArch();
+ string webPath = webPath = Path.GetFullPath("../../../../lib/simias/web");
- XmlDocument doc = new XmlDocument();
+ if (machineArch != null)
+ {
+ webPath = ( machineArch.IndexOf("_64" ) > 0 ? Path.GetFullPath("../../../../lib64/simias/web"): Path.GetFullPath("../../../../lib/simias/web"));
+ }
- doc.Load(path);
+ // swap policy
+ ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
+ HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create(masterAddress);
- XmlElement cert = (XmlElement)doc.DocumentElement.SelectSingleNode("//configuration/appSettings/add[@key='SimiasCert']");
+ try
+ {
+ HttpWebResponse response = (HttpWebResponse)request.GetResponse();
+ }
+ catch (Exception ex)
+ {
+ // ignore
+ }
- if (cert != null)
- {
- cert.Attributes["value"].Value = certRawDetail;
+ // restore policy
- doc.Save(path);
+ // service point
+ ServicePoint sp = request.ServicePoint;
+ if(sp == null) throw new Exception("sp is null for master "+ masterAddress);
+ if(sp.Certificate == null) throw new Exception("sp.Certificate is null for master "+masterAddress);
+ if ((sp != null) && (sp.Certificate != null))
+ {
+ string path = Path.GetFullPath(Path.Combine(webPath, "web.config"));
+ string certRawDetail = Convert.ToBase64String(sp.Certificate.GetRawCertData());
+ string certDetail = sp.Certificate.ToString(true);
+ XmlDocument doc = new XmlDocument();
+ doc.Load(path);
+ XmlElement cert = (XmlElement)doc.DocumentElement.SelectSingleNode("//configuration/appSettings/add[@key='SimiasCert']");
+ if (cert != null)
+ {
+ cert.Attributes["value"].Value = certRawDetail;
+ doc.Save(path);
+ }
+ else
+ {
+ throw new Exception(String.Format("Unable to find \"SimiasCert\" tag in the {0} file.", path));
+ }
+ }
+ else
+ {
+ throw new Exception("Unable to retrieve the certificate from the iFolder server.webpath is :"+webPath);
+ }
+ }
+ }
- //Console.WriteLine("Done");
- }
- else
- {
- throw new Exception(String.Format("Unable to find \"SimiasCert\" tag in the {0} file.", path));
- }
- }
- else
- {
- throw new Exception("Unable to retrieve the certificate from the iFolder server.webpath is :"+webPath);
- }
-
- }
-
- }
-
-
/// <summary>
/// Get the HomeServer URL for User.
/// </summary>
@@ -899,6 +1169,7 @@
string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
domainService.Credentials = new NetworkCredential(iFolderUserBase64, iFolderPassBase64);
+ domainService.Credentials = new NetworkCredential(username, password);
domainService.PreAuthenticate = true;
publicUrl = domainService.GetHomeServer( username ).PublicAddress;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ra...@us...> - 2010-04-21 05:45:01
|
Revision: 7334
http://simias.svn.sourceforge.net/simias/?rev=7334&view=rev
Author: ravim85
Date: 2010-04-21 05:44:54 +0000 (Wed, 21 Apr 2010)
Log Message:
-----------
These changes are for supporting muti byte chars for Authentication
Creds are encoded ans sent for Auth. If a new client is connecting to
old server, then auth fails and we fall back and send creds in
non_encoded format
Modified Paths:
--------------
trunk/src/admin/Login.aspx.cs
trunk/src/core/Common/WebState.cs
trunk/src/core/Domain/DomainAgent.cs
trunk/src/core/Sync/Http.cs
trunk/src/server/Simias.Server/Authentication.cs
trunk/src/webaccess/Login.aspx.cs
trunk/src/webservices/iFolderServer.cs
Modified: trunk/src/admin/Login.aspx.cs
===================================================================
--- trunk/src/admin/Login.aspx.cs 2010-04-21 05:41:55 UTC (rev 7333)
+++ trunk/src/admin/Login.aspx.cs 2010-04-21 05:44:54 UTC (rev 7334)
@@ -412,9 +412,16 @@
webUrl.Path = (new Uri(web.Url)).PathAndQuery;
web.Url = webUrl.Uri.ToString();
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(username);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ encodedCredsByteArray = utf8Name.GetBytes(password);
+ string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
// credentials
web.PreAuthenticate = true;
- web.Credentials = new NetworkCredential(username, password);
+ web.Credentials = new NetworkCredential(iFolderUserBase64, iFolderPassBase64);
// cookies
web.CookieContainer = new CookieContainer();
@@ -444,9 +451,8 @@
iFolderServer server = web.GetHomeServer();
Session["Version"] = server.Version;
- UTF8Encoding utf8Name = new UTF8Encoding();
- byte[] EncodedUserNameInByte = utf8Name.GetBytes(user.UserName);
- string iFolderUserBase64 = Convert.ToBase64String(EncodedUserNameInByte);
+ encodedCredsByteArray = utf8Name.GetBytes(user.UserName);
+ iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
// new username cookie for 30 days
Response.Cookies["username"].Value = iFolderUserBase64;
Modified: trunk/src/core/Common/WebState.cs
===================================================================
--- trunk/src/core/Common/WebState.cs 2010-04-21 05:41:55 UTC (rev 7333)
+++ trunk/src/core/Common/WebState.cs 2010-04-21 05:44:54 UTC (rev 7334)
@@ -36,6 +36,7 @@
using System.Collections;
using System.Web;
using System.Net;
+using System.Text;
using System.Web.Services.Protocols;
using Simias.Storage;
@@ -281,7 +282,12 @@
{
member = Store.GetStore().GetDomain( DomainID ).GetMemberByID( UserID );
}
- creds = new BasicCredentials( DomainID, CollectionID, member.Name );
+
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(member.Name);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ creds = new BasicCredentials( DomainID, CollectionID,iFolderUserBase64);
if ( creds.Cached == true )
{
credentials = creds.GetNetworkCredential();
@@ -289,7 +295,7 @@
else
{
// Get the credentials for this collection.
- creds = new BasicCredentials( DomainID, DomainID, member.Name );
+ creds = new BasicCredentials( DomainID, DomainID, iFolderUserBase64 );
if ( creds.Cached == true )
{
credentials = creds.GetNetworkCredential();
Modified: trunk/src/core/Domain/DomainAgent.cs
===================================================================
--- trunk/src/core/Domain/DomainAgent.cs 2010-04-21 05:41:55 UTC (rev 7333)
+++ trunk/src/core/Domain/DomainAgent.cs 2010-04-21 05:44:54 UTC (rev 7334)
@@ -35,6 +35,7 @@
using System.Collections;
using System.Net;
using System.IO;
+using System.Text;
using System.Threading;
using System.Web;
using System.Xml;
@@ -247,21 +248,7 @@
request.Headers.Add(
Simias.Security.Web.AuthenticationService.Login.BasicEncodingHeader,
-#if MONO
- // bht: Fix for Bug 73324 - Client fails to authenticate if LDAP
- // username has an international character in it.
- //
- // Mono converts the username and password to a byte array
- // without paying attention to the encoding. In NLD, the
- // default encoding is UTF-8. Without this fix, we ended up
- // sending the username and password in 1252 but the server
- // was attempting to decode it as UTF-8. This fix forces the
- // username and password to be sent with Windows-1252 encoding
- // which properly gets decoded on the server.
- System.Text.Encoding.GetEncoding(1252).WebName );
-#else
- System.Text.Encoding.Default.WebName );
-#endif
+ System.Text.Encoding.UTF8.WebName );
request.Method = "POST";
request.ContentLength = 0;
@@ -553,8 +540,16 @@
domainServiceUrl = new Uri( tempUri.Uri , DomainServicePath );
}
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(user);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ encodedCredsByteArray = utf8Name.GetBytes(password);
+ string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
// Build a credential from the user name and password.
- NetworkCredential myCred = new NetworkCredential( user, password );
+ NetworkCredential myCred = new NetworkCredential( iFolderUserBase64, iFolderPassBase64 );
+ NetworkCredential myOldCred = new NetworkCredential( user, password );
// Create the domain service web client object.
DomainService domainService = new DomainService();
@@ -598,6 +593,11 @@
string baseUrl = domainServiceUrl.ToString();
baseUrl = baseUrl.Substring(0, baseUrl.LastIndexOf('/'));
+ // This flag is used to identify if server is old and not supporting multi byte login
+ // Then creds are sent with out encoding again.
+
+ bool oldServer = false;
+
//Login to the server mentioned by the user, possible the user is already provisioned and this is a different client that is creating an account
status =
this.Login(
@@ -608,12 +608,24 @@
if ((status.statusCode != SCodes.Success) && (status.statusCode != SCodes.SuccessInGrace) && (status.statusCode != SCodes.UserAlreadyMoved))
{
log.Debug("Got Status {0}", status.statusCode);
- return status;
+ if( status.statusCode == SCodes.InvalidCredentials )
+ {
+ // Post 3.8.0.2, multibyte char support for usernames and password is added
+ // If a new client is connecting to an old server, then auth will fail as creds
+ // are encoded. Hence we try once more without encoding the creds.
+ log.Debug("This might be old server 3.8.0.2 with no multi byte support, trying once more with out encoding the creds");
+ status = this.Login( new Uri( baseUrl ), domainID, myOldCred, false );
+ if ( status.statusCode == SCodes.Success || status.statusCode == SCodes.SuccessInGrace )
+ oldServer = true;
+ else
+ return status;
+ }
}
else
log.Debug("Got else Status {0}", status.statusCode);
// Get the Home Server.
+ domainService.Credentials = oldServer ? myOldCred : myCred ;
string hostID = null;
HostInfo hInfo = new HostInfo();
@@ -635,7 +647,7 @@
DomainService ds = new DomainService();
ds.CookieContainer = cookies;
ds.Url = (new Uri(masterServerURL.TrimEnd(new char[] { '/' }) + DomainService)).ToString();
- ds.Credentials = myCred;
+ ds.Credentials = oldServer ? myOldCred : myCred;
ds.PreAuthenticate = true;
// ds.Proxy = ProxyState.GetProxyState( domainServiceUrl );
ds.AllowAutoRedirect = true;
@@ -690,7 +702,7 @@
this.Login(
new Uri( hInfo.PublicAddress ),
domainID,
- myCred,
+ oldServer ? myOldCred : myCred,
false);
if ( ( status.statusCode != SCodes.Success ) && ( status.statusCode != SCodes.SuccessInGrace ) )
{
@@ -721,7 +733,7 @@
// Save the credentials
CredentialCache myCache = new CredentialCache();
- myCache.Add(new Uri(domainService.Url), "Basic", myCred);
+ myCache.Add(new Uri(domainService.Url), "Basic", oldServer ? myOldCred : myCred);
domainService.Credentials = myCache;
domainService.Timeout = 30000;
@@ -892,7 +904,22 @@
log.Debug( "Login - called" );
log.Debug( " DomainID: " + DomainID );
log.Debug( " Username: " + Username );
+
+ // This flag is used to identify if server is old and not supporting multi byte login
+ // Then creds are sent with out encoding again.
+
+ bool oldServer = false;
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(Username);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ encodedCredsByteArray = utf8Name.GetBytes(Password);
+ string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ NetworkCredential myCred = new NetworkCredential( iFolderUserBase64, iFolderPassBase64 );
+ NetworkCredential myOldCred = new NetworkCredential( Username, Password );
+
Simias.Authentication.Status status = null;
Domain cDomain = store.GetDomain( DomainID );
if ( cDomain != null )
@@ -911,7 +938,7 @@
this.Login(
tempUri.Uri,
DomainID,
- new NetworkCredential( Username, Password ),
+ myCred,
false );
if ( status.statusCode == SCodes.Success ||
@@ -921,16 +948,36 @@
new BasicCredentials(
DomainID,
DomainID,
- Username,
- Password );
+ iFolderUserBase64,
+ iFolderPassBase64 );
basic.Save( false );
SetDomainState( DomainID, true, true );
}
+ else
+ {
+ // Post 3.8.0.2, multibyte char support for usernames and password is added
+ // If a new client is connecting to an old server, then auth will fail as creds
+ // are encoded. Hence we try once more without encoding the creds.
+ log.Debug("possibly server is 3.8.0.2 not supporting multi byte,trying again without encoding creds ");
+ status = this.Login( tempUri.Uri, DomainID, myOldCred, false);
+ if ( status.statusCode == SCodes.Success || status.statusCode == SCodes.SuccessInGrace )
+ {
+ oldServer = true;
+ BasicCredentials basic =
+ new BasicCredentials(
+ DomainID,
+ DomainID,
+ Username,
+ Password);
+ basic.Save( false );
+ SetDomainState( DomainID, true, true);
+ }
+ }
if (status.statusCode == SCodes.UserAlreadyMoved && Password != null)
{
// Connect to master , and login to new server where user has been moved
- status = ProvisionToNewHomeServer(DomainID, new NetworkCredential(Username, Password));
+ status = ProvisionToNewHomeServer(DomainID, oldServer ? myOldCred : myCred);
return status;
}
}
Modified: trunk/src/core/Sync/Http.cs
===================================================================
--- trunk/src/core/Sync/Http.cs 2010-04-21 05:41:55 UTC (rev 7333)
+++ trunk/src/core/Sync/Http.cs 2010-04-21 05:44:54 UTC (rev 7334)
@@ -294,7 +294,16 @@
WebHeaderCollection headers = request.Headers;
headers.Add(SyncHeaders.SyncVersion, HttpService.version);
headers.Add(SyncHeaders.Method, method.ToString());
- headers.Add(SyncHeaders.UserName, userName);
+ try {
+ headers.Add(SyncHeaders.UserName, userName);
+ }catch
+ {
+ // On Windows client, for some username with multi-byte chars,
+ // Exception occurs. However, we can ignore this as we would already
+ // have the user ID with us
+ log.Debug("Syncing multi byte char user name");
+ }
+
headers.Add(SyncHeaders.UserID, userID);
try {
//TODO: could be removed?
Modified: trunk/src/server/Simias.Server/Authentication.cs
===================================================================
--- trunk/src/server/Simias.Server/Authentication.cs 2010-04-21 05:41:55 UTC (rev 7333)
+++ trunk/src/server/Simias.Server/Authentication.cs 2010-04-21 05:44:54 UTC (rev 7334)
@@ -36,6 +36,7 @@
using System.Reflection;
using System.Net;
using System.Web;
+using System.Text;
using System.Threading;
using Simias;
@@ -387,8 +388,8 @@
if ( credentials.Length == 2 )
{
- this.username = credentials[ 0 ];
- this.password = credentials[ 1 ];
+ this.username = DecodeCreds(credentials[ 0 ], encodingName);
+ this.password = DecodeCreds(credentials[ 1 ], encodingName);
this.authType = "basic";
returnStatus = true;
}
@@ -399,7 +400,30 @@
return returnStatus;
}
+
/// <summary>
+ /// Returns the decoded value of user creds if its encoded. Else will return the same [ Old Client ] .
+ /// </summary>
+ /// <returns>String - User Creds in String</returns>
+ private string DecodeCreds(string creds, string encodingName)
+ {
+ try
+ {
+ byte[] encodedCredsByteArray = Convert.FromBase64String(creds);
+ Encoding encoder = System.Text.Encoding.GetEncoding( encodingName );
+ return encoder.GetString(encodedCredsByteArray, 0, encodedCredsByteArray.Length);
+ }
+ catch(Exception ex)
+ {
+ // Exception occurs when we try to decode string which is not encoded
+ // TODO : Find the right exception and catch it.
+ return creds;
+ }
+
+ }
+
+
+ /// <summary>
/// Returns whether the object has credentials.
/// </summary>
/// <returns></returns>
@@ -454,7 +478,7 @@
defaultBasicEncodingName = Store.Config.Get( Storage.Domain.SectionName, Storage.Domain.Encoding );
if ( defaultBasicEncodingName == null )
{
- defaultBasicEncodingName = "iso-8859-1";
+ defaultBasicEncodingName = "utf-8";
}
store = Store.GetStore();
Modified: trunk/src/webaccess/Login.aspx.cs
===================================================================
--- trunk/src/webaccess/Login.aspx.cs 2010-04-21 05:41:55 UTC (rev 7333)
+++ trunk/src/webaccess/Login.aspx.cs 2010-04-21 05:44:54 UTC (rev 7334)
@@ -450,9 +450,18 @@
loginUrl.Path = (new Uri(weblogin.Url)).PathAndQuery;
weblogin.Url = loginUrl.Uri.ToString();
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(username);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ encodedCredsByteArray = utf8Name.GetBytes(password);
+ string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+
+
// credentials
weblogin.PreAuthenticate = true;
- weblogin.Credentials = new NetworkCredential(username, password);
+ weblogin.Credentials = new NetworkCredential(iFolderUserBase64, iFolderPassBase64);
// cookies
weblogin.CookieContainer = new CookieContainer();
@@ -492,7 +501,7 @@
// credentials
web.PreAuthenticate = true;
- web.Credentials = new NetworkCredential(username, password);
+ web.Credentials = new NetworkCredential(iFolderUserBase64, iFolderPassBase64);
// cookies
web.CookieContainer = new CookieContainer();
@@ -524,9 +533,8 @@
iFolderServer server = web.GetHomeServer();
Session["Server"] = server;
- UTF8Encoding utf8Name = new UTF8Encoding();
- byte[] EncodedUserNameInByte = utf8Name.GetBytes(user.UserName);
- string iFolderUserBase64 = Convert.ToBase64String(EncodedUserNameInByte);
+ encodedCredsByteArray = utf8Name.GetBytes(user.UserName);
+ iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
// new username cookie for 30 days
Response.Cookies.Remove("username");
Modified: trunk/src/webservices/iFolderServer.cs
===================================================================
--- trunk/src/webservices/iFolderServer.cs 2010-04-21 05:41:55 UTC (rev 7333)
+++ trunk/src/webservices/iFolderServer.cs 2010-04-21 05:44:54 UTC (rev 7334)
@@ -890,7 +890,15 @@
DomainService domainService = new DomainService();
domainService.Url = MasterServer.PublicUrl + "/DomainService.asmx";
- domainService.Credentials = new NetworkCredential(username, password);
+
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(username);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ encodedCredsByteArray = utf8Name.GetBytes(password);
+ string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ domainService.Credentials = new NetworkCredential(iFolderUserBase64, iFolderPassBase64);
domainService.PreAuthenticate = true;
publicUrl = domainService.GetHomeServer( username ).PublicAddress;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ra...@us...> - 2010-04-21 05:42:02
|
Revision: 7333
http://simias.svn.sourceforge.net/simias/?rev=7333&view=rev
Author: ravim85
Date: 2010-04-21 05:41:55 +0000 (Wed, 21 Apr 2010)
Log Message:
-----------
These changes are for supporting muti byte chars for Authentication
Creds are encoded ans sent for Auth. If a new client is connecting to
old server, then auth fails and we fall back and send creds in
non_encoded format
Modified Paths:
--------------
branches/iFolder_3.8.0_updates/src/admin/Login.aspx.cs
branches/iFolder_3.8.0_updates/src/core/Common/WebState.cs
branches/iFolder_3.8.0_updates/src/core/Domain/DomainAgent.cs
branches/iFolder_3.8.0_updates/src/core/Sync/Http.cs
branches/iFolder_3.8.0_updates/src/server/Simias.Server/Authentication.cs
branches/iFolder_3.8.0_updates/src/webaccess/Login.aspx.cs
branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs
Modified: branches/iFolder_3.8.0_updates/src/admin/Login.aspx.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/admin/Login.aspx.cs 2010-04-13 04:11:28 UTC (rev 7332)
+++ branches/iFolder_3.8.0_updates/src/admin/Login.aspx.cs 2010-04-21 05:41:55 UTC (rev 7333)
@@ -412,9 +412,16 @@
webUrl.Path = (new Uri(web.Url)).PathAndQuery;
web.Url = webUrl.Uri.ToString();
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(username);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ encodedCredsByteArray = utf8Name.GetBytes(password);
+ string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
// credentials
web.PreAuthenticate = true;
- web.Credentials = new NetworkCredential(username, password);
+ web.Credentials = new NetworkCredential(iFolderUserBase64, iFolderPassBase64);
// cookies
web.CookieContainer = new CookieContainer();
@@ -444,9 +451,8 @@
iFolderServer server = web.GetHomeServer();
Session["Version"] = server.Version;
- UTF8Encoding utf8Name = new UTF8Encoding();
- byte[] EncodedUserNameInByte = utf8Name.GetBytes(user.UserName);
- string iFolderUserBase64 = Convert.ToBase64String(EncodedUserNameInByte);
+ encodedCredsByteArray = utf8Name.GetBytes(user.UserName);
+ iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
// new username cookie for 30 days
Response.Cookies["username"].Value = iFolderUserBase64;
Modified: branches/iFolder_3.8.0_updates/src/core/Common/WebState.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/Common/WebState.cs 2010-04-13 04:11:28 UTC (rev 7332)
+++ branches/iFolder_3.8.0_updates/src/core/Common/WebState.cs 2010-04-21 05:41:55 UTC (rev 7333)
@@ -36,6 +36,7 @@
using System.Collections;
using System.Web;
using System.Net;
+using System.Text;
using System.Web.Services.Protocols;
using Simias.Storage;
@@ -281,7 +282,12 @@
{
member = Store.GetStore().GetDomain( DomainID ).GetMemberByID( UserID );
}
- creds = new BasicCredentials( DomainID, CollectionID, member.Name );
+
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(member.Name);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ creds = new BasicCredentials( DomainID, CollectionID,iFolderUserBase64);
if ( creds.Cached == true )
{
credentials = creds.GetNetworkCredential();
@@ -289,7 +295,7 @@
else
{
// Get the credentials for this collection.
- creds = new BasicCredentials( DomainID, DomainID, member.Name );
+ creds = new BasicCredentials( DomainID, DomainID, iFolderUserBase64 );
if ( creds.Cached == true )
{
credentials = creds.GetNetworkCredential();
Modified: branches/iFolder_3.8.0_updates/src/core/Domain/DomainAgent.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/Domain/DomainAgent.cs 2010-04-13 04:11:28 UTC (rev 7332)
+++ branches/iFolder_3.8.0_updates/src/core/Domain/DomainAgent.cs 2010-04-21 05:41:55 UTC (rev 7333)
@@ -35,6 +35,7 @@
using System.Collections;
using System.Net;
using System.IO;
+using System.Text;
using System.Threading;
using System.Web;
using System.Xml;
@@ -247,21 +248,7 @@
request.Headers.Add(
Simias.Security.Web.AuthenticationService.Login.BasicEncodingHeader,
-#if MONO
- // bht: Fix for Bug 73324 - Client fails to authenticate if LDAP
- // username has an international character in it.
- //
- // Mono converts the username and password to a byte array
- // without paying attention to the encoding. In NLD, the
- // default encoding is UTF-8. Without this fix, we ended up
- // sending the username and password in 1252 but the server
- // was attempting to decode it as UTF-8. This fix forces the
- // username and password to be sent with Windows-1252 encoding
- // which properly gets decoded on the server.
- System.Text.Encoding.GetEncoding(1252).WebName );
-#else
- System.Text.Encoding.Default.WebName );
-#endif
+ System.Text.Encoding.UTF8.WebName );
request.Method = "POST";
request.ContentLength = 0;
@@ -553,8 +540,16 @@
domainServiceUrl = new Uri( tempUri.Uri , DomainServicePath );
}
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(user);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ encodedCredsByteArray = utf8Name.GetBytes(password);
+ string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
// Build a credential from the user name and password.
- NetworkCredential myCred = new NetworkCredential( user, password );
+ NetworkCredential myCred = new NetworkCredential( iFolderUserBase64, iFolderPassBase64 );
+ NetworkCredential myOldCred = new NetworkCredential( user, password );
// Create the domain service web client object.
DomainService domainService = new DomainService();
@@ -598,6 +593,11 @@
string baseUrl = domainServiceUrl.ToString();
baseUrl = baseUrl.Substring(0, baseUrl.LastIndexOf('/'));
+ // This flag is used to identify if server is old and not supporting multi byte login
+ // Then creds are sent with out encoding again.
+
+ bool oldServer = false;
+
//Login to the server mentioned by the user, possible the user is already provisioned and this is a different client that is creating an account
status =
this.Login(
@@ -608,12 +608,24 @@
if ((status.statusCode != SCodes.Success) && (status.statusCode != SCodes.SuccessInGrace) && (status.statusCode != SCodes.UserAlreadyMoved))
{
log.Debug("Got Status {0}", status.statusCode);
- return status;
+ if( status.statusCode == SCodes.InvalidCredentials )
+ {
+ // Post 3.8.0.2, multibyte char support for usernames and password is added
+ // If a new client is connecting to an old server, then auth will fail as creds
+ // are encoded. Hence we try once more without encoding the creds.
+ log.Debug("This might be old server 3.8.0.2 with no multi byte support, trying once more with out encoding the creds");
+ status = this.Login( new Uri( baseUrl ), domainID, myOldCred, false );
+ if ( status.statusCode == SCodes.Success || status.statusCode == SCodes.SuccessInGrace )
+ oldServer = true;
+ else
+ return status;
+ }
}
else
log.Debug("Got else Status {0}", status.statusCode);
// Get the Home Server.
+ domainService.Credentials = oldServer ? myOldCred : myCred ;
string hostID = null;
HostInfo hInfo = new HostInfo();
@@ -635,7 +647,7 @@
DomainService ds = new DomainService();
ds.CookieContainer = cookies;
ds.Url = (new Uri(masterServerURL.TrimEnd(new char[] { '/' }) + DomainService)).ToString();
- ds.Credentials = myCred;
+ ds.Credentials = oldServer ? myOldCred : myCred;
ds.PreAuthenticate = true;
// ds.Proxy = ProxyState.GetProxyState( domainServiceUrl );
ds.AllowAutoRedirect = true;
@@ -690,7 +702,7 @@
this.Login(
new Uri( hInfo.PublicAddress ),
domainID,
- myCred,
+ oldServer ? myOldCred : myCred,
false);
if ( ( status.statusCode != SCodes.Success ) && ( status.statusCode != SCodes.SuccessInGrace ) )
{
@@ -721,7 +733,7 @@
// Save the credentials
CredentialCache myCache = new CredentialCache();
- myCache.Add(new Uri(domainService.Url), "Basic", myCred);
+ myCache.Add(new Uri(domainService.Url), "Basic", oldServer ? myOldCred : myCred);
domainService.Credentials = myCache;
domainService.Timeout = 30000;
@@ -892,7 +904,22 @@
log.Debug( "Login - called" );
log.Debug( " DomainID: " + DomainID );
log.Debug( " Username: " + Username );
+
+ // This flag is used to identify if server is old and not supporting multi byte login
+ // Then creds are sent with out encoding again.
+
+ bool oldServer = false;
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(Username);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ encodedCredsByteArray = utf8Name.GetBytes(Password);
+ string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ NetworkCredential myCred = new NetworkCredential( iFolderUserBase64, iFolderPassBase64 );
+ NetworkCredential myOldCred = new NetworkCredential( Username, Password );
+
Simias.Authentication.Status status = null;
Domain cDomain = store.GetDomain( DomainID );
if ( cDomain != null )
@@ -911,7 +938,7 @@
this.Login(
tempUri.Uri,
DomainID,
- new NetworkCredential( Username, Password ),
+ myCred,
false );
if ( status.statusCode == SCodes.Success ||
@@ -921,16 +948,36 @@
new BasicCredentials(
DomainID,
DomainID,
- Username,
- Password );
+ iFolderUserBase64,
+ iFolderPassBase64 );
basic.Save( false );
SetDomainState( DomainID, true, true );
}
+ else
+ {
+ // Post 3.8.0.2, multibyte char support for usernames and password is added
+ // If a new client is connecting to an old server, then auth will fail as creds
+ // are encoded. Hence we try once more without encoding the creds.
+ log.Debug("possibly server is 3.8.0.2 not supporting multi byte,trying again without encoding creds ");
+ status = this.Login( tempUri.Uri, DomainID, myOldCred, false);
+ if ( status.statusCode == SCodes.Success || status.statusCode == SCodes.SuccessInGrace )
+ {
+ oldServer = true;
+ BasicCredentials basic =
+ new BasicCredentials(
+ DomainID,
+ DomainID,
+ Username,
+ Password);
+ basic.Save( false );
+ SetDomainState( DomainID, true, true);
+ }
+ }
if (status.statusCode == SCodes.UserAlreadyMoved && Password != null)
{
// Connect to master , and login to new server where user has been moved
- status = ProvisionToNewHomeServer(DomainID, new NetworkCredential(Username, Password));
+ status = ProvisionToNewHomeServer(DomainID, oldServer ? myOldCred : myCred);
return status;
}
}
Modified: branches/iFolder_3.8.0_updates/src/core/Sync/Http.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/Sync/Http.cs 2010-04-13 04:11:28 UTC (rev 7332)
+++ branches/iFolder_3.8.0_updates/src/core/Sync/Http.cs 2010-04-21 05:41:55 UTC (rev 7333)
@@ -294,7 +294,16 @@
WebHeaderCollection headers = request.Headers;
headers.Add(SyncHeaders.SyncVersion, HttpService.version);
headers.Add(SyncHeaders.Method, method.ToString());
- headers.Add(SyncHeaders.UserName, userName);
+ try {
+ headers.Add(SyncHeaders.UserName, userName);
+ }catch
+ {
+ // On Windows client, for some username with multi-byte chars,
+ // Exception occurs. However, we can ignore this as we would already
+ // have the user ID with us
+ log.Debug("Syncing multi byte char user name");
+ }
+
headers.Add(SyncHeaders.UserID, userID);
try {
//TODO: could be removed?
Modified: branches/iFolder_3.8.0_updates/src/server/Simias.Server/Authentication.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/server/Simias.Server/Authentication.cs 2010-04-13 04:11:28 UTC (rev 7332)
+++ branches/iFolder_3.8.0_updates/src/server/Simias.Server/Authentication.cs 2010-04-21 05:41:55 UTC (rev 7333)
@@ -36,6 +36,7 @@
using System.Reflection;
using System.Net;
using System.Web;
+using System.Text;
using System.Threading;
using Simias;
@@ -387,8 +388,8 @@
if ( credentials.Length == 2 )
{
- this.username = credentials[ 0 ];
- this.password = credentials[ 1 ];
+ this.username = DecodeCreds(credentials[ 0 ], encodingName);
+ this.password = DecodeCreds(credentials[ 1 ], encodingName);
this.authType = "basic";
returnStatus = true;
}
@@ -399,7 +400,30 @@
return returnStatus;
}
+
/// <summary>
+ /// Returns the decoded value of user creds if its encoded. Else will return the same [ Old Client ] .
+ /// </summary>
+ /// <returns>String - User Creds in String</returns>
+ private string DecodeCreds(string creds, string encodingName)
+ {
+ try
+ {
+ byte[] encodedCredsByteArray = Convert.FromBase64String(creds);
+ Encoding encoder = System.Text.Encoding.GetEncoding( encodingName );
+ return encoder.GetString(encodedCredsByteArray, 0, encodedCredsByteArray.Length);
+ }
+ catch(Exception ex)
+ {
+ // Exception occurs when we try to decode string which is not encoded
+ // TODO : Find the right exception and catch it.
+ return creds;
+ }
+
+ }
+
+
+ /// <summary>
/// Returns whether the object has credentials.
/// </summary>
/// <returns></returns>
@@ -454,7 +478,7 @@
defaultBasicEncodingName = Store.Config.Get( Storage.Domain.SectionName, Storage.Domain.Encoding );
if ( defaultBasicEncodingName == null )
{
- defaultBasicEncodingName = "iso-8859-1";
+ defaultBasicEncodingName = "utf-8";
}
store = Store.GetStore();
Modified: branches/iFolder_3.8.0_updates/src/webaccess/Login.aspx.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/webaccess/Login.aspx.cs 2010-04-13 04:11:28 UTC (rev 7332)
+++ branches/iFolder_3.8.0_updates/src/webaccess/Login.aspx.cs 2010-04-21 05:41:55 UTC (rev 7333)
@@ -450,9 +450,18 @@
loginUrl.Path = (new Uri(weblogin.Url)).PathAndQuery;
weblogin.Url = loginUrl.Uri.ToString();
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(username);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ encodedCredsByteArray = utf8Name.GetBytes(password);
+ string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+
+
// credentials
weblogin.PreAuthenticate = true;
- weblogin.Credentials = new NetworkCredential(username, password);
+ weblogin.Credentials = new NetworkCredential(iFolderUserBase64, iFolderPassBase64);
// cookies
weblogin.CookieContainer = new CookieContainer();
@@ -492,7 +501,7 @@
// credentials
web.PreAuthenticate = true;
- web.Credentials = new NetworkCredential(username, password);
+ web.Credentials = new NetworkCredential(iFolderUserBase64, iFolderPassBase64);
// cookies
web.CookieContainer = new CookieContainer();
@@ -524,9 +533,8 @@
iFolderServer server = web.GetHomeServer();
Session["Server"] = server;
- UTF8Encoding utf8Name = new UTF8Encoding();
- byte[] EncodedUserNameInByte = utf8Name.GetBytes(user.UserName);
- string iFolderUserBase64 = Convert.ToBase64String(EncodedUserNameInByte);
+ encodedCredsByteArray = utf8Name.GetBytes(user.UserName);
+ iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
// new username cookie for 30 days
Response.Cookies.Remove("username");
Modified: branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs 2010-04-13 04:11:28 UTC (rev 7332)
+++ branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs 2010-04-21 05:41:55 UTC (rev 7333)
@@ -890,7 +890,15 @@
DomainService domainService = new DomainService();
domainService.Url = MasterServer.PublicUrl + "/DomainService.asmx";
- domainService.Credentials = new NetworkCredential(username, password);
+
+ UTF8Encoding utf8Name = new UTF8Encoding();
+ byte[] encodedCredsByteArray = utf8Name.GetBytes(username);
+ string iFolderUserBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ encodedCredsByteArray = utf8Name.GetBytes(password);
+ string iFolderPassBase64 = Convert.ToBase64String(encodedCredsByteArray);
+
+ domainService.Credentials = new NetworkCredential(iFolderUserBase64, iFolderPassBase64);
domainService.PreAuthenticate = true;
publicUrl = domainService.GetHomeServer( username ).PublicAddress;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ra...@us...> - 2010-04-13 04:11:34
|
Revision: 7332
http://simias.svn.sourceforge.net/simias/?rev=7332&view=rev
Author: ravim85
Date: 2010-04-13 04:11:28 +0000 (Tue, 13 Apr 2010)
Log Message:
-----------
webaccess - iFolder ?\226?\128?\156Details?\226?\128?\157 page, the ?\226?\128?\156Access?\226?\128?\157 value was not
localized.
Modified Paths:
--------------
trunk/src/webaccess/Details.aspx.cs
Modified: trunk/src/webaccess/Details.aspx.cs
===================================================================
--- trunk/src/webaccess/Details.aspx.cs 2010-03-31 13:47:22 UTC (rev 7331)
+++ trunk/src/webaccess/Details.aspx.cs 2010-04-13 04:11:28 UTC (rev 7332)
@@ -206,7 +206,7 @@
propertyTable.Rows.Add(new object[] { GetString("DESCRIPTION"), ifolder.Description });
propertyTable.Rows.Add(new object[] { GetString("LASTMODIFIED"), WebUtility.FormatDate(ifolder.LastModified, rm) });
propertyTable.Rows.Add(new object[] { GetString("CREATED"), WebUtility.FormatDate(ifolder.Created, rm) });
- propertyTable.Rows.Add(new object[] { GetString("RIGHTS"), ifolder.MemberRights });
+ propertyTable.Rows.Add(new object[] { GetString("RIGHTS"), WebUtility.FormatRights(ifolder.MemberRights, rm) });
propertyTable.Rows.Add(new object[] { GetString("OWNER"), ifolder.OwnerFullName });
propertyTable.Rows.Add(new object[] { GetString("SIZE"), WebUtility.FormatSize(ifolder.Size, rm) });
propertyTable.Rows.Add(new object[] { GetString("MEMBERS"), ifolder.MemberCount.ToString() });
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2010-03-31 04:45:53
|
Revision: 7330
http://simias.svn.sourceforge.net/simias/?rev=7330&view=rev
Author: jshaju
Date: 2010-03-31 04:45:46 +0000 (Wed, 31 Mar 2010)
Log Message:
-----------
ID: FATE#308712
Reviewer: GG
Localization Required: Yes
Documentation Required: No
Description: Added a new help file for upgrading slave to master
Added Paths:
-----------
trunk/src/admin/help/en/changemaster.html
Added: trunk/src/admin/help/en/changemaster.html
===================================================================
--- trunk/src/admin/help/en/changemaster.html (rev 0)
+++ trunk/src/admin/help/en/changemaster.html 2010-03-31 04:45:46 UTC (rev 7330)
@@ -0,0 +1,110 @@
+<html>
+
+ <head>
+ <meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
+
+ <!-- Novell iFolder 3.x iManager Plugin -->
+
+ <title>iFolder Servers</title>
+
+ <!-- Metadata -->
+
+ <meta name="Author" content="iFolder 3.x Documentation Manager">
+ <meta name="date" content="02-17-2005">
+ <meta name="modified" content="06-29-2005">
+
+ <!-- iManager Documentation Stylesheet -->
+
+ <link rel="stylesheet" href="hf_style.css" type="text/css">
+
+ <!-- Style definitions for this Help page: body plus help banner layer
+ and help content layer. The style definition is commented to prevent
+ older browsers from presenting the style information as part of the
+ page itself.
+ -->
+
+
+<style type= "text/css" media="screen">
+ <!--
+
+ body { font-family: Arial, Helvetica, Geneva;
+ background: white
+url(../../images/helphead_bg.gif) repeat-x 0% 0% }
+
+ #headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px;
+ width: 380px; visibility: visible }
+
+ #helpcontent { position: absolute; top: 37px; left: 10px;
+ width: 93%; visibility: visible }
+
+ -->
+ </style>
+
+
+
+
+</head>
+
+ <!-- This is the start of the body. It underlays the help banner layer
+ and help content layers. -->
+
+ <body bgcolor="white" marginwidth="0" marginheight="0"
+ leftmargin="0" topmargin="0">
+<!-- This is the start of the Help Banner Layer --> <div id="headgraphic"> <img src="../../images/h1_help.gif" width="380" height="32" border="0"></div><!-- This is end of the Help Banner Layer -->
+<!-- This is the start of the Help Content Layer --> <div id="helpcontent"> <!-- The Page Heading uses CSS style "head3b". This creates an H3 header
+ with a line beneath it.
+ -->
+ <h3 class="head3b">Upgrading a Slave Server to a Master Server</h3>
+ <p> Use this interface to upgrade a slave server to be a master server.
+ The search functionality enables you to locate the server you want to upgrade. </p>
+ <H4><A NAME="browse"></A> Searching iFolder Servers</H4>
+ <OL>
+ <LI>
+ <P>Select a filter criterion (Contains, Begins With, Ends With, Equals).</P>
+ </LI>
+ <LI>
+ <P>Select one or more of the following search methods:</P>
+ <UL>
+ <LI>
+ <P>Type the name of the server in the Search Servers field.</P>
+ </LI>
+ <LI>
+ <P>Type one or more letters in the Search Servers field.</P>
+ </LI>
+ <LI>
+ <P>Type an asterisk (*) in the Search Servers field to return a list
+ of all Servers on the system.</P>
+ </LI>
+ <LI>
+ <P>Leave the Search Servers field empty to return a list of all Servers
+ on the system.</P>
+ </LI>
+ </UL>
+ </LI>
+ <LI>Click Search.
+ </OL>
+
+
+ <h4><a name="accessusers"></a> Upgrading a Slave to a Master</h4>
+ <ol><li>
+ <p>On the Change Master page, use the search mechanism to locate the slave server that you want to upgrade to be a master server.</p>
+ </li>
+ <li>
+ <p>In the list of servers, click the Upgrade to Server button for the server that you want to upgrade.</p><p> </p>
+ </li>
+ </ol>
+<P><A HREF="#top" TARGET="_self"><IMG SRC="../../images/goto_top.gif" WIDTH="19" HEIGHT="19" BORDER="0" ALT="Go to top"></A></P>
+
+ <H4 CLASS="ruleabove"><IMG SRC="../../images/xrefbtn.gif" WIDTH="16" HEIGHT="16" ALT="Related Topics" align="top">
+Related Topics</H4>
+
+ <BLOCKQUOTE class="task1"><P><A HREF="serverdetails.html">Server Details
+</A><BR><A HREF="reports.html">Reports
+</A><BR><A HREF="ifolderdetails.html">Managing iFolder Details</A></P></BLOCKQUOTE><P><A HREF="#top" TARGET="_self"><IMG SRC="../../images/goto_top.gif" WIDTH="19" HEIGHT="19" BORDER="0" ALT="Go to top"></A></P><P> </P><P CLASS="copyright">A
+trademark symbol (<SUP><SMALL>®</SMALL></SUP>, <SUP><SMALL>TM</SMALL></SUP>,
+etc.) denotes a Novell trademark. An asterisk (*) denotes a third-party trademark.
+For more information, see <A HREF="imgr_legalnotices.html" TARGET="_self" ><font color="#cfcdc6">Legal
+Notices</font></A>.</P></div><!-- This is the end of the Help Content layer. -->
+</body>
+
+</html>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-03-10 10:36:42
|
Revision: 7329
http://simias.svn.sourceforge.net/simias/?rev=7329&view=rev
Author: hegdegg
Date: 2010-03-10 10:36:33 +0000 (Wed, 10 Mar 2010)
Log Message:
-----------
Fixed the typo in the path
Modified Paths:
--------------
trunk/src/server/setup/iFolderWebSetup.cs
Modified: trunk/src/server/setup/iFolderWebSetup.cs
===================================================================
--- trunk/src/server/setup/iFolderWebSetup.cs 2010-03-10 10:35:45 UTC (rev 7328)
+++ trunk/src/server/setup/iFolderWebSetup.cs 2010-03-10 10:36:33 UTC (rev 7329)
@@ -148,7 +148,7 @@
try
{
string MachineArch = Environment.GetEnvironmentVariable("HOSTTYPE");
- string webpath = (MachineArch.IndexOf("_64") > 0) ? Path.GetFullPath("../lib64/simias/web"): Path.GetFullPath("../lib/simiasweb");
+ string webpath = (MachineArch.IndexOf("_64") > 0) ? Path.GetFullPath("../lib64/simias/web"): Path.GetFullPath("../lib/simias/web");
string webconfigfile = Path.Combine(webpath, "web.config");
if (Execute("chown", "{0}:{1} {2}", apacheUser.Value, apacheGroup.Value, webconfigfile) != 0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-03-10 10:36:42
|
Revision: 7328
http://simias.svn.sourceforge.net/simias/?rev=7328&view=rev
Author: hegdegg
Date: 2010-03-10 10:35:45 +0000 (Wed, 10 Mar 2010)
Log Message:
-----------
Correcting the typo in the path.
Modified Paths:
--------------
branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs
Modified: branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs 2010-03-10 06:18:57 UTC (rev 7327)
+++ branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs 2010-03-10 10:35:45 UTC (rev 7328)
@@ -148,7 +148,7 @@
try
{
string MachineArch = Environment.GetEnvironmentVariable("HOSTTYPE");
- string webpath = (MachineArch.IndexOf("_64") > 0) ? Path.GetFullPath("../lib64/simias/web"): Path.GetFullPath("../lib/simiasweb");
+ string webpath = (MachineArch.IndexOf("_64") > 0) ? Path.GetFullPath("../lib64/simias/web"): Path.GetFullPath("../lib/simias/web");
string webconfigfile = Path.Combine(webpath, "web.config");
if (Execute("chown", "{0}:{1} {2}", apacheUser.Value, apacheGroup.Value, webconfigfile) != 0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-03-10 06:19:04
|
Revision: 7327
http://simias.svn.sourceforge.net/simias/?rev=7327&view=rev
Author: hegdegg
Date: 2010-03-10 06:18:57 +0000 (Wed, 10 Mar 2010)
Log Message:
-----------
Error handling for admin setup. Fixed the check of incorrect env
variable to decide the os architecture.
Modified Paths:
--------------
trunk/src/server/setup/iFolderWebSetup.cs
trunk/src/webservices/iFolderServer.cs
Modified: trunk/src/server/setup/iFolderWebSetup.cs
===================================================================
--- trunk/src/server/setup/iFolderWebSetup.cs 2010-03-10 06:10:38 UTC (rev 7326)
+++ trunk/src/server/setup/iFolderWebSetup.cs 2010-03-10 06:18:57 UTC (rev 7327)
@@ -145,13 +145,21 @@
/// </summary>
void UpdateOwnership()
{
- string MachineArch = Environment.GetEnvironmentVariable("OS_TYPE");
- string webpath = (MachineArch.IndexOf("_64") > 0) ? Path.GetFullPath("../lib64/simias/web"): Path.GetFullPath("../lib/simiasweb");
- string webconfigfile = Path.Combine(webpath, "web.config");
+ try
+ {
+ string MachineArch = Environment.GetEnvironmentVariable("HOSTTYPE");
+ string webpath = (MachineArch.IndexOf("_64") > 0) ? Path.GetFullPath("../lib64/simias/web"): Path.GetFullPath("../lib/simiasweb");
+ string webconfigfile = Path.Combine(webpath, "web.config");
- if (Execute("chown", "{0}:{1} {2}", apacheUser.Value, apacheGroup.Value, webconfigfile) != 0)
+ if (Execute("chown", "{0}:{1} {2}", apacheUser.Value, apacheGroup.Value, webconfigfile) != 0)
+ {
+ throw new Exception("Unable to set an owner for the web.config file.");
+ }
+ }
+ catch (Exception ex)
{
- throw new Exception("Unable to set an owner for the log path.");
+ Console.WriteLine("Unable to set an owner for web.config file");
+
}
}
Modified: trunk/src/webservices/iFolderServer.cs
===================================================================
--- trunk/src/webservices/iFolderServer.cs 2010-03-10 06:10:38 UTC (rev 7326)
+++ trunk/src/webservices/iFolderServer.cs 2010-03-10 06:18:57 UTC (rev 7327)
@@ -800,7 +800,7 @@
{
if (masterAddress.ToLower().StartsWith(Uri.UriSchemeHttps))
{
- string machineArch = Environment.GetEnvironmentVariable("OS_TYPE");
+ string machineArch = Environment.GetEnvironmentVariable("HOSTTYPE");
string webPath = ( machineArch.IndexOf("_64" ) > 0 ? Path.GetFullPath("../../../../lib64/simias/web"): Path.GetFullPath("../../../../lib/simias/web"));
// swap policy
ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-03-10 06:10:45
|
Revision: 7326
http://simias.svn.sourceforge.net/simias/?rev=7326&view=rev
Author: hegdegg
Date: 2010-03-10 06:10:38 +0000 (Wed, 10 Mar 2010)
Log Message:
-----------
Error handling for admin setup. Fixed the check of incorrect environment
variable to decide the os architecture.
Modified Paths:
--------------
branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs
branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs
Modified: branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs 2010-03-10 03:27:52 UTC (rev 7325)
+++ branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs 2010-03-10 06:10:38 UTC (rev 7326)
@@ -145,13 +145,21 @@
/// </summary>
void UpdateOwnership()
{
- string MachineArch = Environment.GetEnvironmentVariable("OS_TYPE");
- string webpath = (MachineArch.IndexOf("_64") > 0) ? Path.GetFullPath("../lib64/simias/web"): Path.GetFullPath("../lib/simiasweb");
- string webconfigfile = Path.Combine(webpath, "web.config");
+ try
+ {
+ string MachineArch = Environment.GetEnvironmentVariable("HOSTTYPE");
+ string webpath = (MachineArch.IndexOf("_64") > 0) ? Path.GetFullPath("../lib64/simias/web"): Path.GetFullPath("../lib/simiasweb");
+ string webconfigfile = Path.Combine(webpath, "web.config");
- if (Execute("chown", "{0}:{1} {2}", apacheUser.Value, apacheGroup.Value, webconfigfile) != 0)
+ if (Execute("chown", "{0}:{1} {2}", apacheUser.Value, apacheGroup.Value, webconfigfile) != 0)
+ {
+ throw new Exception("Unable to set an owner for the web.config file.");
+ }
+ }
+ catch (Exception ex)
{
- throw new Exception("Unable to set an owner for the log path.");
+ Console.WriteLine("Unable to set an owner for web.config file");
+
}
}
Modified: branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs 2010-03-10 03:27:52 UTC (rev 7325)
+++ branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs 2010-03-10 06:10:38 UTC (rev 7326)
@@ -800,7 +800,7 @@
{
if (masterAddress.ToLower().StartsWith(Uri.UriSchemeHttps))
{
- string machineArch = Environment.GetEnvironmentVariable("OS_TYPE");
+ string machineArch = Environment.GetEnvironmentVariable("HOSTTYPE");
string webPath = ( machineArch.IndexOf("_64" ) > 0 ? Path.GetFullPath("../../../../lib64/simias/web"): Path.GetFullPath("../../../../lib/simias/web"));
// swap policy
ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-03-10 03:27:58
|
Revision: 7325
http://simias.svn.sourceforge.net/simias/?rev=7325&view=rev
Author: hegdegg
Date: 2010-03-10 03:27:52 +0000 (Wed, 10 Mar 2010)
Log Message:
-----------
Version update in version.config file for Windows clients autoupgrade.
Modified Paths:
--------------
branches/iFolder_3.8.0_updates/src/server/Simias.ClientUpdate/version.config
Modified: branches/iFolder_3.8.0_updates/src/server/Simias.ClientUpdate/version.config
===================================================================
--- branches/iFolder_3.8.0_updates/src/server/Simias.ClientUpdate/version.config 2010-03-10 03:22:28 UTC (rev 7324)
+++ branches/iFolder_3.8.0_updates/src/server/Simias.ClientUpdate/version.config 2010-03-10 03:27:52 UTC (rev 7325)
@@ -4,15 +4,15 @@
with the one specified here by 'filename'. -->
<versioninfo>
<distribution match="windows32">
- <version>3.8.0.1</version>
+ <version>3.8.0.2</version>
<filename>ifolder3-windows.exe</filename>
</distribution>
<distribution match="windows64">
- <version>3.8.0.1</version>
+ <version>3.8.0.2</version>
<filename>ifolder3-windows-x64.exe</filename>
</distribution>
<distribution match="DEFAULT">
- <version>3.8.0.1</version>
+ <version>3.8.0.2</version>
<filename>ifolder3-windows.exe</filename>
</distribution>
</versioninfo>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-03-10 03:22:35
|
Revision: 7324
http://simias.svn.sourceforge.net/simias/?rev=7324&view=rev
Author: hegdegg
Date: 2010-03-10 03:22:28 +0000 (Wed, 10 Mar 2010)
Log Message:
-----------
Version bump for iFolder Windows Clients.
Modified Paths:
--------------
branches/iFolder_3.8.0_updates/src/core/FlaimProvider/FlaimWrapper/FlaimWrapper.vcproj
branches/iFolder_3.8.0_updates/src/core/POBoxWS/Properties/AssemblyInfo.cs
branches/iFolder_3.8.0_updates/src/core/Properties/AssemblyInfo.cs
branches/iFolder_3.8.0_updates/src/core/SimiasApp/Properties/AssemblyInfo.cs
branches/iFolder_3.8.0_updates/src/core/SimiasClient/Properties/AssemblyInfo.cs
branches/iFolder_3.8.0_updates/src/core/SyncService/Properties/AssemblyInfo.cs
branches/iFolder_3.8.0_updates/src/core/WebService/Properties/AssemblyInfo.cs
Modified: branches/iFolder_3.8.0_updates/src/core/FlaimProvider/FlaimWrapper/FlaimWrapper.vcproj
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/FlaimProvider/FlaimWrapper/FlaimWrapper.vcproj 2010-03-03 11:59:46 UTC (rev 7323)
+++ branches/iFolder_3.8.0_updates/src/core/FlaimProvider/FlaimWrapper/FlaimWrapper.vcproj 2010-03-10 03:22:28 UTC (rev 7324)
@@ -84,7 +84,7 @@
Name="VCLinkerTool"
AdditionalDependencies="rpcrt4.lib ws2_32.lib odbc32.lib odbccp32.lib flaim.lib msvcrt.lib"
OutputFile=".\Release/FlaimWrapper.dll"
- Version="3.8.0.1"
+ Version="3.8.0.2"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""$(SolutionDir)..\..\dependencies\external\libflaim\win32""
@@ -186,7 +186,7 @@
Name="VCLinkerTool"
AdditionalDependencies="rpcrt4.lib ws2_32.lib odbc32.lib odbccp32.lib dbghelp.lib flaim.lib flaimtk.lib msvcrt.lib"
OutputFile=".\Release/FlaimWrapper.dll"
- Version="3.8.0.1"
+ Version="3.8.0.2"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories=""$(SolutionDir)..\..\dependencies\external\libflaim\win64""
Modified: branches/iFolder_3.8.0_updates/src/core/POBoxWS/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/POBoxWS/Properties/AssemblyInfo.cs 2010-03-03 11:59:46 UTC (rev 7323)
+++ branches/iFolder_3.8.0_updates/src/core/POBoxWS/Properties/AssemblyInfo.cs 2010-03-10 03:22:28 UTC (rev 7324)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.1")]
-[assembly: AssemblyFileVersion("3.8.0.1")]
+[assembly: AssemblyVersion("3.8.0.2")]
+[assembly: AssemblyFileVersion("3.8.0.2")]
Modified: branches/iFolder_3.8.0_updates/src/core/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/Properties/AssemblyInfo.cs 2010-03-03 11:59:46 UTC (rev 7323)
+++ branches/iFolder_3.8.0_updates/src/core/Properties/AssemblyInfo.cs 2010-03-10 03:22:28 UTC (rev 7324)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.1")]
-[assembly: AssemblyFileVersion("3.8.0.1")]
+[assembly: AssemblyVersion("3.8.0.2")]
+[assembly: AssemblyFileVersion("3.8.0.2")]
Modified: branches/iFolder_3.8.0_updates/src/core/SimiasApp/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/SimiasApp/Properties/AssemblyInfo.cs 2010-03-03 11:59:46 UTC (rev 7323)
+++ branches/iFolder_3.8.0_updates/src/core/SimiasApp/Properties/AssemblyInfo.cs 2010-03-10 03:22:28 UTC (rev 7324)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.1")]
-[assembly: AssemblyFileVersion("3.8.0.1")]
+[assembly: AssemblyVersion("3.8.0.2")]
+[assembly: AssemblyFileVersion("3.8.0.2")]
Modified: branches/iFolder_3.8.0_updates/src/core/SimiasClient/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/SimiasClient/Properties/AssemblyInfo.cs 2010-03-03 11:59:46 UTC (rev 7323)
+++ branches/iFolder_3.8.0_updates/src/core/SimiasClient/Properties/AssemblyInfo.cs 2010-03-10 03:22:28 UTC (rev 7324)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.1")]
-[assembly: AssemblyFileVersion("3.8.0.1")]
+[assembly: AssemblyVersion("3.8.0.2")]
+[assembly: AssemblyFileVersion("3.8.0.2")]
Modified: branches/iFolder_3.8.0_updates/src/core/SyncService/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/SyncService/Properties/AssemblyInfo.cs 2010-03-03 11:59:46 UTC (rev 7323)
+++ branches/iFolder_3.8.0_updates/src/core/SyncService/Properties/AssemblyInfo.cs 2010-03-10 03:22:28 UTC (rev 7324)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.1")]
-[assembly: AssemblyFileVersion("3.8.0.1")]
+[assembly: AssemblyVersion("3.8.0.2")]
+[assembly: AssemblyFileVersion("3.8.0.2")]
Modified: branches/iFolder_3.8.0_updates/src/core/WebService/Properties/AssemblyInfo.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/core/WebService/Properties/AssemblyInfo.cs 2010-03-03 11:59:46 UTC (rev 7323)
+++ branches/iFolder_3.8.0_updates/src/core/WebService/Properties/AssemblyInfo.cs 2010-03-10 03:22:28 UTC (rev 7324)
@@ -29,5 +29,5 @@
// Build Number
// Revision
//
-[assembly: AssemblyVersion("3.8.0.1")]
-[assembly: AssemblyFileVersion("3.8.0.1")]
+[assembly: AssemblyVersion("3.8.0.2")]
+[assembly: AssemblyFileVersion("3.8.0.2")]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sp...@us...> - 2010-03-03 11:59:53
|
Revision: 7323
http://simias.svn.sourceforge.net/simias/?rev=7323&view=rev
Author: spkumar
Date: 2010-03-03 11:59:46 +0000 (Wed, 03 Mar 2010)
Log Message:
-----------
Bug#581254 - Unable to Launch iFolder Client
Modified Paths:
--------------
trunk/configure.in
trunk/package/linux/simias.spec.autobuild
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2010-03-02 05:52:06 UTC (rev 7322)
+++ trunk/configure.in 2010-03-03 11:59:46 UTC (rev 7323)
@@ -301,7 +301,13 @@
STORELIB_PATH="$EXTERNAL_DIR/sqlite/darwin"
LDOUT='-o '
AC_PROG_CXX(am__fastdepCXX)
- AC_CHECK_PROG(CXX, g++, g++)
+ #AC_CHECK_PROG(CXX, g++, g++)
+ if test "$runasclient" = "TRUE"; then
+ AC_PROG_CXX([ g++-4.3 g++ ])
+ else
+ AC_PROG_CXX([ g++ ])
+ fi
+
# AC_CHECK_PROG(CXX, g++-3.3, g++-3.3)
# LD='$(CXX) -dynamiclib '
StoreProviderAssembly="SimiasLib.dll"
Modified: trunk/package/linux/simias.spec.autobuild
===================================================================
--- trunk/package/linux/simias.spec.autobuild 2010-03-02 05:52:06 UTC (rev 7322)
+++ trunk/package/linux/simias.spec.autobuild 2010-03-03 11:59:46 UTC (rev 7323)
@@ -22,7 +22,7 @@
BuildRequires: compat-libstdc++ e2fsprogs e2fsprogs-devel gcc-c++ gconf2 glib2 glib2-devel novell-ifolder-libflaim novell-ifolder-libflaim-devel libstdc++ libstdc++-devel libxml2 libxml2-devel mono-core mono-data mono-devel mono-web pkgconfig xsp log4net
%else
%ifarch x86_64
-BuildRequires: e2fsprogs e2fsprogs-devel gcc-c++ gconf2 glib2 glib2-devel libflaim libflaim-devel libstdc++33-32bit libstdc++33-devel-32bit libxml2 libxml2-devel mono-core mono-data mono-devel mono-web pkgconfig xsp log4net ncurses-devel dos2unix
+BuildRequires: e2fsprogs e2fsprogs-devel gcc43-c++ gcc43 gcc-c++ gconf2 glib2 glib2-devel libflaim libflaim-devel libstdc++33-32bit libstdc++33-devel-32bit libxml2 libxml2-devel mono-core mono-data mono-devel mono-web pkgconfig xsp log4net ncurses-devel dos2unix
%else
BuildRequires: e2fsprogs e2fsprogs-devel gcc-c++ gconf2 glib2 glib2-devel libflaim libflaim-devel libstdc++33 libstdc++33-devel libxml2 libxml2-devel mono-core mono-data mono-devel mono-web pkgconfig xsp log4net ncurses-devel dos2unix
%endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sb...@us...> - 2010-03-02 05:52:13
|
Revision: 7322
http://simias.svn.sourceforge.net/simias/?rev=7322&view=rev
Author: sbipin
Date: 2010-03-02 05:52:06 +0000 (Tue, 02 Mar 2010)
Log Message:
-----------
Submission done for March 2010 patch.
Added Paths:
-----------
tags/iFolder_3.8.0_mar2010_patch/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-02-28 06:31:13
|
Revision: 7321
http://simias.svn.sourceforge.net/simias/?rev=7321&view=rev
Author: hegdegg
Date: 2010-02-28 06:31:06 +0000 (Sun, 28 Feb 2010)
Log Message:
-----------
While changing public and private url on the server apart from updating
config files update simias too.
Modified Paths:
--------------
trunk/src/server/setup/iFolderWebSetup.cs
trunk/src/webservices/iFolderServer.cs
Modified: trunk/src/server/setup/iFolderWebSetup.cs
===================================================================
--- trunk/src/server/setup/iFolderWebSetup.cs 2010-02-28 06:24:36 UTC (rev 7320)
+++ trunk/src/server/setup/iFolderWebSetup.cs 2010-02-28 06:31:06 UTC (rev 7321)
@@ -135,10 +135,30 @@
SetupModMono();
#endif
SetupSsl();
-
+
+ UpdateOwnership();
// CheckConnection();
}
+ /// <summary>
+ /// Change the ownership of web.config to apache user so that iFolder
+ /// server can chnage the values while running.
+ /// </summary>
+ void UpdateOwnership()
+ {
+ string MachineArch = Environment.GetEnvironmentVariable("OS_TYPE");
+ string webpath = (MachineArch.IndexOf("_64") > 0) ? Path.GetFullPath("../lib64/simias/web"): Path.GetFullPath("../lib/simiasweb");
+ string webconfigfile = Path.Combine(webpath, "web.config");
+ if (Execute("chown", "{0}:{1} {2}", apacheUser.Value, apacheGroup.Value, webconfigfile) != 0)
+ {
+ throw new Exception("Unable to set an owner for the log path.");
+ }
+ }
+
+ /// <summary>
+ /// Initialize web-access setup
+ /// </summary>
+
/// <summary>
/// Initialize web-access setup
/// </summary>
Modified: trunk/src/webservices/iFolderServer.cs
===================================================================
--- trunk/src/webservices/iFolderServer.cs 2010-02-28 06:24:36 UTC (rev 7320)
+++ trunk/src/webservices/iFolderServer.cs 2010-02-28 06:31:06 UTC (rev 7321)
@@ -586,7 +586,7 @@
bool UpdateStatus = false;
string ServerSection="Server";
string PublicAddressKey = "PublicAddress";
- string PrivateAddressKey = "PrivateAddress";
+ string PrivateAddressKey = "PrivateAddress";
string MasterAddressKey = "MasterAddress";
if (!privateUrl.ToLower().StartsWith(Uri.UriSchemeHttp))
{
@@ -596,12 +596,15 @@
{
publicUrl = (new UriBuilder(Uri.UriSchemeHttp, publicUrl)).ToString();
}
+ if (MasterUrl != null && !privateUrl.ToLower().StartsWith(Uri.UriSchemeHttp))
+ {
+ MasterUrl = (new UriBuilder(Uri.UriSchemeHttp, MasterUrl)).ToString();
+ }
// adding /simias10
privateUrl = AddVirtualPath( privateUrl );
publicUrl = AddVirtualPath( publicUrl );
-
-
+
string SimiasConfigFilePath = Path.Combine ( Store.StorePath, "Simias.config");
if ( File.Exists( Path.Combine( Store.StorePath, Simias.Configuration.DefaultConfigFileName ) ) == true )
{
@@ -618,6 +621,7 @@
XmlDocument document = new XmlDocument();
document.Load(SimiasConfigFilePath );
+
SetConfigValue( document, ServerSection, PublicAddressKey, publicUrl );
SetConfigValue( document, ServerSection, PrivateAddressKey, privateUrl );
if(MasterUrl != "")
@@ -626,6 +630,12 @@
UpdateStatus = SetConfigValueWithSSL( document, ServerSection, MasterAddressKey, MasterUrl );
if(UpdateStatus == false)
return false;
+ if (MasterUrl != null)
+ {
+ UpdateStatus = UpdateMasterURL(MasterUrl);
+ if(UpdateStatus == false)
+ return false;
+ }
}
// Commit the config file changes.
@@ -636,8 +646,52 @@
{
SmartException.Throw(ex);
}
+ // Also update in the simias.
+ SetOnMasterUpdateUri(RemoveVirtualPath(privateUrl), RemoveVirtualPath(publicUrl));
+
return UpdateStatus;
}
+ /// <summary>
+ /// Update the Master Url in the local store
+ /// </summary>
+ /// <param name="masterUrl">
+ /// A <see cref="System.String"/>
+ /// </param>
+ /// /// <returns>
+ /// A <see cref="System.Boolean"/>
+ /// </returns>
+ private static bool UpdateMasterURL( string masterUrl)
+ {
+ bool retVal = true;;
+ try
+ {
+ Store store = Store.GetStore();
+ Domain domain = store.GetDomain(store.DefaultDomain);
+ HostNode masterNode = HostNode.GetMaster(domain.ID);
+ masterNode.PrivateUrl = masterUrl;
+ domain.Commit(masterNode);
+ }
+ catch (Exception ex)
+ {
+ log.Debug("Exception in UpdateMasterURL" + ex.Message);
+ retVal = false;
+ }
+ return retVal;
+ }
+ /// <summary>
+ /// Adds simias10 into the path
+ /// </summary>
+ /// <param name="path"></param>
+ /// <returns>new path</returns>
+ private static string RemoveVirtualPath(string path)
+ {
+ path = path.TrimEnd('/');
+ if(path.EndsWith("/simias10") == true)
+ {
+ path = path.Substring(0, path.IndexOf("simias10"));
+ }
+ return path;
+ }
/// <summary>
/// Adds simias10 into the path
@@ -746,7 +800,8 @@
{
if (masterAddress.ToLower().StartsWith(Uri.UriSchemeHttps))
{
- string webPath = Path.GetFullPath("../../../../lib/simias/web");
+ string machineArch = Environment.GetEnvironmentVariable("OS_TYPE");
+ string webPath = ( machineArch.IndexOf("_64" ) > 0 ? Path.GetFullPath("../../../../lib64/simias/web"): Path.GetFullPath("../../../../lib/simias/web"));
// swap policy
ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-02-28 06:24:42
|
Revision: 7320
http://simias.svn.sourceforge.net/simias/?rev=7320&view=rev
Author: hegdegg
Date: 2010-02-28 06:24:36 +0000 (Sun, 28 Feb 2010)
Log Message:
-----------
When the ip address is changed from web console, apart from saving it in
the config file its also updated into simias.
Modified Paths:
--------------
branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs
branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs
Modified: branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs 2010-02-28 05:28:55 UTC (rev 7319)
+++ branches/iFolder_3.8.0_updates/src/server/setup/iFolderWebSetup.cs 2010-02-28 06:24:36 UTC (rev 7320)
@@ -135,10 +135,30 @@
SetupModMono();
#endif
SetupSsl();
-
+
+ UpdateOwnership();
// CheckConnection();
}
+ /// <summary>
+ /// Change the ownership of web.config to apache user so that iFolder
+ /// server can chnage the values while running.
+ /// </summary>
+ void UpdateOwnership()
+ {
+ string MachineArch = Environment.GetEnvironmentVariable("OS_TYPE");
+ string webpath = (MachineArch.IndexOf("_64") > 0) ? Path.GetFullPath("../lib64/simias/web"): Path.GetFullPath("../lib/simiasweb");
+ string webconfigfile = Path.Combine(webpath, "web.config");
+ if (Execute("chown", "{0}:{1} {2}", apacheUser.Value, apacheGroup.Value, webconfigfile) != 0)
+ {
+ throw new Exception("Unable to set an owner for the log path.");
+ }
+ }
+
+ /// <summary>
+ /// Initialize web-access setup
+ /// </summary>
+
/// <summary>
/// Initialize web-access setup
/// </summary>
Modified: branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs
===================================================================
--- branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs 2010-02-28 05:28:55 UTC (rev 7319)
+++ branches/iFolder_3.8.0_updates/src/webservices/iFolderServer.cs 2010-02-28 06:24:36 UTC (rev 7320)
@@ -586,7 +586,7 @@
bool UpdateStatus = false;
string ServerSection="Server";
string PublicAddressKey = "PublicAddress";
- string PrivateAddressKey = "PrivateAddress";
+ string PrivateAddressKey = "PrivateAddress";
string MasterAddressKey = "MasterAddress";
if (!privateUrl.ToLower().StartsWith(Uri.UriSchemeHttp))
{
@@ -596,12 +596,15 @@
{
publicUrl = (new UriBuilder(Uri.UriSchemeHttp, publicUrl)).ToString();
}
+ if (MasterUrl != null && !privateUrl.ToLower().StartsWith(Uri.UriSchemeHttp))
+ {
+ MasterUrl = (new UriBuilder(Uri.UriSchemeHttp, MasterUrl)).ToString();
+ }
// adding /simias10
privateUrl = AddVirtualPath( privateUrl );
publicUrl = AddVirtualPath( publicUrl );
-
-
+
string SimiasConfigFilePath = Path.Combine ( Store.StorePath, "Simias.config");
if ( File.Exists( Path.Combine( Store.StorePath, Simias.Configuration.DefaultConfigFileName ) ) == true )
{
@@ -618,6 +621,7 @@
XmlDocument document = new XmlDocument();
document.Load(SimiasConfigFilePath );
+
SetConfigValue( document, ServerSection, PublicAddressKey, publicUrl );
SetConfigValue( document, ServerSection, PrivateAddressKey, privateUrl );
if(MasterUrl != "")
@@ -626,6 +630,12 @@
UpdateStatus = SetConfigValueWithSSL( document, ServerSection, MasterAddressKey, MasterUrl );
if(UpdateStatus == false)
return false;
+ if (MasterUrl != null)
+ {
+ UpdateStatus = UpdateMasterURL(MasterUrl);
+ if(UpdateStatus == false)
+ return false;
+ }
}
// Commit the config file changes.
@@ -636,8 +646,52 @@
{
SmartException.Throw(ex);
}
+ // Also update in the simias.
+ SetOnMasterUpdateUri(RemoveVirtualPath(privateUrl), RemoveVirtualPath(publicUrl));
+
return UpdateStatus;
}
+ /// <summary>
+ /// Update the Master Url in the local store
+ /// </summary>
+ /// <param name="masterUrl">
+ /// A <see cref="System.String"/>
+ /// </param>
+ /// /// <returns>
+ /// A <see cref="System.Boolean"/>
+ /// </returns>
+ private static bool UpdateMasterURL( string masterUrl)
+ {
+ bool retVal = true;;
+ try
+ {
+ Store store = Store.GetStore();
+ Domain domain = store.GetDomain(store.DefaultDomain);
+ HostNode masterNode = HostNode.GetMaster(domain.ID);
+ masterNode.PrivateUrl = masterUrl;
+ domain.Commit(masterNode);
+ }
+ catch (Exception ex)
+ {
+ log.Debug("Exception in UpdateMasterURL" + ex.Message);
+ retVal = false;
+ }
+ return retVal;
+ }
+ /// <summary>
+ /// Adds simias10 into the path
+ /// </summary>
+ /// <param name="path"></param>
+ /// <returns>new path</returns>
+ private static string RemoveVirtualPath(string path)
+ {
+ path = path.TrimEnd('/');
+ if(path.EndsWith("/simias10") == true)
+ {
+ path = path.Substring(0, path.IndexOf("simias10"));
+ }
+ return path;
+ }
/// <summary>
/// Adds simias10 into the path
@@ -746,7 +800,8 @@
{
if (masterAddress.ToLower().StartsWith(Uri.UriSchemeHttps))
{
- string webPath = Path.GetFullPath("../../../../lib/simias/web");
+ string machineArch = Environment.GetEnvironmentVariable("OS_TYPE");
+ string webPath = ( machineArch.IndexOf("_64" ) > 0 ? Path.GetFullPath("../../../../lib64/simias/web"): Path.GetFullPath("../../../../lib/simias/web"));
// swap policy
ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <he...@us...> - 2010-02-28 05:29:02
|
Revision: 7319
http://simias.svn.sourceforge.net/simias/?rev=7319&view=rev
Author: hegdegg
Date: 2010-02-28 05:28:55 +0000 (Sun, 28 Feb 2010)
Log Message:
-----------
While calculating the diskquota, if the file is already existsing,
subtract the exisintg file size and then add the new file size for
checking diskquota.
Modified Paths:
--------------
trunk/src/core/Sync/SyncPolicy.cs
Modified: trunk/src/core/Sync/SyncPolicy.cs
===================================================================
--- trunk/src/core/Sync/SyncPolicy.cs 2010-02-28 05:21:46 UTC (rev 7318)
+++ trunk/src/core/Sync/SyncPolicy.cs 2010-02-28 05:28:55 UTC (rev 7319)
@@ -92,6 +92,19 @@
public bool Allowed(BaseFileNode fNode)
{
long fSize = fNode.Length;
+ /* If the file is already present on the server, upload size would be
+ * size of file on the server subtracted by size of file to upload */
+ Store stl =Store.GetStore();
+ Domain dom =stl.GetDomain(stl.DefaultDomain);
+ Node n1 = dom.GetNodeByID(fNode.ID);
+ if(n1 != null)
+ {
+ FileNode f1 = n1 as FileNode;
+ if(f1.Length <= fSize)
+ fSize = fSize - f1.Length;
+ else
+ fSize = 0;
+ }
if(!GroupDiskQuotaUploadAllowed(fSize))
{
reason = PolicyType.Quota;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|