Changeset - 3a19c755fbcd
[Not reviewed]
0 4 0
Jan Kaluza - 9 years ago 2016-02-25 08:52:28
jkaluza@redhat.com
Web interface: Fix base_location setting for register.shtml page
4 files changed with 12 insertions and 2 deletions:
0 comments (0 inline, 0 general)
spectrum_manager/src/html/header.shtml
Show inline comments
 
@@ -11,6 +11,7 @@
 
    <script src="/js/jquery.js"></script>
 
    <script src="/js/jquery-ui.js"></script>
 
    <script src="/js/jquery.cookie.js"></script>
 
    <script src="/js/config.js"></script>
 
    <script src="/js/app.js"></script>
 
    <title>Spectrum 2</title>
 
  </head>
spectrum_manager/src/html/js/app.js
Show inline comments
 
@@ -214,7 +214,7 @@ function fill_users_register_form() {
 
			"password": $("#password").val()
 
		};
 

	
 
		$.post("/api/v1/users/add", postdata, function(data) {
 
		$.post(BaseLocation + "api/v1/users/add", postdata, function(data) {
 
			if (data.error) {
 
				$('#error').text(data.message);
 
			}
spectrum_manager/src/server.cpp
Show inline comments
 
@@ -105,6 +105,14 @@ Server::Server(ManagerConfig *config, const std::string &config_file) {
 
		footer.close();
 
	}
 

	
 
	std::ofstream output;
 
	output.open(std::string(CONFIG_STRING(config, "service.data_dir") + "/js/config.js").c_str(), std::ios::out);
 
	if (output.fail()) {
 
		LOG4CXX_ERROR(logger, "Cannot open " << std::string(CONFIG_STRING(config, "service.data_dir") + "/js/config.js") << " for writing: " << strerror(errno));
 
	}
 
	output << "var BaseLocation = \"" << CONFIG_STRING(m_config, "service.base_location") << "\";\n";
 
	output.close();
 

	
 
	m_storageCfg = new Config();
 
	m_storageCfg->load(config_file);
 
	
 
@@ -235,6 +243,7 @@ bool Server::is_authorized(const struct mg_connection *conn, struct http_message
 
		!mg_vcmp(&hm->uri, "/js/jquery.js") ||
 
		!mg_vcmp(&hm->uri, "/js/jquery-ui.js") ||
 
		!mg_vcmp(&hm->uri, "/js/jquery.cookie.js") ||
 
		!mg_vcmp(&hm->uri, "/js/config.js") ||
 
		!mg_vcmp(&hm->uri, "/js/app.js") ||
 
		!mg_vcmp(&hm->uri, "/users/register.shtml") ||
 
		!mg_vcmp(&hm->uri, "/api/v1/users/add") ||
tests/tests_output/localhost/vcard/client.dat
Show inline comments
 
@@ -20,8 +20,8 @@ return {
 
		};
 
	};
 
	["attr"] = {
 
		["version"] = "2.0";
 
		["prodid"] = "-//HandGen//NONSGML vGen v1.0//EN";
 
		["version"] = "2.0";
 
		["xmlns"] = "vcard-temp";
 
	};
 
	["name"] = "vCard";
0 comments (0 inline, 0 general)