Example #1
0
/**
* \brief Function to check user on database
* \fn bool exist(bool flagForChangePwd)
* \param flagForChangePwd A flag to check the password state
* \return true if the password state has not to be checked else false
*/
bool
UserServer::exist(bool flagForChangePwd) {
  //if the user is on the database
  if (getAttribut("where userid='"+muser.getUserId()+"'and pwd='"+muser.getPassword()+"'").size() != 0) {
    CheckUserState(flagForChangePwd);
    return true;
  }//END if the user is on the database
  else {
    return false;
  }
} //END: exist(bool flagForChangePwd)
Example #2
0
/**
* \brief Function to check user on database
* \return true if the user is authenticated else false
*/
bool
UserServer::isAuthenticate(bool flagForChangePwd) {

  bool existUser = false;
  AuthenticatorFactory authFactory;
  Authenticator *authenticatorInstance = authFactory.getAuthenticatorInstance();

  existUser = authenticatorInstance->authenticate(muser);
  if (existUser) {
    CheckUserState(flagForChangePwd);
  }
  return existUser;
}
Example #3
0
void PasClient::TimeWork()
{
	/*
	 * 1.将超时的连接去掉;
	 * 2.定时发送NOOP消息
	 * 3.Reload配置文件中的新的连接。
	 * 4.
	 */
	while(1)
	{
		if ( ! Check() ) break ;

		// 检测用户状态
		CheckUserState( _user ) ;

		// 十分钟超时检测
		_pEnv->GetMsgCache()->CheckData( 600 ) ;

		// PCCMSG_LOG( _pEnv->GetLogger(), "127.0.0.1", 8888 , "0431", "ERROR", "取得车牌号%s值对应关系失败", "test" ) ;

		sleep(3) ;
	}
}