added: html/fun_pw.html

default view for pw winix function


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@815 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2012-03-03 21:00:48 +00:00
parent e61f0db57e
commit 6c2c12fe5e
7 changed files with 83 additions and 3 deletions

View File

@ -122,8 +122,6 @@ Users::SizeType Users::Size()
User & Users::operator[](Users::SizeType pos)
{
// !! IMPROVE ME
// add checking the range and returning an empty User struct if out of range
return table[pos];
}

27
html/fun_pw.html Executable file
View File

@ -0,0 +1,27 @@
<h1>Pw</h1>
[if user_tab]
<table class="tablec">
<tr>
<th>{pw_table_no}</th>
<th>{pw_table_login}</th>
<th>{pw_table_is_root}</th>
<th>{pw_table_is_active}</th>
<th>{pw_table_is_suspended}</th>
<th>{pw_table_is_banned}</th>
</tr>
[for user_tab]
<tr class="[if-index odd]roweven[else]rowodd[end]">
<td>[user_tab_index]</td>
<td>[user_tab_name]</td>
<td>[if user_tab_is_super_user]{pw_table_yes}[end]</td>
<td>[if user_tab_is_active]{pw_table_yes}[end]</td>
<td>[if user_tab_is_suspended]{pw_table_yes}[end]</td>
<td>[if user_tab_is_blocked]{pw_table_yes}[end]</td>
</tr>
[end]
</table>
[end]

View File

@ -178,6 +178,17 @@ priv_for_all_dirs = For all directories to
priv_change_all = Change subdirectories as well
priv_change_current_dir = Change also the current directory
pw_header = Users
pw_table_no = No
pw_table_login = Login
pw_table_is_root = Is Root
pw_table_is_active = Is active
pw_table_is_suspended = Is suspended
pw_table_is_banned = Is banned
pw_table_yes = yes
pw_table_no = no
reload_header = Reload
reload_select = Choose an item to reload
reload_templates = html templates

View File

@ -199,6 +199,17 @@ priv_change_all = Zmień także w podkatalogach
priv_change_current_dir = Zmień także sam katalog bieżący
pw_header = Użytkownicy
pw_table_no = L.p.
pw_table_login = Login
pw_table_is_root = Root
pw_table_is_active = Aktywny
pw_table_is_suspended = Wstrzymany
pw_table_is_banned = Zbanowany
pw_table_yes = tak
pw_table_no = nie
reload_header = Przeładuj
reload_select = Wybierz pozycję
reload_templates = szablony html

View File

@ -503,9 +503,13 @@ void Templates::CreateFunctions()
ezc_functions.Insert("user_can_use_bbcode", user_can_use_bbcode);
ezc_functions.Insert("user_can_use_raw", user_can_use_raw);
ezc_functions.Insert("user_tab", user_tab);
ezc_functions.Insert("user_tab_index", user_tab_index);
ezc_functions.Insert("user_tab_id", user_tab_id);
ezc_functions.Insert("user_tab_name", user_tab_name);
ezc_functions.Insert("user_tab_is_super_user", user_tab_is_super_user);
ezc_functions.Insert("user_tab_is_active", user_tab_is_active);
ezc_functions.Insert("user_tab_is_suspended", user_tab_is_suspended);
ezc_functions.Insert("user_tab_is_blocked", user_tab_is_blocked);
ezc_functions.Insert("user_tab_is_current", user_tab_is_current);

View File

@ -421,9 +421,13 @@ namespace TemplatesFunctions
void user_can_use_bbcode(Info & i);
void user_can_use_raw(Info & i);
void user_tab(Info & i);
void user_tab_index(Info & i);
void user_tab_id(Info & i);
void user_tab_name(Info & i);
void user_tab_is_super_user(Info & i);
void user_tab_is_active(Info & i);
void user_tab_is_suspended(Info & i);
void user_tab_is_blocked(Info & i);
void user_tab_is_current(Info & i);

View File

@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* Copyright (c) 2008-2012, Tomasz Sowa
* All rights reserved.
*
*/
@ -117,6 +117,11 @@ void user_tab(Info & i)
}
void user_tab_index(Info & i)
{
i.out << (user_index+1);
}
void user_tab_id(Info & i)
{
if( user_index < system->users.Size() )
@ -138,6 +143,26 @@ void user_tab_is_super_user(Info & i)
}
void user_tab_is_active(Info & i)
{
if( user_index < system->users.Size() )
i.res = system->users[user_index].status == WINIX_ACCOUNT_READY;
}
void user_tab_is_suspended(Info & i)
{
if( user_index < system->users.Size() )
i.res = system->users[user_index].status == WINIX_ACCOUNT_SUSPENDED;
}
void user_tab_is_blocked(Info & i)
{
if( user_index < system->users.Size() )
i.res = system->users[user_index].status == WINIX_ACCOUNT_BLOCKED;
}
void user_tab_is_current(Info & i)
{
if( user_index < system->users.Size() && cur->session->puser )