// ProjectName: Simple RBAC with role mutex Demo
// Author: Vistb
// Time: September 7th, 2009
// Environment: MS Windows7 RTM 32bit build 7600, MSVS2008 with SP1
#include "DefinitionAndInclude.h"
int main()
{
char commandBuffer[commandBufferSize];
// Output welcome info
printf("Simple RBAC with role mutex Demo\n");
printf("Tip: Type help command for help information.\n");
// Main procedure
while(true)
{
memset(commandBuffer,0,commandBufferSize);
fflush(stdin);
putchar('>');
// Get user command
fgets(commandBuffer,commandBufferSize,stdin);
for (int i=0;i<commandBufferSize;++i)
{
if (commandBuffer[i]=='\n')
{
commandBuffer[i]=0;
}
}
/* Analyze the command */
if (strcmp(commandBuffer,"help")==0) // Try if the command is help
{
HelpMainModule();
continue;
}
else if (strcmp(commandBuffer,"cls")==0) // Try if the command is cls
{
ClsMainModule();
continue;
}
else if (strcmp(commandBuffer,"query")==0) // Try if the command is query
{
QueryMainModule();
continue;
}
else if (CheckIsSaveOrLoadCommand(commandBuffer)) // Try if the command is save/load data
{
SaveAndLoadMainModule(commandBuffer);
continue;
}
else if (CheckIsRoleManageCommand(commandBuffer)) // Try if the command is role management
{
RoleManageMainModule(commandBuffer);
continue;
}
else if (CheckIsUserManageCommand(commandBuffer)) // Try if the command is user management
{
UserManageMainModule(commandBuffer);
continue;
}
else if (CheckIsUserRoleManageCommand(commandBuffer)) // Try if the command is user role management
{
UserRoleManageMainModule(commandBuffer);
continue;
}
else if (CheckIsRoleAccessManageCommand(commandBuffer)) // Try if the command is role access management
{
RoleAccessManageMainModule(commandBuffer);
continue;
}
else if (CheckIsRoleMutexManageCommand(commandBuffer)) // Try if the command is role mutex management
{
RoleMutexManageMainModule(commandBuffer);
continue;
}
else if (CheckIsAccessTestCommand(commandBuffer)) // Try if the command is access test
{
AccessTestMainModule(commandBuffer);
continue;
}
else
{
printf("Unknown command!\n");
}
}
return 0;
}
vistb2
- 粉丝: 5
- 资源: 18
最新资源
- lsb-release,安装磐维数据库,安装oracle数据库等常用的依赖包
- redhat-lsb-core,安装磐维数据库,安装oracle数据库等常用的依赖包
- 丹佛丝堆垛机变频器参数配置起升、运行、货叉
- JSP学生学籍管理系统(源代码+论文+开题报告+外文翻译+答辩PPT).rar
- jsp医院病区管理系统(论文+中期检查表+任务书+综合材料).rar
- jsp研究生党建管理系统pc-毕业设计.rar
- JSP在线考试系统的设计与实现(源代码+论文).rar
- JSP在线CD销售系统(论文).rar
- jSP在线教学质量评价系统的设计与实现(源代码+论文).rar
- JSP自动排课管理系统(源代码+论文+开题报告).rar
- JSP在线学习系统设计(源代码+论文).rar
- JSP作业管理系统(源代码+论文).rar
- JSP自动排课系统(源代码+论文+开题报告).rar
- lerx2_utf8_v2_beta2_20121214.rar
- putty,linux客户端工具
- 提高Windows 11文件资源管理器显示文件夹大小功能
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
前往页