Files
winix/templates/doc.cpp
Tomasz Sowa 60fccea703 fixed: dots in url-es (now only one dot is available in the whole name and it cannot be only one dot ".")
added:   cmslu can act as an authorizer (fast cgi authorize role)
added:   Item::static_auth we can have additional static content on the file system
         this content is authorized through cmslu (fastcgi authorizer mode)
changed: some changes in config
changed: the way how the www server is using cmslu
         added new virtuals: static static_auth
changed: cmslu returns correct http headers (200, 404, 403)
changed: in cookie parser: we get the last cookie (if the server has more than one cookie with the same name)



git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@540 e52654a7-88a9-db11-a3e9-0013d4bc506e
2009-12-30 20:46:12 +00:00

103 lines
1.2 KiB
C++
Executable File

/*
* This file is a part of CMSLU -- Content Management System like Unix
* and is not publicly distributed
*
* Copyright (c) 2008-2009, Tomasz Sowa
* All rights reserved.
*
*/
#include "templates.h"
#include "../core/data.h"
#include "../core/request.h"
#include "../core/misc.h"
namespace TemplatesFunctions
{
void doc_language(Info & i)
{
// at the moment only Polish language
i.out << "pl";
}
void doc_title(Info & i)
{
size_t a = 0;
// from 1 means skipping the root directory
for(a = 1 ; a<request.dir_table.size() ; ++a)
{
i.out << " / ";
HtmlEscape(i.out, request.dir_table[a]->subject);
}
if( request.is_item )
{
i.out << " / ";
HtmlEscape(i.out, request.item.subject);
}
}
void doc_charset(Info & i)
{
i.out << "iso-8859-2";
}
void doc_base_url(Info & i)
{
i.out << data.base_url;
}
void doc_base_url_static(Info & i)
{
i.out << data.base_url_static;
}
void doc_base_url_static_auth(Info & i)
{
i.out << data.base_url_static_auth;
}
void doc_current_url(Info & i)
{
i.out << request.env_request_uri;
}
void doc_is_error(Info & i)
{
i.result = request.status != Error::ok;
}
void doc_status(Info & i)
{
i.out << static_cast<int>( request.status );
}
} // namespace TemplatesFunctions