Index: lams_admin/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_admin/conf/language/lams/ApplicationResources.properties,v diff -u -r1.75 -r1.76 --- lams_admin/conf/language/lams/ApplicationResources.properties 3 Jan 2012 19:54:04 -0000 1.75 +++ lams_admin/conf/language/lams/ApplicationResources.properties 12 Jan 2012 20:09:21 -0000 1.76 @@ -2,7 +2,7 @@ #language code: en #locale code: AU - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Tue Jan 03 13:36:39 CST 2012 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Thu Jan 12 13:57:54 CST 2012 #=================== labels for LAMS Administration =================# @@ -473,6 +473,7 @@ config.kaltura.user.secret =User secret config.kaltura.kcw.uiconfid =Kaltura Contribution Wizard (KCW) ui config id config.kaltura.kdp.uiconfid =Kaltura Dynamic Player (KDP) ui config id +config.server2server.registration.enable =Enable remote server user registration -#======= End labels: Exported 467 labels for en AU ===== +#======= End labels: Exported 468 labels for en AU ===== Index: lams_admin/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== RCS file: /usr/local/cvsroot/lams_admin/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.73 -r1.74 --- lams_admin/conf/language/lams/ApplicationResources_en_AU.properties 3 Jan 2012 19:54:04 -0000 1.73 +++ lams_admin/conf/language/lams/ApplicationResources_en_AU.properties 12 Jan 2012 20:09:21 -0000 1.74 @@ -2,7 +2,7 @@ #language code: en #locale code: AU - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Tue Jan 03 13:36:39 CST 2012 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Thu Jan 12 13:57:54 CST 2012 #=================== labels for LAMS Administration =================# @@ -473,6 +473,7 @@ config.kaltura.user.secret =User secret config.kaltura.kcw.uiconfid =Kaltura Contribution Wizard (KCW) ui config id config.kaltura.kdp.uiconfid =Kaltura Dynamic Player (KDP) ui config id +config.server2server.registration.enable =Enable remote server user registration -#======= End labels: Exported 467 labels for en AU ===== +#======= End labels: Exported 468 labels for en AU ===== Index: lams_admin/conf/language/lams/ApplicationResources_es_ES.properties =================================================================== RCS file: /usr/local/cvsroot/lams_admin/conf/language/lams/ApplicationResources_es_ES.properties,v diff -u -r1.23 -r1.24 --- lams_admin/conf/language/lams/ApplicationResources_es_ES.properties 3 Jan 2012 19:54:04 -0000 1.23 +++ lams_admin/conf/language/lams/ApplicationResources_es_ES.properties 12 Jan 2012 20:09:21 -0000 1.24 @@ -2,7 +2,7 @@ #language code: es #locale code: ES - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Tue Jan 03 13:36:34 CST 2012 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Thu Jan 12 13:57:49 CST 2012 #=================== labels for LAMS Administration =================# @@ -473,6 +473,7 @@ config.kaltura.user.secret =Secreto de usuario (User secret) config.kaltura.kcw.uiconfid =Kaltura Contribution Wizard (KCW) ui config id config.kaltura.kdp.uiconfid =Kaltura Dynamic Player (KDP) ui config id +config.server2server.registration.enable =Activar registraci\u00f3n de usuarios remota -#======= End labels: Exported 467 labels for es ES ===== +#======= End labels: Exported 468 labels for es ES ===== Index: lams_central/src/java/org/lamsfoundation/lams/webservice/RegisterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/webservice/RegisterAction.java,v diff -u -r1.6 -r1.7 --- lams_central/src/java/org/lamsfoundation/lams/webservice/RegisterAction.java 12 Jan 2012 18:16:15 -0000 1.6 +++ lams_central/src/java/org/lamsfoundation/lams/webservice/RegisterAction.java 12 Jan 2012 20:08:57 -0000 1.7 @@ -68,6 +68,8 @@ import org.lamsfoundation.lams.usermanagement.dto.OrganisationDTO; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; import org.lamsfoundation.lams.util.CentralConstants; +import org.lamsfoundation.lams.util.Configuration; +import org.lamsfoundation.lams.util.ConfigurationKeys; import org.lamsfoundation.lams.util.HashUtil; import org.lamsfoundation.lams.util.MessageService; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -174,6 +176,15 @@ */ public void addUserToGroupLessons(HttpServletRequest request, HttpServletResponse response) throws IOException { try { + + // Check if Server registration is available + boolean serverToServerEnable = Configuration.getAsBoolean(ConfigurationKeys.ENABLE_SERVER_REGISTRATION); + if (!serverToServerEnable) { + String msg = "Server to server registration is not enabled"; + logger.error(msg); + response.sendError(response.SC_METHOD_NOT_ALLOWED, msg); + return; + } String method = request.getParameter(CentralConstants.PARAM_METHOD); String serverId = request.getParameter(CentralConstants.PARAM_SERVER_ID); String datetime = request.getParameter(CentralConstants.PARAM_DATE_TIME); @@ -308,7 +319,15 @@ */ public void removeUserFromGroup(HttpServletRequest request, HttpServletResponse response) throws IOException { try { - String method = request.getParameter(CentralConstants.PARAM_METHOD); + // Check if Server registration is available + boolean serverToServerEnable = Configuration.getAsBoolean(ConfigurationKeys.ENABLE_SERVER_REGISTRATION); + if (!serverToServerEnable) { + String msg = "Server to server registration is not enabled"; + logger.error(msg); + response.sendError(response.SC_METHOD_NOT_ALLOWED, msg); + return; + } + String method = request.getParameter(CentralConstants.PARAM_METHOD); String serverId = request.getParameter(CentralConstants.PARAM_SERVER_ID); String datetime = request.getParameter(CentralConstants.PARAM_DATE_TIME); String hashValue = request.getParameter(CentralConstants.PARAM_HASH_VALUE); @@ -389,6 +408,15 @@ */ public void resetUserTimeLimit(HttpServletRequest request, HttpServletResponse response) throws IOException { try { + // Check if Server registration is available + boolean serverToServerEnable = Configuration.getAsBoolean(ConfigurationKeys.ENABLE_SERVER_REGISTRATION); + if (!serverToServerEnable) { + String msg = "Server to server registration is not enabled"; + logger.error(msg); + response.sendError(response.SC_METHOD_NOT_ALLOWED, msg); + return; + } + String method = request.getParameter(CentralConstants.PARAM_METHOD); String serverId = request.getParameter(CentralConstants.PARAM_SERVER_ID); String datetime = request.getParameter(CentralConstants.PARAM_DATE_TIME); Index: lams_common/db/sql/insert_lams_unix_config_data.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/db/sql/insert_lams_unix_config_data.sql,v diff -u -r1.58 -r1.59 --- lams_common/db/sql/insert_lams_unix_config_data.sql 5 Jan 2012 20:07:50 -0000 1.58 +++ lams_common/db/sql/insert_lams_unix_config_data.sql 12 Jan 2012 20:08:17 -0000 1.59 @@ -1,5 +1,5 @@ insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) -values ('ServerURL','http://shaun.melcoe.mq.edu.au/lams/', 'config.server.url', 'config.header.system', 'STRING', 1); +values ('ServerURL','http://137.111.246.19:8080/lams/', 'config.server.url', 'config.header.system', 'STRING', 1); insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) values ('ServerURLContextPath','lams/', 'config.server.url.context.path', 'config.header.system', 'STRING', 1); @@ -16,6 +16,9 @@ insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) values ('EARDir','/usr/local/jboss-5.1/server/default/deploy/lams.ear/', 'config.ear.dir', 'config.header.system', 'STRING', 1); +insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) +values ('EnableServerRegistration', 'false', 'config.server2server.registration.enable', 'config.header.system', 'BOOLEAN', 1); + insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) values ('InternalSMTPServer','true', 'config.use.internal.smtp.server', 'config.header.email', 'BOOLEAN', 0); Index: lams_common/db/sql/insert_lams_windows_config_data.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/db/sql/insert_lams_windows_config_data.sql,v diff -u -r1.51 -r1.52 --- lams_common/db/sql/insert_lams_windows_config_data.sql 3 Jan 2012 18:56:54 -0000 1.51 +++ lams_common/db/sql/insert_lams_windows_config_data.sql 12 Jan 2012 20:08:17 -0000 1.52 @@ -112,6 +112,9 @@ insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) values ('ForceMobileDevToUseFlashless','false', 'config.force.mobile.use.flashlesh', 'config.header.features', 'BOOLEAN', 1); +insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) +values ('EnableServerRegistration', 'false', 'config.server2server.registration.enable', 'config.header.features', 'BOOLEAN', 1); + insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) values ('LDAPProvisioningEnabled','false', 'config.ldap.provisioning.enabled', 'config.header.ldap', 'BOOLEAN', 1); Index: lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch02040006.sql =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch02040006.sql,v diff -u -r1.17 -r1.18 --- lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch02040006.sql 10 Jan 2012 15:42:02 -0000 1.17 +++ lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch02040006.sql 12 Jan 2012 20:12:56 -0000 1.18 @@ -106,6 +106,10 @@ -- LDEV-2560 Add original author information ALTER TABLE lams_learning_design ADD COLUMN original_user_id BIGINT(20) AFTER user_id; +-- LDEV-2747 An API to create users in bulk from an external system +insert into lams_configuration (config_key, config_value, description_key, header_name, format, required) +values ('EnableServerRegistration', 'false', 'config.server2server.registration.enable', 'config.header.system', 'BOOLEAN', 1); + COMMIT; SET AUTOCOMMIT = 1; set FOREIGN_KEY_CHECKS = 1; Index: lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationKeys.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationKeys.java,v diff -u -r1.45 -r1.46 --- lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationKeys.java 3 Jan 2012 18:56:54 -0000 1.45 +++ lams_common/src/java/org/lamsfoundation/lams/util/ConfigurationKeys.java 12 Jan 2012 20:08:38 -0000 1.46 @@ -275,5 +275,7 @@ public static String KALTURA_KDP_UI_CONF_ID = "KalturaKDPUiConfId"; + // LDEV-2747 + public static String ENABLE_SERVER_REGISTRATION = "EnableServerRegistration"; -} \ No newline at end of file +}