void AIMNetManager::DataReceived( nlID nid ) { // decide what to do based on the connection type, eh? switch( nid.type ) { // authorization server connection case NLT_AUTH: { DoLogin(); ProcessAuthServerCommands(); return; } case NLT_MAIN: { // if we're still logging in, keep doing that if( preLoginPhase ) { DoLogin(); return; } // otherwise, it's just a standard AIM command/message ProcessMainServerCommands(); } } }
void AIMNetManager::Connected( nlID nid ) { printf( "AIMNetManager::Connected\n" ); // if this is the auth netlet, continue the login process if( nid.type == NLT_AUTH ) DoLogin( NULL ); // if this is the main netlet, well, do pretty much the same thing if( nid.type == NLT_MAIN ) DoLogin( NULL ); }
int DealRequest(int sock, char *buf) { int ret = 0; printf("Deal Request\n"); if(strncasecmp(buf, "login", 5) != 0 && logined != 1) { msend(sock, "401 Please login first\r\n"); return -1; } if(strncasecmp(buf, "list", 4) == 0) { ret = DoList(sock, buf); } else if(strncasecmp(buf, "cd", 2) == 0) { ret = DoChdir(sock, buf); } else if(strncasecmp(buf, "login", 5) == 0) { ret = DoLogin(sock, buf); } else if(strncasecmp(buf, "get", 3) == 0) { ret = DoGet(sock, buf); } else if(strncasecmp(buf, "quit", 4) == 0) { ret = DoQuit(sock, buf); } else { printf("Unknown Request:%s\n", buf); msend(sock, "400 Unknown command\r\n"); } return ret; }
void SjMainWindow::Timer_Constructed() { #ifndef Q_OS_OSX connect(g_pTheApp, SIGNAL(showUp()), this, SLOT(ToScr_Primary())); #endif Scr_Logs * l = Scr_Logs::Instance(); qApp->installEventFilter(this); if (l->IsExists()) // force construction if (Ctr_Openvpn::Instance()->IsOvRunning()) Ctr_Openvpn::Instance()->KillRunningOV(); AuthManager::Instance()->DetermineOldIp(); if (Setting::Instance()->IsCheckForUpdates()) { AuthManager::Instance()->StartDwnl_Updates(); } if (Setting::Instance()->IsAutoconnect()) { _ConnectAfterLogin = true; DoLogin(); } if (Setting::Instance()->IsInsecureWifi()) { StartWifiWatcher(); } }
void TLoginWindow::OnLoginButtonClicked() { qDebug() << Q_FUNC_INFO; if (CaptchaEdit->text().size() != 0 && LoginEdit->text().size() != 0 && PasswordEdit->text().size() != 0) { emit DoLogin(CaptchaEdit->text(), PasswordEdit->text()); } if (LoginEdit->text().size() != 0) { emit Login(LoginEdit->text()); } }
void TokenPolicyMgr::Run() { Options * options = Options::Instance(); sockaddr_in dst; dst.sin_family = AF_INET; dst.sin_port = htons(atoi(options->ControlPort.c_str())); dst.sin_addr.s_addr = inet_addr(options->ControlAddress.c_str()); while (true) { int err = connect(m_Sock, (sockaddr*)&dst, sizeof dst); if (err == -1) { SecondSleep(2); continue; } while (true) { uint8_t cType = 0; int err = recv(m_Sock, (char*)&cType, 1, 0); if (err <= 0) { break; } uint16_t iLen = 0; err = recv(m_Sock, (char*)&iLen, sizeof iLen, 0); iLen = ntohs(iLen); printf("cType=%d, iLen=%d\n", cType, iLen); char Buffer[1024]; err = recv(m_Sock, Buffer, iLen, 0); switch (cType) { case 1: // 登入命令 DoLogin(Buffer, iLen); break; case 2: // 登出命令 DoLogout(Buffer, iLen); break; case 3: // 策略下发 DoPolicy(Buffer, iLen); break; default: break; } } } }
LRESULT CMainFrame::OnInitialize(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(wParam); UNREFERENCED_PARAMETER(lParam); //m_stateMgr.Initialize(regPath, m_hWnd, SW_SHOWMAXIMIZED); //m_stateMgr.Restore(); DoLogout(); DoLogin(); //UISetCheck(ID_EDIT_SHOW_ORPHANS,1); //UISetCheck(ID_EDIT_SHOW_MATCHING,1); //UISetCheck(ID_EDIT_SHOW_NOT_MATCHING,1); return 0; }
void CMainFrame::OnFileLogout() { DoLogout(); DoLogin(); }