📄 client_login.c
字号:
/**************************************************************
* 程序名: client_login.c 客户管理系统操作柜员签到
* 功 能: 显示屏幕提供操作员登录系统, 检查密码等合法性,
* 获取菜单操作权限, 并获取操作员所属行号.
* 作 者: 周国祥 2002/04/09 创建
*
* 2002/04/09 置全局变量G_oper_no,G_oper_name,G_oper_pwd
* G_role_code, G_purview
**************************************************************/
#include <stdio.h>
#include <curses.h>
#include <sys/types.h>
#include <time.h>
#include <sys/timeb.h>
#include "tool.h"
#define TRYS 3
extern int cy_oper(), misc_audit();
extern int DispLogo();
char G_oper_no[7]; /* 操作员代码 */
char G_oper_pwd[9]; /* 操作员口令 */
char G_oper_name[11]; /* 操作员名称 */
char G_role_code[4]; /* 操作员角色码 */
char G_purview[257]; /* 角色权限 */
char G_bankid[12]; /* 所属行行号 */
char G_cen_bankid[12]; /* 中心行(省行或区域行)行号 */
char G_cen_hostid[3]; /* 中心行(省行或区域行)BTS主机号 */
/*
* 客户(地市行)系统操作员注册
*/
int client_login()
{
/*
* 显示LOGO图
*/
DispLogo();
/*
* 显示版本logo画面并提供客户注册
*/
version_client_login(A_NORMAL, "中国新一代", "银行卡收单客户管理系统", "(CMS 1.0版)","北京亚大通讯网络有限责任公司");
}
/*
* 操作员注册处理。version_client_login()中调用。
*/
int client_oper_login(win, row, col)
WINDOW *win;
int row;
int col;
{
int i;
char sql_str[150];
char failtimes = 0, ch;
char pwd_bak[7];
WINDOW *prompt_w;
int ret = 0;
alarm(0);
/*
* 屏幕最后一行作为提示区
*/
prompt_w = newwin(1, 60, LINES-1, 10);
set_prompt( PROMPT_OFF );
touchwin(win);
/*
* 操作员及密码输入错误允许最多三(TRYS)次
*/
while ( failtimes++ < TRYS ) {
mvwprintw(win, row, col, "中心操作员 [ ]");
mvwprintw(win, row+1, col, "操作员密码 [ ]");
wrefresh(win);
memset(G_oper_no, ' ', 6);
memset(G_oper_pwd, ' ', 6);
ch = input_item(win, "", row, col+12, G_oper_no, 6, NULL, NULL, 0, 0);
DelSpace(G_oper_no);
if (ch != ENTER) {
delwin(prompt_w);
return(-1);
}
if (!strcmp(G_oper_no, "99")) { /* 操作码输入99,则退出 */
delwin(prompt_w);
return(-1);
}
/* 清算柜员号为8开头的操作,不可以使用管理系统员 */
if (G_oper_no[0] == '8') { /* 操作码输入第一字符为8,则退出 */
clear_wline( prompt_w, 0 );
h_winprompt(prompt_w, 0, 2, "清算操作员不能使用管理系统!", 0, 0 );
continue;
}
ch = input_item(win, "", row+1, col+12, G_oper_pwd, 6, NULL, NULL, 2, 0);
if (ch != ENTER) {
delwin(prompt_w);
return(-1);
}
DelSpace(G_oper_pwd);
strcpy(pwd_bak, G_oper_pwd);
/*
* 转换加密密码字串, cy_oper()在safe1/safe.c中
*/
cy_oper(G_oper_pwd);
sprintf(sql_str,"select count(*) from center_oper where oper_no = \'%s\' and oper_pwd = \'%s\' and use_flag = \'Y\' ",
G_oper_no, G_oper_pwd);
if (cms_query_count(sql_str) <= 0) {
clear_wline(prompt_w, 0);
h_winprompt(prompt_w, 0, 2, "注册失败!", 0, 0);
continue;
}
/*
* 取出登录操作员名, 以作后用
*/
if (cms_get_oper_name(G_oper_no, G_oper_name) < 0) {
clear_wline(prompt_w, 0);
h_winprompt(prompt_w, 0, 2, "操作员名获取时出错!",0, 0);
continue;
}
/*
* 取出所属行号, 以作后用
*/
if (cms_get_oper_bank(G_oper_no, G_bankid) < 0) {
clear_wline(prompt_w, 0);
h_winprompt(prompt_w, 0, 2, "操作员所属行号获取时出错!",0, 0);
continue;
}
/*
* 取出中心行(省行)行号及交易主机号, 以作后用
*/
if (cms_get_local_bank(G_cen_bankid, G_cen_hostid) < 0) {
clear_wline(prompt_w, 0);
h_winprompt(prompt_w, 0, 2, "中心行行号获取时出错!",0, 0);
continue;
}
break;
};
delwin(prompt_w);
if ( failtimes > TRYS )
return(-1);
return(0);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -