added: container LastContainer (lastcontainer.h lastcontainer.cpp)
it consists of last logged users added: function 'last' git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@492 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
o = templates.o sys.o item.o doc.o user.o dir.o done.o priv.o patterncacher.o who.o
|
||||
o = templates.o sys.o item.o doc.o user.o dir.o done.o priv.o patterncacher.o who.o last.o
|
||||
|
||||
|
||||
all: templates.a
|
||||
|
||||
+67
-46
@@ -5,41 +5,57 @@ dir.o: ../core/log.h ../core/item.h ../core/error.h ../core/dirs.h
|
||||
dir.o: ../core/db.h ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
dir.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
dir.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
dir.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
dir.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
dir.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
dir.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
dir.o: ../core/users.h ../core/groups.h ../core/log.h patterncacher.h
|
||||
dir.o: ../core/lastcontainer.h ../core/request.h ../core/requesttypes.h
|
||||
dir.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
dir.o: ../core/httpsimpleparser.h ../core/postparser.h ../core/cookieparser.h
|
||||
dir.o: ../core/item.h ../core/db.h ../core/error.h ../core/user.h
|
||||
dir.o: ../core/group.h ../core/users.h ../core/groups.h ../core/log.h
|
||||
dir.o: patterncacher.h ../app/templates.h
|
||||
doc.o: templates.h ../../ezc/src/ezc.h ../core/data.h ../core/misc.h
|
||||
doc.o: ../core/log.h ../core/item.h ../core/error.h ../core/dirs.h
|
||||
doc.o: ../core/db.h ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
doc.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
doc.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
doc.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
doc.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
doc.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
doc.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
doc.o: ../core/users.h ../core/groups.h ../core/log.h patterncacher.h
|
||||
doc.o: ../core/lastcontainer.h ../core/request.h ../core/requesttypes.h
|
||||
doc.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
doc.o: ../core/httpsimpleparser.h ../core/postparser.h ../core/cookieparser.h
|
||||
doc.o: ../core/item.h ../core/db.h ../core/error.h ../core/user.h
|
||||
doc.o: ../core/group.h ../core/users.h ../core/groups.h ../core/log.h
|
||||
doc.o: patterncacher.h ../app/templates.h
|
||||
done.o: templates.h ../../ezc/src/ezc.h ../core/data.h ../core/misc.h
|
||||
done.o: ../core/log.h ../core/item.h ../core/error.h ../core/dirs.h
|
||||
done.o: ../core/db.h ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
done.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
done.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
done.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
done.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
done.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
done.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
done.o: ../core/users.h ../core/groups.h ../core/log.h patterncacher.h
|
||||
done.o: ../core/lastcontainer.h ../core/request.h ../core/requesttypes.h
|
||||
done.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
done.o: ../core/httpsimpleparser.h ../core/postparser.h
|
||||
done.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
done.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
done.o: ../core/log.h patterncacher.h ../app/templates.h
|
||||
item.o: templates.h ../../ezc/src/ezc.h ../core/data.h ../core/misc.h
|
||||
item.o: ../core/log.h ../core/item.h ../core/error.h ../core/dirs.h
|
||||
item.o: ../core/db.h ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
item.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
item.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
item.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
item.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
item.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
item.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
item.o: ../core/users.h ../core/groups.h ../core/log.h patterncacher.h
|
||||
item.o: ../core/lastcontainer.h ../core/request.h ../core/requesttypes.h
|
||||
item.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
item.o: ../core/httpsimpleparser.h ../core/postparser.h
|
||||
item.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
item.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
item.o: ../core/log.h patterncacher.h ../app/templates.h
|
||||
last.o: templates.h ../../ezc/src/ezc.h ../core/data.h ../core/misc.h
|
||||
last.o: ../core/log.h ../core/item.h ../core/error.h ../core/dirs.h
|
||||
last.o: ../core/db.h ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
last.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
last.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
last.o: ../core/lastcontainer.h ../core/request.h ../core/requesttypes.h
|
||||
last.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
last.o: ../core/httpsimpleparser.h ../core/postparser.h
|
||||
last.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
last.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
last.o: ../core/log.h patterncacher.h ../app/templates.h
|
||||
last.o: ../core/lastcontainer.h ../core/misc.h
|
||||
patterncacher.o: patterncacher.h ../core/item.h ../../ezc/src/ezc.h
|
||||
patterncacher.o: ../core/log.h
|
||||
priv.o: templates.h ../../ezc/src/ezc.h ../core/data.h ../core/misc.h
|
||||
@@ -47,53 +63,58 @@ priv.o: ../core/log.h ../core/item.h ../core/error.h ../core/dirs.h
|
||||
priv.o: ../core/db.h ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
priv.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
priv.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
priv.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
priv.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
priv.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
priv.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
priv.o: ../core/users.h ../core/groups.h ../core/log.h patterncacher.h
|
||||
priv.o: ../core/lastcontainer.h ../core/request.h ../core/requesttypes.h
|
||||
priv.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
priv.o: ../core/httpsimpleparser.h ../core/postparser.h
|
||||
priv.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
priv.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
priv.o: ../core/log.h patterncacher.h ../app/templates.h
|
||||
sys.o: templates.h ../../ezc/src/ezc.h ../core/data.h ../core/misc.h
|
||||
sys.o: ../core/log.h ../core/item.h ../core/error.h ../core/dirs.h
|
||||
sys.o: ../core/db.h ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
sys.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
sys.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
sys.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
sys.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
sys.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
sys.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
sys.o: ../core/users.h ../core/groups.h ../core/log.h patterncacher.h
|
||||
sys.o: ../core/lastcontainer.h ../core/request.h ../core/requesttypes.h
|
||||
sys.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
sys.o: ../core/httpsimpleparser.h ../core/postparser.h ../core/cookieparser.h
|
||||
sys.o: ../core/item.h ../core/db.h ../core/error.h ../core/user.h
|
||||
sys.o: ../core/group.h ../core/users.h ../core/groups.h ../core/log.h
|
||||
sys.o: patterncacher.h ../app/templates.h
|
||||
templates.o: templates.h ../../ezc/src/ezc.h ../core/data.h ../core/misc.h
|
||||
templates.o: ../core/log.h ../core/item.h ../core/error.h ../core/dirs.h
|
||||
templates.o: ../core/db.h ../core/dircontainer.h ../core/user.h
|
||||
templates.o: ../core/group.h ../core/ugcontainer.h ../core/users.h
|
||||
templates.o: ../core/groups.h ../core/functions.h ../core/function.h
|
||||
templates.o: ../core/functioncodeparser.h ../core/request.h
|
||||
templates.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
templates.o: ../core/getparser.h ../core/httpsimpleparser.h
|
||||
templates.o: ../core/functioncodeparser.h ../core/lastcontainer.h
|
||||
templates.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
templates.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
templates.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
templates.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
templates.o: ../core/users.h ../core/groups.h ../core/log.h patterncacher.h
|
||||
templates.o: ../app/templates.h
|
||||
user.o: templates.h ../../ezc/src/ezc.h ../core/data.h ../core/misc.h
|
||||
user.o: ../core/log.h ../core/item.h ../core/error.h ../core/dirs.h
|
||||
user.o: ../core/db.h ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
user.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
user.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
user.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
user.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
user.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
user.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
user.o: ../core/users.h ../core/groups.h ../core/log.h patterncacher.h
|
||||
user.o: ../core/lastcontainer.h ../core/request.h ../core/requesttypes.h
|
||||
user.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
user.o: ../core/httpsimpleparser.h ../core/postparser.h
|
||||
user.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
user.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
user.o: ../core/log.h patterncacher.h ../app/templates.h
|
||||
who.o: templates.h ../../ezc/src/ezc.h ../core/data.h ../core/misc.h
|
||||
who.o: ../core/log.h ../core/item.h ../core/error.h ../core/dirs.h
|
||||
who.o: ../core/db.h ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
who.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
who.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
who.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
who.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
who.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
who.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
who.o: ../core/users.h ../core/groups.h ../core/log.h patterncacher.h
|
||||
who.o: ../core/sessioncontainer.h ../core/requestcontroller.h ../core/data.h
|
||||
who.o: ../core/request.h ../content/content.h ../templates/templates.h
|
||||
who.o: ../core/misc.h ../core/function.h ../core/functionparser.h
|
||||
who.o: ../core/lastcontainer.h ../core/request.h ../core/requesttypes.h
|
||||
who.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
who.o: ../core/httpsimpleparser.h ../core/postparser.h ../core/cookieparser.h
|
||||
who.o: ../core/item.h ../core/db.h ../core/error.h ../core/user.h
|
||||
who.o: ../core/group.h ../core/users.h ../core/groups.h ../core/log.h
|
||||
who.o: patterncacher.h ../app/templates.h ../core/sessioncontainer.h
|
||||
who.o: ../core/requestcontroller.h ../core/data.h ../core/request.h
|
||||
who.o: ../content/content.h ../templates/templates.h ../core/misc.h
|
||||
who.o: ../core/function.h ../core/functionparser.h ../app/content.h
|
||||
who.o: ../core/sessionmanager.h ../core/sessioncontainer.h
|
||||
|
||||
Executable
+85
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "templates.h"
|
||||
#include "../core/lastcontainer.h"
|
||||
#include "../core/misc.h"
|
||||
|
||||
|
||||
namespace TemplatesFunctions
|
||||
{
|
||||
static size_t last_reqid = 0;
|
||||
static LastContainer::Iterator last_iterator;
|
||||
|
||||
|
||||
bool last_init()
|
||||
{
|
||||
if( last_reqid != request.id )
|
||||
{
|
||||
last_reqid = request.id;
|
||||
last_iterator = data.last.Begin();
|
||||
}
|
||||
|
||||
return last_iterator != data.last.End();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void last_tab(Info & i)
|
||||
{
|
||||
last_init();
|
||||
|
||||
if( i.iter != 0 && last_iterator != data.last.End() )
|
||||
++last_iterator;
|
||||
|
||||
i.result = last_iterator != data.last.End();
|
||||
}
|
||||
|
||||
|
||||
void last_tab_name(Info & i)
|
||||
{
|
||||
if( !last_init() )
|
||||
return;
|
||||
|
||||
HtmlEscape(i.out, last_iterator->name);
|
||||
}
|
||||
|
||||
|
||||
void last_tab_ip(Info & i)
|
||||
{
|
||||
if( !last_init() )
|
||||
return;
|
||||
|
||||
i.out << IpToStr(last_iterator->ip);
|
||||
}
|
||||
|
||||
|
||||
void last_tab_start(Info & i)
|
||||
{
|
||||
if( !last_init() )
|
||||
return;
|
||||
|
||||
i.out << DateToStr(&last_iterator->start);
|
||||
}
|
||||
|
||||
|
||||
void last_tab_end(Info & i)
|
||||
{
|
||||
if( !last_init() )
|
||||
return;
|
||||
|
||||
if( last_iterator->IsLoggedOut() )
|
||||
i.out << DateToStr(&last_iterator->end);
|
||||
}
|
||||
|
||||
|
||||
} // namespace TemplatesFunctions
|
||||
|
||||
|
||||
|
||||
+24
-5
@@ -24,6 +24,7 @@ Ezc::Pattern pat_fun_priv;
|
||||
Ezc::Pattern pat_fun_rm;
|
||||
Ezc::Pattern pat_fun_who;
|
||||
Ezc::Pattern pat_fun_run;
|
||||
Ezc::Pattern pat_fun_last;
|
||||
Ezc::Pattern pat_err_item_required;
|
||||
Ezc::Pattern pat_err_404;
|
||||
Ezc::Pattern pat_err_per_denied;
|
||||
@@ -103,6 +104,10 @@ Ezc::Pattern * p = 0;
|
||||
p = &pat_fun_who;
|
||||
break;
|
||||
|
||||
case FUN_LAST:
|
||||
p = &pat_fun_last;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -297,12 +302,23 @@ void Templates::CreateFunctions()
|
||||
/*
|
||||
who
|
||||
*/
|
||||
functions.Insert("who_tab", who_tab);
|
||||
functions.Insert("who_tab_lp", who_tab_lp);
|
||||
functions.Insert("who_tab_user", who_tab_user);
|
||||
functions.Insert("who_tab_time", who_tab_time);
|
||||
functions.Insert("who_tab_last_time", who_tab_last_time);
|
||||
functions.Insert("who_tab", who_tab);
|
||||
functions.Insert("who_tab_lp", who_tab_lp);
|
||||
functions.Insert("who_tab_user", who_tab_user);
|
||||
functions.Insert("who_tab_time", who_tab_time);
|
||||
functions.Insert("who_tab_last_time", who_tab_last_time);
|
||||
|
||||
|
||||
/*
|
||||
last
|
||||
*/
|
||||
functions.Insert("last_tab", last_tab);
|
||||
functions.Insert("last_tab_name", last_tab_name);
|
||||
functions.Insert("last_tab_ip", last_tab_ip);
|
||||
functions.Insert("last_tab_start", last_tab_start);
|
||||
functions.Insert("last_tab_end", last_tab_end);
|
||||
|
||||
|
||||
|
||||
// !! tymczasowa
|
||||
functions.Insert("is_group_tv", is_group_tv);
|
||||
@@ -363,6 +379,9 @@ void Templates::Read()
|
||||
pat_fun_run.Directory(data.templates);
|
||||
pat_fun_run.ParseFile("fun_run.html");
|
||||
|
||||
pat_fun_last.Directory(data.templates);
|
||||
pat_fun_last.ParseFile("fun_last.html");
|
||||
|
||||
pat_item_info.Directory(data.templates);
|
||||
pat_item_info.ParseFile("item_info.html");
|
||||
|
||||
|
||||
@@ -175,6 +175,15 @@ namespace TemplatesFunctions
|
||||
void who_tab_time(Info & i);
|
||||
void who_tab_last_time(Info & i);
|
||||
|
||||
/*
|
||||
last
|
||||
*/
|
||||
void last_tab(Info & i);
|
||||
void last_tab_name(Info & i);
|
||||
void last_tab_ip(Info & i);
|
||||
void last_tab_start(Info & i);
|
||||
void last_tab_end(Info & i);
|
||||
|
||||
|
||||
|
||||
} // namespace TemplatesFunctions
|
||||
|
||||
Reference in New Issue
Block a user