summaryrefslogtreecommitdiff
path: root/src/strusCms.cpp
blob: 137a209526a12ff434057bb02b7416e0379a529b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "strusCms.hpp"

#include <cppcms/url_mapper.h>   
#include <cppcms/http_response.h>
#include <cppcms/json.h>

namespace apps {

strusCms::strusCms( cppcms::service &srv )
	: cppcms::application( srv ),
	intro( *this ),
	user( *this ),
 	conn( settings( ).get<std::string>( "strusCms.db_connection" ) ),
 	mail( settings( ).get<std::string>( "strusCms.mail.server" ),
		settings( ).get<unsigned short>( "strusCms.mail.port" ),
		settings( ).get<std::string>( "strusCms.mail.username" ),
		settings( ).get<std::string>( "strusCms.mail.password" ),
		settings( ).get<std::string>( "strusCms.mail.from" )
		 )
{
	locale_name = "en";
	script = settings( ).get<std::string>( "strusCms.script" );

	add( intro );
	add( user );

	mapper( ).root( root( ) );
}

std::string strusCms::root( std::string l )
{
	return script;
	// TODO: localization later
	//~ if( l.empty( ) ) l = locale_name;
	//~ return script + "/" + l;
}

}