added: a new winix function: passwd
for changing your password or if you are a super user you can change a password for anyone added: uname prints available plugins now git-svn-id: svn://ttmath.org/publicrep/winix/trunk@748 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -2,14 +2,15 @@
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "templates.h"
|
||||
#include "../core/request.h"
|
||||
#include "../core/version.h"
|
||||
#include "core/request.h"
|
||||
#include "core/version.h"
|
||||
#include "core/plugin.h"
|
||||
|
||||
|
||||
|
||||
@@ -38,6 +39,61 @@ void sys_ver_revision(Info & i)
|
||||
|
||||
|
||||
|
||||
static size_t sys_plugin_index = 0;
|
||||
|
||||
|
||||
void sys_plugin_tab(Info & i)
|
||||
{
|
||||
sys_plugin_index = i.iter;
|
||||
i.res = sys_plugin_index < plugin.GetPlugins()->size();
|
||||
}
|
||||
|
||||
void sys_plugin_tab_has_name(Info & i)
|
||||
{
|
||||
if( sys_plugin_index < plugin.GetPlugins()->size() )
|
||||
i.res = (*plugin.GetPlugins())[sys_plugin_index].plugin_name != 0;
|
||||
}
|
||||
|
||||
void sys_plugin_tab_name(Info & i)
|
||||
{
|
||||
if( sys_plugin_index < plugin.GetPlugins()->size() )
|
||||
{
|
||||
const wchar_t * name = (*plugin.GetPlugins())[sys_plugin_index].plugin_name;
|
||||
|
||||
if( name )
|
||||
i.out << name;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static size_t sys_user_index = 0;
|
||||
|
||||
void sys_user_tab(Info & i)
|
||||
{
|
||||
sys_user_index = i.iter;
|
||||
i.res = sys_user_index < system->users.Size();
|
||||
}
|
||||
|
||||
|
||||
void sys_user_tab_is_current(Info & i)
|
||||
{
|
||||
if( !cur->session->puser )
|
||||
return;
|
||||
|
||||
if( sys_user_index < system->users.Size() )
|
||||
i.res = (cur->session->puser->id == system->users[sys_user_index].id);
|
||||
}
|
||||
|
||||
|
||||
void sys_user_tab_name(Info & i)
|
||||
{
|
||||
if( sys_user_index < system->users.Size() )
|
||||
i.out << system->users[sys_user_index].name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace TemplatesFunctions
|
||||
|
||||
|
Reference in New Issue
Block a user