added: functions: ckeditor, uptime
added: for function: login - a html pattern for GET request git-svn-id: svn://ttmath.org/publicrep/winix/trunk@567 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
# DO NOT DELETE
|
||||
|
||||
dir.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
dir.o: ../core/locale.h ../confparser/confparser.h ../core/request.h
|
||||
dir.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
dir.o: ../core/httpsimpleparser.h ../core/log.h ../core/request.h
|
||||
dir.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
||||
dir.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
||||
dir.o: ../core/function.h ../core/thread.h ../core/compress.h
|
||||
@@ -10,21 +11,22 @@ dir.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
dir.o: ../core/data.h ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
dir.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||
dir.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
dir.o: ../core/mount.h ../core/locale.h ../core/db.h ../core/log.h
|
||||
dir.o: ../core/misc.h
|
||||
dir.o: ../core/mount.h ../core/locale.h ../core/db.h ../core/misc.h
|
||||
doc.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
doc.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
doc.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
doc.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
doc.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
doc.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
doc.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h
|
||||
doc.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
doc.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
doc.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
doc.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
doc.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
doc.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h ../core/dirs.h
|
||||
doc.o: ../core/item.h ../core/dircontainer.h ../core/users.h ../core/user.h
|
||||
doc.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h
|
||||
doc.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
|
||||
doc.o: ../core/mounts.h ../core/mount.h ../core/error.h ../core/rebus.h
|
||||
doc.o: ../core/locale.h ../core/request.h ../core/requesttypes.h
|
||||
doc.o: ../core/session.h ../core/done.h ../core/thread.h ../core/compress.h
|
||||
doc.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
doc.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
doc.o: ../core/misc.h
|
||||
done.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
done.o: ../core/locale.h ../confparser/confparser.h ../core/request.h
|
||||
done.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
done.o: ../core/httpsimpleparser.h ../core/log.h ../core/request.h
|
||||
done.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
done.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
done.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
@@ -32,7 +34,8 @@ done.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
done.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
done.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
item.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
item.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
item.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
item.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h
|
||||
item.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
item.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
item.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
@@ -43,7 +46,8 @@ item.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
item.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
item.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
last.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
last.o: ../core/locale.h ../confparser/confparser.h ../core/lastcontainer.h
|
||||
last.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
last.o: ../core/httpsimpleparser.h ../core/log.h ../core/lastcontainer.h
|
||||
last.o: ../core/data.h ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
last.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
last.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
@@ -56,6 +60,14 @@ last.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
last.o: ../core/misc.h
|
||||
localefilter.o: localefilter.h ../core/locale.h ../confparser/confparser.h
|
||||
localefilter.o: ../core/misc.h ../core/item.h
|
||||
ls.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
ls.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
ls.o: ../core/httpsimpleparser.h ../core/log.h ../core/request.h
|
||||
ls.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
||||
ls.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
||||
ls.o: ../core/function.h ../core/thread.h ../core/compress.h
|
||||
ls.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
ls.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
misc.o: ../core/data.h ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
misc.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
misc.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
@@ -64,7 +76,8 @@ misc.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h
|
||||
misc.o: ../core/misc.h misc.h localefilter.h ../core/locale.h
|
||||
misc.o: ../confparser/confparser.h
|
||||
mount.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
mount.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
mount.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
mount.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h
|
||||
mount.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
mount.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
mount.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
@@ -78,7 +91,8 @@ patterncacher.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
patterncacher.o: ../core/mount.h ../core/error.h ../core/rebus.h
|
||||
patterncacher.o: ../core/locale.h ../core/log.h
|
||||
priv.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
priv.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
priv.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
priv.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h
|
||||
priv.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
priv.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
priv.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
@@ -99,20 +113,23 @@ rebus.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||
rebus.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
rebus.o: ../core/mount.h ../core/locale.h templates.h patterncacher.h
|
||||
rebus.o: ../core/item.h misc.h localefilter.h ../core/locale.h
|
||||
rebus.o: ../confparser/confparser.h
|
||||
rebus.o: ../confparser/confparser.h ckeditorgetparser.h
|
||||
rebus.o: ../core/httpsimpleparser.h ../core/log.h
|
||||
sys.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
sys.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
sys.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
sys.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
sys.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
sys.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
sys.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h
|
||||
sys.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
sys.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
sys.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
sys.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
sys.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
sys.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h ../core/dirs.h
|
||||
sys.o: ../core/item.h ../core/dircontainer.h ../core/users.h ../core/user.h
|
||||
sys.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h
|
||||
sys.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
|
||||
sys.o: ../core/mounts.h ../core/mount.h ../core/error.h ../core/rebus.h
|
||||
sys.o: ../core/locale.h ../core/request.h ../core/requesttypes.h
|
||||
sys.o: ../core/session.h ../core/done.h ../core/thread.h ../core/compress.h
|
||||
sys.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
sys.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
sys.o: ../core/misc.h
|
||||
templates.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
templates.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
templates.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
templates.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h
|
||||
templates.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
templates.o: ../core/users.h ../core/user.h ../core/ugcontainer.h
|
||||
templates.o: ../core/log.h ../core/groups.h ../core/group.h
|
||||
@@ -126,7 +143,8 @@ templates.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
templates.o: ../core/plugin.h ../core/request.h ../core/data.h
|
||||
templates.o: ../core/pluginmsg.h
|
||||
thread.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
thread.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
thread.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
thread.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h
|
||||
thread.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
thread.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
thread.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
@@ -138,7 +156,8 @@ thread.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
thread.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
thread.o: ../core/misc.h
|
||||
ticket.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
ticket.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
ticket.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
ticket.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h
|
||||
ticket.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
ticket.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
ticket.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
@@ -149,8 +168,17 @@ ticket.o: ../core/done.h ../core/thread.h ../core/compress.h
|
||||
ticket.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
ticket.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||
ticket.o: ../core/misc.h
|
||||
uptime.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
uptime.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
uptime.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h
|
||||
uptime.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||
uptime.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||
uptime.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
uptime.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||
uptime.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h
|
||||
user.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
user.o: ../core/locale.h ../confparser/confparser.h ../core/data.h
|
||||
user.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
user.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h
|
||||
user.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
user.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
user.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
@@ -161,7 +189,8 @@ user.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
user.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
user.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
who.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
who.o: ../core/locale.h ../confparser/confparser.h ../core/sessioncontainer.h
|
||||
who.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
who.o: ../core/httpsimpleparser.h ../core/log.h ../core/sessioncontainer.h
|
||||
who.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
who.o: ../core/log.h ../core/user.h ../core/rebus.h
|
||||
who.o: ../core/requestcontroller.h ../content/content.h
|
||||
@@ -175,3 +204,15 @@ who.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/request.h
|
||||
who.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
who.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
who.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||
winix.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h
|
||||
winix.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h
|
||||
winix.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h
|
||||
winix.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||
winix.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||
winix.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||
winix.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
winix.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h
|
||||
winix.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
winix.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
winix.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
winix.o: ../core/postmultiparser.h ../core/ticket.h
|
||||
|
||||
@@ -1 +1 @@
|
||||
o = dir.o doc.o done.o item.o last.o localefilter.o misc.o mount.o patterncacher.o priv.o rebus.o sys.o templates.o thread.o ticket.o user.o who.o
|
||||
o = dir.o doc.o done.o item.o last.o localefilter.o ls.o misc.o mount.o patterncacher.o priv.o rebus.o sys.o templates.o thread.o ticket.o uptime.o user.o who.o winix.o
|
||||
|
||||
68
templates/ckeditorgetparser.h
Executable file
68
templates/ckeditorgetparser.h
Executable file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslutemplatesckeditorgetparser
|
||||
#define headerfilecmslutemplatesckeditorgetparser
|
||||
|
||||
|
||||
#include <string>
|
||||
#include "../core/httpsimpleparser.h"
|
||||
#include "../core/log.h"
|
||||
|
||||
|
||||
|
||||
|
||||
class CKEditorGetParser : public HttpSimpleParser
|
||||
{
|
||||
const char * pchar;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
virtual int GetChar()
|
||||
{
|
||||
if( !pchar || *pchar == 0 )
|
||||
return -1;
|
||||
|
||||
return (int)(unsigned char)*(pchar++);
|
||||
}
|
||||
|
||||
|
||||
virtual void Parameter(std::string & name, std::string & value)
|
||||
{
|
||||
if( name == "CKEditorFuncNum" )
|
||||
{
|
||||
fun_num = atol(value.c_str());
|
||||
log << log3 << "CKEGetParser: callback function number: " << fun_num << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
long fun_num;
|
||||
|
||||
CKEditorGetParser()
|
||||
{
|
||||
pchar = 0;
|
||||
fun_num = 0;
|
||||
}
|
||||
|
||||
void Parse(const char * str)
|
||||
{
|
||||
pchar = str;
|
||||
HttpSimpleParser::Parse();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -58,6 +58,11 @@ void doc_base_url_static(Info & i)
|
||||
}
|
||||
|
||||
|
||||
void doc_base_url_static_ext(Info & i)
|
||||
{
|
||||
i.out << data.base_url_static_ext;
|
||||
}
|
||||
|
||||
|
||||
void doc_base_url_static_auth(Info & i)
|
||||
{
|
||||
|
||||
@@ -187,16 +187,22 @@ void item_static_auth_is_other(Info & i)
|
||||
|
||||
void item_can_read(Info & i)
|
||||
{
|
||||
if( request.HasReadAccess(request.item) )
|
||||
i.result = true;
|
||||
i.result = request.HasReadAccess(request.item);
|
||||
}
|
||||
|
||||
|
||||
void item_can_write(Info & i)
|
||||
{
|
||||
if( request.HasWriteAccess(request.item) )
|
||||
i.result = true;
|
||||
i.result = request.HasWriteAccess(request.item);
|
||||
}
|
||||
|
||||
|
||||
void item_can_remove(Info & i)
|
||||
{
|
||||
i.result = request.CanRemove(request.item);
|
||||
}
|
||||
|
||||
|
||||
void item_info(Info & i)
|
||||
{
|
||||
if( static_cast<size_t>(data.locale.GetLang()) >= patterns.size() )
|
||||
@@ -449,6 +455,17 @@ void item_tab_link(Info & i)
|
||||
}
|
||||
|
||||
|
||||
void item_tab_link_static_auth(Info & i)
|
||||
{
|
||||
if( item_index < request.item_table.size() )
|
||||
{
|
||||
HtmlEscape(i.out, data.base_url_static_auth);
|
||||
item_tab_dir(i);
|
||||
item_tab_url(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void item_tab_can_read(Info & i)
|
||||
{
|
||||
if( item_index < request.item_table.size() )
|
||||
|
||||
47
templates/ls.cpp
Executable file
47
templates/ls.cpp
Executable file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "templates.h"
|
||||
#include "../core/request.h"
|
||||
|
||||
|
||||
|
||||
|
||||
namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
static size_t ls_ckeditor_reqid = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
void ls_ckeditor_funnum_browse(Info & i)
|
||||
{
|
||||
if( ls_ckeditor_reqid != request.id )
|
||||
{
|
||||
ls_ckeditor_reqid = request.id;
|
||||
ckeditor_getparser.fun_num = 2; // default if there is a problem with parsing info
|
||||
|
||||
if( !request.param_table.empty() )
|
||||
{
|
||||
const char * str = request.param_table[request.param_table.size()-1]->c_str() + 1; // the first char is '?'
|
||||
ckeditor_getparser.Parse(str);
|
||||
}
|
||||
}
|
||||
|
||||
i.out << ckeditor_getparser.fun_num;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
TemplatesMisc::Patterns patterns;
|
||||
Ezc::Functions functions;
|
||||
PatternCacher pattern_cacher;
|
||||
LocaleFilter locale_filter;
|
||||
|
||||
TemplatesMisc::Patterns patterns;
|
||||
Ezc::Functions functions;
|
||||
PatternCacher pattern_cacher;
|
||||
LocaleFilter locale_filter;
|
||||
CKEditorGetParser ckeditor_getparser;
|
||||
|
||||
|
||||
|
||||
@@ -58,7 +58,14 @@ Ezc::Pattern * p = 0;
|
||||
{FUN_TICKET, pat_fun_ticket},
|
||||
{FUN_CREATETICKET, pat_fun_createticket},
|
||||
{FUN_EDITTICKET, pat_fun_createticket},
|
||||
{FUN_UPLOAD, pat_fun_upload}
|
||||
{FUN_UPLOAD, pat_fun_upload},
|
||||
{FUN_UPTIME, pat_fun_uptime},
|
||||
{FUN_LOGIN, pat_fun_login},
|
||||
/* {FUN_MV, pat_fun_mv},
|
||||
{FUN_UNAME, pat_fun_uname},
|
||||
{FUN_CHMOD, pat_fun_chmod},
|
||||
{FUN_CHOWN, pat_fun_chown}, */
|
||||
{FUN_CKEDITOR, pat_fun_ckeditor}
|
||||
};
|
||||
|
||||
size_t i, len = sizeof(pat_name_tab)/sizeof(PatName);
|
||||
@@ -164,6 +171,7 @@ void Templates::CreateFunctions()
|
||||
functions.Insert("doc_title", doc_title);
|
||||
functions.Insert("doc_base_url", doc_base_url);
|
||||
functions.Insert("doc_base_url_static", doc_base_url_static);
|
||||
functions.Insert("doc_base_url_static_ext", doc_base_url_static_ext);
|
||||
functions.Insert("doc_base_url_static_auth", doc_base_url_static_auth);
|
||||
functions.Insert("doc_current_url", doc_current_url);
|
||||
functions.Insert("doc_is_error", doc_is_error);
|
||||
@@ -193,6 +201,7 @@ void Templates::CreateFunctions()
|
||||
|
||||
functions.Insert("item_can_read", item_can_read);
|
||||
functions.Insert("item_can_write", item_can_write);
|
||||
functions.Insert("item_can_remove", item_can_remove);
|
||||
functions.Insert("item_info", item_info);
|
||||
functions.Insert("item_user", item_user);
|
||||
functions.Insert("item_date_creation", item_date_creation);
|
||||
@@ -222,6 +231,7 @@ void Templates::CreateFunctions()
|
||||
functions.Insert("item_tab_dir", item_tab_dir);
|
||||
functions.Insert("item_tab_url", item_tab_url);
|
||||
functions.Insert("item_tab_link", item_tab_link);
|
||||
functions.Insert("item_tab_link_static_auth", item_tab_link_static_auth);
|
||||
functions.Insert("item_tab_can_read", item_tab_can_read);
|
||||
functions.Insert("item_tab_info", item_tab_info);
|
||||
functions.Insert("item_tab_user", item_tab_user);
|
||||
@@ -260,6 +270,13 @@ void Templates::CreateFunctions()
|
||||
|
||||
|
||||
|
||||
/*
|
||||
user
|
||||
*/
|
||||
functions.Insert("ls_ckeditor_funnum_browse", ls_ckeditor_funnum_browse);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
user
|
||||
*/
|
||||
@@ -414,12 +431,29 @@ void Templates::CreateFunctions()
|
||||
/*
|
||||
rebus
|
||||
*/
|
||||
functions.Insert("rebus_question", rebus_question);
|
||||
functions.Insert("rebus_question", rebus_question);
|
||||
|
||||
|
||||
/*
|
||||
uptime
|
||||
*/
|
||||
functions.Insert("uptime_more_than_one_day", uptime_more_than_one_day);
|
||||
functions.Insert("uptime_days", uptime_days);
|
||||
functions.Insert("uptime_hours", uptime_hours);
|
||||
|
||||
|
||||
/*
|
||||
winix
|
||||
*/
|
||||
functions.Insert("winix_cur_time", winix_cur_time);
|
||||
functions.Insert("winix_users_logged", winix_users_logged);
|
||||
functions.Insert("winix_function_is", winix_function_is);
|
||||
functions.Insert("winix_function_param_is", winix_function_param_is);
|
||||
|
||||
plugin.Call(CMSLU_TEMPLATES_CREATEFUNCTIONS, &functions);
|
||||
|
||||
|
||||
|
||||
plugin.Call(WINIX_TEMPLATES_CREATEFUNCTIONS, &functions);
|
||||
}
|
||||
|
||||
|
||||
@@ -457,6 +491,13 @@ using namespace TemplatesMisc;
|
||||
Read(patterns, pat_fun_upload, locale_filter, "fun_upload.html");
|
||||
Read(patterns, pat_fun_ticket, locale_filter, "fun_ticket.html");
|
||||
Read(patterns, pat_fun_createticket,locale_filter, "fun_createticket.html");
|
||||
Read(patterns, pat_fun_uptime, locale_filter, "fun_uptime.html");
|
||||
Read(patterns, pat_fun_login, locale_filter, "fun_login.html");
|
||||
/*Read(patterns, pat_fun_mv, locale_filter, "fun_mv.html");
|
||||
Read(patterns, pat_fun_uname, locale_filter, "fun_uname.html");
|
||||
Read(patterns, pat_fun_chmod, locale_filter, "fun_chmod.html");
|
||||
Read(patterns, pat_fun_chown, locale_filter, "fun_chown.html"); */
|
||||
Read(patterns, pat_fun_ckeditor, locale_filter, "fun_ckeditor.html");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "ezc.h"
|
||||
#include "patterncacher.h"
|
||||
#include "misc.h"
|
||||
#include "ckeditorgetparser.h"
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +40,14 @@ namespace TemplatesFunctions
|
||||
pat_fun_createthread,
|
||||
pat_fun_upload,
|
||||
pat_fun_ticket,
|
||||
pat_fun_uptime,
|
||||
pat_fun_login,
|
||||
pat_fun_mv,
|
||||
pat_fun_uname,
|
||||
pat_fun_chmod,
|
||||
pat_fun_chown,
|
||||
pat_fun_createticket,
|
||||
pat_fun_ckeditor,
|
||||
pat_err_404,
|
||||
pat_err_per_denied,
|
||||
pat_err_others,
|
||||
@@ -61,7 +69,7 @@ namespace TemplatesFunctions
|
||||
extern TemplatesMisc::Patterns patterns;
|
||||
extern PatternCacher pattern_cacher;
|
||||
extern Ezc::Functions functions;
|
||||
|
||||
extern CKEditorGetParser ckeditor_getparser;
|
||||
|
||||
|
||||
/*
|
||||
@@ -78,6 +86,7 @@ namespace TemplatesFunctions
|
||||
void doc_title(Info & i);
|
||||
void doc_base_url(Info & i);
|
||||
void doc_base_url_static(Info & i);
|
||||
void doc_base_url_static_ext(Info & i);
|
||||
void doc_base_url_static_auth(Info & i);
|
||||
void doc_current_url(Info & i);
|
||||
void doc_is_error(Info & i);
|
||||
@@ -107,6 +116,7 @@ namespace TemplatesFunctions
|
||||
void item_static_auth_is_other(Info & i);
|
||||
void item_can_read(Info & i);
|
||||
void item_can_write(Info & i);
|
||||
void item_can_remove(Info & i);
|
||||
void item_info(Info & i);
|
||||
void item_user(Info & i);
|
||||
void item_date_creation(Info & i);
|
||||
@@ -136,6 +146,7 @@ namespace TemplatesFunctions
|
||||
void item_tab_dir(Info & i);
|
||||
void item_tab_url(Info & i);
|
||||
void item_tab_link(Info & i);
|
||||
void item_tab_link_static_auth(Info & i);
|
||||
void item_tab_can_read(Info & i);
|
||||
void item_tab_info(Info & i);
|
||||
void item_tab_user(Info & i);
|
||||
@@ -173,6 +184,12 @@ namespace TemplatesFunctions
|
||||
void dir_last_dates_equal(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
user
|
||||
*/
|
||||
void ls_ckeditor_funnum_browse(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
user
|
||||
*/
|
||||
@@ -318,13 +335,30 @@ namespace TemplatesFunctions
|
||||
void mount_type_is_ticket(Info & i);
|
||||
void mount_type_is_cms(Info & i);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
rebus
|
||||
*/
|
||||
void rebus_question(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
uptime
|
||||
*/
|
||||
void uptime_more_than_one_day(Info & i);
|
||||
void uptime_days(Info & i);
|
||||
void uptime_hours(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
winix
|
||||
*/
|
||||
void winix_cur_time(Info & i);
|
||||
void winix_users_logged(Info & i);
|
||||
void winix_function_is(Info & i);
|
||||
void winix_function_param_is(Info & i);
|
||||
|
||||
|
||||
} // namespace TemplatesFunctions
|
||||
|
||||
|
||||
|
||||
55
templates/uptime.cpp
Executable file
55
templates/uptime.cpp
Executable file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ctime>
|
||||
#include "templates.h"
|
||||
#include "../core/data.h"
|
||||
|
||||
|
||||
namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
|
||||
|
||||
void uptime_more_than_one_day(Info & i)
|
||||
{
|
||||
time_t up = time(0) - data.system_start;
|
||||
time_t days = up / 60 / 60 / 24;
|
||||
|
||||
i.result = ( days > 1 );
|
||||
}
|
||||
|
||||
|
||||
void uptime_days(Info & i)
|
||||
{
|
||||
time_t up = time(0) - data.system_start;
|
||||
time_t days = up / 60 / 60 / 24;
|
||||
|
||||
i.out << days;
|
||||
}
|
||||
|
||||
|
||||
void uptime_hours(Info & i)
|
||||
{
|
||||
char buf[50];
|
||||
|
||||
time_t sec = time(0) - data.system_start;
|
||||
time_t min = sec / 60;
|
||||
time_t hour = min / 60;
|
||||
|
||||
if( hour == 0 && min == 0 )
|
||||
sprintf(buf, "%d:%02d:%02d", hour, min, sec);
|
||||
else
|
||||
sprintf(buf, "%d:%02d", hour, min);
|
||||
|
||||
i.out << buf;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
60
templates/winix.cpp
Executable file
60
templates/winix.cpp
Executable file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <ctime>
|
||||
#include "templates.h"
|
||||
#include "../core/data.h"
|
||||
#include "../core/request.h"
|
||||
|
||||
|
||||
namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
|
||||
|
||||
void winix_cur_time(Info & i)
|
||||
{
|
||||
static char buffer[100];
|
||||
|
||||
time_t t = time(0);
|
||||
tm * ptm = localtime(&t);
|
||||
|
||||
sprintf(buffer, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
|
||||
i.out << buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void winix_users_logged(Info & i)
|
||||
{
|
||||
i.out << data.how_many_logged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void winix_function_is(Info & i)
|
||||
{
|
||||
if( !request.pfunction || !i.is )
|
||||
return;
|
||||
|
||||
i.result = (request.pfunction->item.url == *i.is);
|
||||
}
|
||||
|
||||
|
||||
void winix_function_param_is(Info & i)
|
||||
{
|
||||
if( !i.is )
|
||||
return;
|
||||
|
||||
i.result = request.IsParam(i.is->c_str());
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace
|
||||
Reference in New Issue
Block a user