本文整理汇总了C++中SystemList::find_user方法的典型用法代码示例。如果您正苦于以下问题:C++ SystemList::find_user方法的具体用法?C++ SystemList::find_user怎么用?C++ SystemList::find_user使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SystemList
的用法示例。
在下文中一共展示了SystemList::find_user方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_user_data
int GeUser::get_user_data(char* system, char* user, char* password,
pwr_tMask* priv, pwr_tOix* id, char* fullname, char* description,
char* email, char* phone, char* sms)
{
int sts;
UserList* ul;
SystemName* sn = new SystemName(system);
sts = sn->parse();
if (EVEN(sts)) {
delete sn;
return sts;
}
SystemList* sl = find_system(sn);
delete sn;
if (!sl)
return USER__NOSUCHSYSTEM;
ul = (UserList*)sl->find_user(user);
if (!ul)
return USER__NOSUCHUSER;
ul->get_data(password, priv, id, fullname, description, email, phone, sms);
return USER__SUCCESS;
}
示例2: modify_user
int GeUser::modify_user(char* system, char* user, char* password,
unsigned int priv, char* fullname, char* description, char* email,
char* phone, char* sms)
{
int sts;
UserList* ul;
SystemName* sn = new SystemName(system);
sts = sn->parse();
if (EVEN(sts)) {
delete sn;
return sts;
}
SystemList* sl = find_system(sn);
delete sn;
if (!sl)
return USER__NOSUCHSYSTEM;
ul = (UserList*)sl->find_user(user);
if (!ul)
return USER__NOSUCHUSER;
ul->modify(password, priv, fullname, description, email, phone, sms);
return USER__SUCCESS;
}
示例3: get_user
int GeUser::get_user( const char *gu_system, const char *gu_user, const char *gu_password,
unsigned int *priv)
{
UserList *ul;
SystemList *sl;
SystemName *sn, *parent;
int sts;
char system[80];
char password[80];
char user[80];
cdh_ToLower( system, gu_system);
cdh_ToLower( user, gu_user);
strcpy( password, gu_password);
// Find system
sn = new SystemName( system);
sts = sn->parse();
if ( EVEN(sts))
{
delete sn;
return USER__NOSUCHSYSTEM;
}
while( sn)
{
sl = find_system( sn);
if ( sl)
{
ul = (UserList *) sl->find_user( user);
if ( ul)
{
sts = ul->check_password( password);
if ( EVEN(sts))
return sts;
*priv = ul->priv;
return USER__SUCCESS;
}
if ( !(sl->attributes & user_mSystemAttr_UserInherit))
break;
}
parent = sn->parent();
if ( parent)
parent->parse();
delete sn;
sn = parent;
}
return USER__NOSUCHUSER;
}
示例4: mh_alarm_bc
pwr_tStatus rt_post::mh_alarm_bc( mh_sMessage *MsgP)
{
ala_uEvent *event = (ala_uEvent *) MsgP;
int sts;
char str[256];
char user[80];
char group[80];
char *s;
pwr_tTime etime, current;
pwr_tDeltaTime diff;
int rcvnum;
char rcv_array[10][80];
char text[400];
if ( !post || post->conf->Disable)
return 1;
if ( !event->Info.EventFlags & pwr_mEventFlagsMask_Email ||
!event->Info.EventFlags & pwr_mEventFlagsMask_SMS)
return 1;
// Skip events older than 10 minutes
etime = net_NetTimeToTime( &event->Info.EventTime);
time_GetTime( ¤t);
time_Adiff( &diff, ¤t, &etime);
if ( time_DToFloat( 0, &diff) > 600)
return 1;
// Check if already handled
if ( event->Info.EventFlags & pwr_mEventFlagsMask_Email) {
if ( post->email_check( &event->Info.Id))
return 1;
else
post->email_register( &event->Info.Id);
}
if ( event->Info.EventFlags & pwr_mEventFlagsMask_SMS) {
if ( post->sms_check( &event->Info.Id))
return 1;
else
post->sms_register( &event->Info.Id);
}
post->replace_symbol( str, event->Msg.Receiver);
rcvnum = dcli_parse( str, ",", "",
(char *) rcv_array, sizeof( rcv_array)/sizeof( rcv_array[0]),
sizeof( rcv_array[0]), 0);
for ( int i = 0; i < rcvnum; i++) {
dcli_trim( str, rcv_array[i]);
s = strrchr( str, '.');
if ( s) {
*s = 0;
strncpy( group, post->systemgroup, sizeof(group));
strncat( group, ".", sizeof(group));
strncat( group, str, sizeof(group));
strncpy( user, s+1, sizeof(user));
}
else {
strncpy( group, post->systemgroup, sizeof(group));
strncpy( user, str, sizeof(user));
}
SystemName *sn = new SystemName( group);
sts = sn->parse();
if ( EVEN(sts)) {
delete sn;
errh_Error( "Post systemgroup parse error, %m", sts);
continue;
}
SystemList *sl = post->udb->find_system( sn);
delete sn;
if ( !sl) {
errh_Error( "No such system group, %s", group);
continue;
}
UserList *ul = (UserList *) sl->find_user( user);
if ( !ul) {
errh_Error( "No such user, %s", user);
continue;
}
if ( event->Info.EventFlags & pwr_mEventFlagsMask_Email &&
strcmp( post->conf->EmailCmd, "") != 0) {
char address[40];
pwr_tCmd cmd;
ul->get_email( address, sizeof(address));
post->format_email_text( MsgP, text, sizeof(text));
post->format_cmd( cmd, post->conf->EmailCmd, address, text);
if ( post->conf->Options & pwr_mPostOptionsMask_Log)
//.........这里部分代码省略.........