[mapguide-commits] r5503 - in trunk/MgDev/Server/src: Common/Base
Services/Site
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Jan 21 13:24:23 EST 2011
Author: brucedechant
Date: 2011-01-21 10:24:23 -0800 (Fri, 21 Jan 2011)
New Revision: 5503
Modified:
trunk/MgDev/Server/src/Common/Base/ServiceOperation.cpp
trunk/MgDev/Server/src/Common/Base/ServiceOperation.h
trunk/MgDev/Server/src/Services/Site/OpCreateSession.cpp
trunk/MgDev/Server/src/Services/Site/OpCreateSession.h
trunk/MgDev/Server/src/Services/Site/SiteOperation.cpp
Log:
Fix for trac ticket 1588 - Update license checking code
http://trac.osgeo.org/mapguide/ticket/1588
Notes:
- Updated license checking code to only call the license checking on the CreateSession API.
Note: The LicenseManager method called by the CheckLicense() API doesn't actually do anything. If you want to implement your own licensing you will need to add your own license checking code there.
Modified: trunk/MgDev/Server/src/Common/Base/ServiceOperation.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Base/ServiceOperation.cpp 2011-01-21 18:14:14 UTC (rev 5502)
+++ trunk/MgDev/Server/src/Common/Base/ServiceOperation.cpp 2011-01-21 18:24:23 UTC (rev 5503)
@@ -18,7 +18,6 @@
#include "MapGuideCommon.h"
#include "ServiceOperation.h"
#include "Connection.h"
-#include "LicenseManager.h"
#include "LogManager.h"
#include "ServiceManager.h"
#include "ServerSiteService.h"
@@ -684,18 +683,8 @@
void MgServiceOperation::CheckLicense()
{
- // Perform the license validation.
- if (!IsOverheadOperation())
- {
- // The license does not need to be checked for ServerAdmin and Site operations
- // to allow processing of operations, such as viewing error logs, when license check fails.
- MgLicenseManager* licenseManager = MgLicenseManager::GetInstance();
-
- if (NULL != licenseManager)
- {
- licenseManager->CheckLicense();
- }
- }
+ // Add your common per operation license checking code here or override this
+ // method for a specific operation to perform per operation licensing.
}
Modified: trunk/MgDev/Server/src/Common/Base/ServiceOperation.h
===================================================================
--- trunk/MgDev/Server/src/Common/Base/ServiceOperation.h 2011-01-21 18:14:14 UTC (rev 5502)
+++ trunk/MgDev/Server/src/Common/Base/ServiceOperation.h 2011-01-21 18:24:23 UTC (rev 5503)
@@ -52,7 +52,7 @@
protected:
virtual void Validate() = 0;
- void CheckLicense();
+ virtual void CheckLicense();
void AuthenticateCurrentUser();
MgStringCollection* GetAdministratorRole() const;
Modified: trunk/MgDev/Server/src/Services/Site/OpCreateSession.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpCreateSession.cpp 2011-01-21 18:14:14 UTC (rev 5502)
+++ trunk/MgDev/Server/src/Services/Site/OpCreateSession.cpp 2011-01-21 18:24:23 UTC (rev 5503)
@@ -19,6 +19,7 @@
#include "OpCreateSession.h"
#include "SiteServiceUtil.h"
#include "LogManager.h"
+#include "LicenseManager.h"
///----------------------------------------------------------------------------
@@ -121,3 +122,13 @@
MG_SITE_SERVICE_THROW()
}
+
+void MgOpCreateSession::CheckLicense()
+{
+ // Perform the license validation.
+ MgLicenseManager* licenseManager = MgLicenseManager::GetInstance();
+ if (NULL != licenseManager)
+ {
+ licenseManager->CheckLicense();
+ }
+}
Modified: trunk/MgDev/Server/src/Services/Site/OpCreateSession.h
===================================================================
--- trunk/MgDev/Server/src/Services/Site/OpCreateSession.h 2011-01-21 18:14:14 UTC (rev 5502)
+++ trunk/MgDev/Server/src/Services/Site/OpCreateSession.h 2011-01-21 18:24:23 UTC (rev 5503)
@@ -31,6 +31,7 @@
protected:
virtual MgStringCollection* GetRoles() const;
+ virtual void CheckLicense();
};
#endif
Modified: trunk/MgDev/Server/src/Services/Site/SiteOperation.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Site/SiteOperation.cpp 2011-01-21 18:14:14 UTC (rev 5502)
+++ trunk/MgDev/Server/src/Services/Site/SiteOperation.cpp 2011-01-21 18:24:23 UTC (rev 5503)
@@ -83,4 +83,5 @@
void MgSiteOperation::Validate()
{
AuthenticateCurrentUser();
+ CheckLicense();
}
More information about the mapguide-commits
mailing list