diff --git a/core/version.h b/core/version.h index acea5d7..6ad036e 100755 --- a/core/version.h +++ b/core/version.h @@ -13,7 +13,7 @@ #define WINIX_VER_MAJOR 0 #define WINIX_VER_MINOR 3 -#define WINIX_VER_REVISION 0 +#define WINIX_VER_REVISION 1 #endif diff --git a/templates/dir.cpp b/templates/dir.cpp index 7778fa8..edad2c2 100755 --- a/templates/dir.cpp +++ b/templates/dir.cpp @@ -58,13 +58,13 @@ bool result = true; } } - i.result = result; + i.res = result; } void dir_can_write(Info & i) { - i.result = request.HasWriteAccess(*request.dir_table.back()); + i.res = request.HasWriteAccess(*request.dir_table.back()); } @@ -88,25 +88,25 @@ bool result = true; result = false; } - i.result = result; + i.res = result; } void dir_can_use_emacs(Info & i) { if( !request.dir_table.empty() ) - i.result = request.CanUseEmacs(*request.dir_table.back(), true); + i.res = request.CanUseEmacs(*request.dir_table.back(), true); else - i.result = false; + i.res = false; } void dir_can_use_mkdir(Info & i) { if( !request.dir_table.empty() ) - i.result = request.CanUseMkdir(*request.dir_table.back(), true); + i.res = request.CanUseMkdir(*request.dir_table.back(), true); else - i.result = false; + i.res = false; } @@ -131,7 +131,7 @@ void dir_childs_tab(Info & i) } dir_childs_index = i.iter; - i.result = dir_childs_index < dir_childs_table.size(); + i.res = dir_childs_index < dir_childs_table.size(); } @@ -198,7 +198,7 @@ static size_t dir_index; void dir_tab(Info & i) { dir_index = i.iter; - i.result = dir_index < request.dir_table.size(); + i.res = dir_index < request.dir_table.size(); } @@ -335,12 +335,12 @@ void dir_last_dates_equal(Info & i) tm * ptm1 = &request.dir_table.back()->date_creation; tm * ptm2 = &request.dir_table.back()->date_modification; - i.result = ptm1->tm_year == ptm2->tm_year && - ptm1->tm_mon == ptm2->tm_mon && - ptm1->tm_mday == ptm2->tm_mday && - ptm1->tm_hour == ptm2->tm_hour && - ptm1->tm_min == ptm2->tm_min && - ptm1->tm_sec == ptm2->tm_sec; + i.res = ptm1->tm_year == ptm2->tm_year && + ptm1->tm_mon == ptm2->tm_mon && + ptm1->tm_mday == ptm2->tm_mday && + ptm1->tm_hour == ptm2->tm_hour && + ptm1->tm_min == ptm2->tm_min && + ptm1->tm_sec == ptm2->tm_sec; } diff --git a/templates/item.cpp b/templates/item.cpp index 225b6f6..84c5439 100755 --- a/templates/item.cpp +++ b/templates/item.cpp @@ -26,7 +26,7 @@ namespace TemplatesFunctions void item_is(Info & i) { - i.result = request.is_item; + i.res = request.is_item; } @@ -66,25 +66,22 @@ void item_content_noescape(Info & i) void item_content_type_is(Info & i) { - i.result = false; + i.res = false; - if( !i.is ) - return; + if( request.item.content_type == Item::ct_text && i.par == "text" ) + i.res = true; - if( request.item.content_type == Item::ct_text && (*i.is) == "text" ) - i.result = true; + if( request.item.content_type == Item::ct_formatted_text && i.par == "formatted text" ) + i.res = true; - if( request.item.content_type == Item::ct_formatted_text && (*i.is) == "formatted text" ) - i.result = true; + if( request.item.content_type == Item::ct_html && i.par == "html" ) + i.res = true; - if( request.item.content_type == Item::ct_html && (*i.is) == "html" ) - i.result = true; + if( request.item.content_type == Item::ct_bbcode && i.par == "bbcode" ) + i.res = true; - if( request.item.content_type == Item::ct_bbcode && (*i.is) == "bbcode" ) - i.result = true; - - if( request.item.content_type == Item::ct_raw && (*i.is) == "raw" ) - i.result = true; + if( request.item.content_type == Item::ct_raw && i.par == "raw" ) + i.res = true; } @@ -121,7 +118,7 @@ void item_print_content(std::ostringstream & out, const std::string & content, I void item_content_is_empty(Info & i) { - i.result = request.item.content.empty(); + i.res = request.item.content.empty(); } void item_print_content(Info & i) @@ -151,10 +148,10 @@ void item_url(Info & i) void item_url_is(Info & i) { - if( !request.is_item || !i.is ) + if( !request.is_item ) return; // default false - i.result = request.item.url == *i.is; + i.res = (request.item.url == i.par); } @@ -170,31 +167,31 @@ void item_link(Info & i) void item_auth_is_none(Info & i) { - i.result = request.item.auth == Item::auth_none; + i.res = request.item.auth == Item::auth_none; } void item_auth_is_image(Info & i) { - i.result = request.item.auth == Item::auth_image; + i.res = request.item.auth == Item::auth_image; } void item_can_read(Info & i) { - i.result = request.HasReadAccess(request.item); + i.res = request.HasReadAccess(request.item); } void item_can_write(Info & i) { - i.result = request.HasWriteAccess(request.item); + i.res = request.HasWriteAccess(request.item); } void item_can_remove(Info & i) { - i.result = request.CanRemove(request.item); + i.res = request.CanRemove(request.item); } @@ -261,7 +258,7 @@ void item_dates_equal(Info & i) tm * ptm1 = &request.item.date_creation; tm * ptm2 = &request.item.date_modification; - i.result = ptm1->tm_year == ptm2->tm_year && + i.res = ptm1->tm_year == ptm2->tm_year && ptm1->tm_mon == ptm2->tm_mon && ptm1->tm_mday == ptm2->tm_mday && ptm1->tm_hour == ptm2->tm_hour && @@ -312,7 +309,7 @@ static size_t item_index; void item_tab(Info & i) { item_index = i.iter; - i.result = item_index < request.item_table.size(); + i.res = item_index < request.item_table.size(); } @@ -418,7 +415,7 @@ void item_tab_can_read(Info & i) if( item_index < request.item_table.size() ) { if( request.HasReadAccess(request.item_table[item_index]) ) - i.result = true; + i.res = true; } } @@ -517,7 +514,7 @@ void item_tab_dates_equal(Info & i) tm * ptm1 = &request.item_table[item_index].date_creation; tm * ptm2 = &request.item_table[item_index].date_modification; - i.result = ptm1->tm_year == ptm2->tm_year && + i.res = ptm1->tm_year == ptm2->tm_year && ptm1->tm_mon == ptm2->tm_mon && ptm1->tm_mday == ptm2->tm_mday && ptm1->tm_hour == ptm2->tm_hour && diff --git a/templates/last.cpp b/templates/last.cpp index eea3955..8ca795f 100755 --- a/templates/last.cpp +++ b/templates/last.cpp @@ -42,7 +42,7 @@ void last_tab(Info & i) if( i.iter != 0 && last_iterator != data.last.End() ) ++last_iterator; - i.result = last_iterator != data.last.End(); + i.res = last_iterator != data.last.End(); } diff --git a/templates/mount.cpp b/templates/mount.cpp index 0e586d2..16c6f23 100755 --- a/templates/mount.cpp +++ b/templates/mount.cpp @@ -20,36 +20,31 @@ namespace TemplatesFunctions void mount_page_is(Info & i) { - if( !i.is ) - return; - - i.result = data.mounts.pmount->IsArg(Mount::par_page, *i.is); + i.res = data.mounts.pmount->IsArg(Mount::par_page, i.par); } + void mount_thread_is(Info & i) { - if( !i.is ) - return; - - i.result = data.mounts.pmount->IsArg(Mount::par_thread, *i.is); + i.res = data.mounts.pmount->IsArg(Mount::par_thread, i.par); } void mount_type_is_thread(Info & i) { - i.result = data.mounts.pmount->type == Mount::thread; + i.res = data.mounts.pmount->type == Mount::thread; } void mount_type_is_ticket(Info & i) { - i.result = data.mounts.pmount->type == Mount::ticket; + i.res = data.mounts.pmount->type == Mount::ticket; } void mount_type_is_cms(Info & i) { - i.result = data.mounts.pmount->type == Mount::cms; + i.res = data.mounts.pmount->type == Mount::cms; } diff --git a/templates/priv.cpp b/templates/priv.cpp index ab7fa33..c5bf403 100755 --- a/templates/priv.cpp +++ b/templates/priv.cpp @@ -68,7 +68,7 @@ void priv_user_tab(Info & i) priv_user_tab_init(); priv_user_index = i.iter; - i.result = priv_user_index < priv_user_table.size(); + i.res = priv_user_index < priv_user_table.size(); } @@ -107,12 +107,12 @@ void priv_user_tab_isdefault(Info & i) if( request.is_item ) { if( uid == request.item.user_id ) - i.result = true; + i.res = true; } else { if( uid == request.dir_table.back()->user_id ) - i.result = true; + i.res = true; } } } @@ -193,7 +193,7 @@ void priv_group_tab(Info & i) priv_group_tab_init(); priv_group_index = i.iter; - i.result = priv_group_index < priv_group_table.size(); + i.res = priv_group_index < priv_group_table.size(); } @@ -232,12 +232,12 @@ void priv_group_tab_isdefault(Info & i) if( request.is_item ) { if( gid == request.item.group_id ) - i.result = true; + i.res = true; } else { if( gid == request.dir_table.back()->group_id ) - i.result = true; + i.res = true; } } } @@ -268,13 +268,13 @@ void priv_privileges_for_dirs(Info & i) void priv_show_form_chown(Info & i) { - i.result = (request.pfunction->code == FUN_PRIV || request.pfunction->code == FUN_CHOWN); + i.res = (request.pfunction->code == FUN_PRIV || request.pfunction->code == FUN_CHOWN); } void priv_show_form_chmod(Info & i) { - i.result = (request.pfunction->code == FUN_PRIV || request.pfunction->code == FUN_CHMOD); + i.res = (request.pfunction->code == FUN_PRIV || request.pfunction->code == FUN_CHMOD); } diff --git a/templates/templates.cpp b/templates/templates.cpp index 50667ba..3390b0c 100755 --- a/templates/templates.cpp +++ b/templates/templates.cpp @@ -25,8 +25,7 @@ Locale locale; LocaleFilter locale_filter; CKEditorGetParser ckeditor_getparser; - - +const std::string empty; // used by GenerateRunRaw() @@ -550,10 +549,10 @@ using namespace TemplatesFunctions; void Templates::GenerateRunRaw() { using namespace TemplatesFunctions; - - Ezc::Info info(request.page); - info.iter = 0; - info.result = false; + + Ezc::Info info(request.page, empty); + info.iter = 0; + info.res = false; item_run(info); } diff --git a/templates/thread.cpp b/templates/thread.cpp index 7183d35..90e9338 100755 --- a/templates/thread.cpp +++ b/templates/thread.cpp @@ -20,7 +20,7 @@ namespace TemplatesFunctions void thread_is(Info & i) { - i.result = request.is_thread; + i.res = request.is_thread; } @@ -33,7 +33,7 @@ void thread_tab(Info & i) { thread_tab_index = i.iter; - i.result = thread_tab_index < request.thread_tab.size(); + i.res = thread_tab_index < request.thread_tab.size(); } @@ -170,7 +170,7 @@ void thread_tab_last_item_user(Info & i) void thread_can_create(Info & i) { - i.result = request.CanCreateThread(true); + i.res = request.CanCreateThread(true); } diff --git a/templates/ticket.cpp b/templates/ticket.cpp index 9853ec7..bd5e1db 100755 --- a/templates/ticket.cpp +++ b/templates/ticket.cpp @@ -20,7 +20,7 @@ namespace TemplatesFunctions void ticket_is(Info & i) { - i.result = request.is_ticket; + i.res = request.is_ticket; } @@ -28,13 +28,13 @@ void ticket_is(Info & i) void ticket_can_create(Info & i) { - i.result = request.CanCreateTicket(true); + i.res = request.CanCreateTicket(true); } void ticket_can_edit(Info & i) { - i.result = request.CanEditTicket(); + i.res = request.CanEditTicket(); } @@ -93,7 +93,7 @@ void ticket_tab(Info & i) { ticket_tab_index = i.iter; - i.result = ticket_tab_index < request.ticket_tab.size(); + i.res = ticket_tab_index < request.ticket_tab.size(); } @@ -138,14 +138,14 @@ void ticket_tab_subject(Info & i) void ticket_tab_subject_empty(Info & i) { - i.result = true; + i.res = true; if( ticket_tab_index < request.ticket_tab.size() ) { Item * dir = data.dirs.GetDir( request.ticket_tab[ticket_tab_index].dir_id ); if( dir ) - i.result = dir->subject.empty(); + i.res = dir->subject.empty(); } } @@ -269,13 +269,13 @@ void ticket_type_tab(Info & i) { ticket_type_tab_ind = i.iter; - i.result = ticket_type_tab_ind < data.mounts.pmount->param[Mount::par_ticket_type].arg.size(); + i.res = ticket_type_tab_ind < data.mounts.pmount->param[Mount::par_ticket_type].arg.size(); } void ticket_type_tab_defined(Info & i) { - i.result = data.mounts.pmount->param[Mount::par_ticket_type].defined; + i.res = data.mounts.pmount->param[Mount::par_ticket_type].defined; } @@ -283,7 +283,7 @@ void ticket_type_tab_isdefault(Info & i) { if( request.is_ticket ) { - i.result = (ticket_type_tab_ind == request.ticket.type); + i.res = (ticket_type_tab_ind == request.ticket.type); } else { @@ -293,7 +293,7 @@ void ticket_type_tab_isdefault(Info & i) return; // default false size_t value = atoi( p.arg[0].c_str() ); - i.result = (ticket_type_tab_ind == value); + i.res = (ticket_type_tab_ind == value); } } @@ -321,13 +321,13 @@ void ticket_status_tab(Info & i) { ticket_status_tab_ind = i.iter; - i.result = ticket_status_tab_ind < data.mounts.pmount->param[Mount::par_ticket_status].arg.size(); + i.res = ticket_status_tab_ind < data.mounts.pmount->param[Mount::par_ticket_status].arg.size(); } void ticket_status_tab_defined(Info & i) { - i.result = data.mounts.pmount->param[Mount::par_ticket_status].defined; + i.res = data.mounts.pmount->param[Mount::par_ticket_status].defined; } @@ -335,7 +335,7 @@ void ticket_status_tab_isdefault(Info & i) { if( request.is_ticket ) { - i.result = (ticket_status_tab_ind == request.ticket.status); + i.res = (ticket_status_tab_ind == request.ticket.status); } else { @@ -345,7 +345,7 @@ void ticket_status_tab_isdefault(Info & i) return; // default false size_t value = atoi( p.arg[0].c_str() ); - i.result = (ticket_status_tab_ind == value); + i.res = (ticket_status_tab_ind == value); } } @@ -372,13 +372,13 @@ void ticket_priority_tab(Info & i) { ticket_priority_tab_ind = i.iter; - i.result = ticket_priority_tab_ind < data.mounts.pmount->param[Mount::par_ticket_priority].arg.size(); + i.res = ticket_priority_tab_ind < data.mounts.pmount->param[Mount::par_ticket_priority].arg.size(); } void ticket_priority_tab_defined(Info & i) { - i.result = data.mounts.pmount->param[Mount::par_ticket_priority].defined; + i.res = data.mounts.pmount->param[Mount::par_ticket_priority].defined; } @@ -386,7 +386,7 @@ void ticket_priority_tab_isdefault(Info & i) { if( request.is_ticket ) { - i.result = (ticket_priority_tab_ind == request.ticket.priority); + i.res = (ticket_priority_tab_ind == request.ticket.priority); } else { @@ -396,7 +396,7 @@ void ticket_priority_tab_isdefault(Info & i) return; // default false size_t value = atoi( p.arg[0].c_str() ); - i.result = (ticket_priority_tab_ind == value); + i.res = (ticket_priority_tab_ind == value); } } @@ -423,13 +423,13 @@ void ticket_category_tab(Info & i) { ticket_category_tab_ind = i.iter; - i.result = ticket_category_tab_ind < data.mounts.pmount->param[Mount::par_ticket_category].arg.size(); + i.res = ticket_category_tab_ind < data.mounts.pmount->param[Mount::par_ticket_category].arg.size(); } void ticket_category_tab_defined(Info & i) { - i.result = data.mounts.pmount->param[Mount::par_ticket_category].defined; + i.res = data.mounts.pmount->param[Mount::par_ticket_category].defined; } @@ -437,7 +437,7 @@ void ticket_category_tab_isdefault(Info & i) { if( request.is_ticket ) { - i.result = (ticket_category_tab_ind == request.ticket.category); + i.res = (ticket_category_tab_ind == request.ticket.category); } else { @@ -447,7 +447,7 @@ void ticket_category_tab_isdefault(Info & i) return; // default false size_t value = atoi( p.arg[0].c_str() ); - i.result = (ticket_category_tab_ind == value); + i.res = (ticket_category_tab_ind == value); } } @@ -475,13 +475,13 @@ void ticket_expected_tab(Info & i) { ticket_expected_tab_ind = i.iter; - i.result = ticket_expected_tab_ind < data.mounts.pmount->param[Mount::par_ticket_expected].arg.size(); + i.res = ticket_expected_tab_ind < data.mounts.pmount->param[Mount::par_ticket_expected].arg.size(); } void ticket_expected_tab_defined(Info & i) { - i.result = data.mounts.pmount->param[Mount::par_ticket_expected].defined; + i.res = data.mounts.pmount->param[Mount::par_ticket_expected].defined; } @@ -489,7 +489,7 @@ void ticket_expected_tab_isdefault(Info & i) { if( request.is_ticket ) { - i.result = (ticket_expected_tab_ind == request.ticket.expected); + i.res = (ticket_expected_tab_ind == request.ticket.expected); } else { @@ -499,7 +499,7 @@ void ticket_expected_tab_isdefault(Info & i) return; // default false size_t value = atoi( p.arg[0].c_str() ); - i.result = (ticket_expected_tab_ind == value); + i.res = (ticket_expected_tab_ind == value); } } diff --git a/templates/uptime.cpp b/templates/uptime.cpp index c3265d3..972ad87 100755 --- a/templates/uptime.cpp +++ b/templates/uptime.cpp @@ -22,7 +22,7 @@ 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 ); + i.res = ( days > 1 ); } diff --git a/templates/user.cpp b/templates/user.cpp index d36d910..ef2bd96 100755 --- a/templates/user.cpp +++ b/templates/user.cpp @@ -22,7 +22,7 @@ namespace TemplatesFunctions void user_logged(Info & i) { - i.result = request.session->puser != 0; + i.res = request.session->puser != 0; } @@ -39,34 +39,34 @@ void user_name(Info & i) void user_super_user(Info & i) { if( request.session->puser && request.session->puser->super_user ) - i.result = true; + i.res = true; } void user_can_use_html(Info & i) { if( !request.session->puser ) - i.result = false; + i.res = false; else - i.result = request.CanUseHtml(request.session->puser->id); + i.res = request.CanUseHtml(request.session->puser->id); } void user_can_use_bbcode(Info & i) { if( !request.session->puser ) - i.result = false; + i.res = false; else - i.result = request.CanUseBBCode(request.session->puser->id); + i.res = request.CanUseBBCode(request.session->puser->id); } void user_can_use_raw(Info & i) { if( !request.session->puser ) - i.result = false; + i.res = false; else - i.result = request.CanUseRaw(request.session->puser->id); + i.res = request.CanUseRaw(request.session->puser->id); } diff --git a/templates/who.cpp b/templates/who.cpp index b255785..aa9c0b9 100755 --- a/templates/who.cpp +++ b/templates/who.cpp @@ -49,7 +49,7 @@ void who_tab(Info & i) ++who_lp; } - i.result = who_iterator != req_controller.SessionEnd(); + i.res = who_iterator != req_controller.SessionEnd(); } diff --git a/templates/winix.cpp b/templates/winix.cpp index 35e6e35..a9884c6 100755 --- a/templates/winix.cpp +++ b/templates/winix.cpp @@ -45,19 +45,16 @@ void winix_function(Info & i) void winix_function_is(Info & i) { - if( !request.pfunction || !i.is ) + if( !request.pfunction ) return; - i.result = (request.pfunction->item.url == *i.is); + i.res = (request.pfunction->item.url == i.par); } void winix_function_param_is(Info & i) { - if( !i.is ) - return; - - i.result = request.IsParam(i.is->c_str()); + i.res = request.IsParam(i.par.c_str()); } @@ -136,11 +133,8 @@ char buf[20]; void winix_err_is(Info & i) { - if( !i.is ) - return; - - int value = atoi( i.is->c_str() ); - i.result = request.status == value; + int value = atoi( i.par.c_str() ); + i.res = (request.status == value); } @@ -161,7 +155,7 @@ char buff[40]; sprintf(buff, "winix_err_%d", request.status); winix_error_key = buff; - i.result = locale.IsKey(winix_error_key); + i.res = locale.IsKey(winix_error_key); } diff --git a/templatesnotify/notify.cpp b/templatesnotify/notify.cpp index ca1b341..0d01c12 100755 --- a/templatesnotify/notify.cpp +++ b/templatesnotify/notify.cpp @@ -18,28 +18,28 @@ namespace TemplatesNotifyFunctions void notify_item_added(Info & i) { - i.result = (notify_msg->notify_code & WINIX_NOTIFY_ITEM_ADD) != 0; + i.res = (notify_msg->notify_code & WINIX_NOTIFY_ITEM_ADD) != 0; } void notify_item_edited(Info & i) { - i.result = (notify_msg->notify_code & WINIX_NOTIFY_ITEM_EDIT) != 0; + i.res = (notify_msg->notify_code & WINIX_NOTIFY_ITEM_EDIT) != 0; } void notify_item_deleted(Info & i) { - i.result = (notify_msg->notify_code & WINIX_NOTIFY_ITEM_DELETE) != 0; + i.res = (notify_msg->notify_code & WINIX_NOTIFY_ITEM_DELETE) != 0; } void notify_dir_added(Info & i) { - i.result = (notify_msg->notify_code & WINIX_NOTIFY_DIR_ADD) != 0; + i.res = (notify_msg->notify_code & WINIX_NOTIFY_DIR_ADD) != 0; } @@ -52,13 +52,13 @@ void notify_to(Info & i) void notify_mount_type_is_thread(Info & i) { - i.result = notify_msg->current_mount_type == Mount::thread; + i.res = notify_msg->current_mount_type == Mount::thread; } void notify_mount_type_is_cms(Info & i) { - i.result = notify_msg->current_mount_type == Mount::cms; + i.res = notify_msg->current_mount_type == Mount::cms; }