Mercurial > mercurial > hgweb_rsearcher.cgi
diff src/auth.cpp @ 5:e3b10fb860b3
release v1.0.
author | pyon@macmini |
---|---|
date | Mon, 22 Oct 2018 22:17:02 +0900 |
parents | 06342fc544e4 |
children | 9a8b581c1993 |
line wrap: on
line diff
--- a/src/auth.cpp Mon Oct 15 20:07:38 2018 +0900 +++ b/src/auth.cpp Mon Oct 22 22:17:02 2018 +0900 @@ -1,5 +1,5 @@ // Filename : auth.cpp -// Last Change: 2018-10-12 金 16:17:32. +// Last Change: 2018-10-22 月 16:11:52. // #include "id.h" @@ -28,23 +28,6 @@ // Event Handler void AuthDialog::OnShow( wxShowEvent& WXUNUSED(event) ) { - if ( m_load ) return; - wxArrayString args; // http get ( auth.db, hhs.db, index.db ) - args.Add( wxT( "client.exe" ) ); - args.Add( wxT( "-u" ) ); - args.Add( m_server ); - - wxExecute( wxJoin( args, ' ', '\\' ), wxEXEC_SYNC|wxEXEC_HIDE_CONSOLE ); - - wxTextFile file; - file.Open( wxT( "auth.db" ) ); - for ( int i = 0; i < file.GetLineCount(); i++ ) { - wxArrayString line = wxSplit( file.GetLine( i ), ' ', '\\' ); - m_users.Add( line[ 0 ] ); - } - file.Close(); - - m_load = true; } void AuthDialog::OnCheckUserID( wxCommandEvent& WXUNUSED(event) ) @@ -136,6 +119,27 @@ m_textCtrlId->SetFocus(); } +bool AuthDialog::LoadDB( void ) +{ + // http get ( auth.db, hhs.db, index.db ) + wxArrayString args; + args.Add( wxT( "client.exe" ) ); + args.Add( wxT( "-u" ) ); + args.Add( m_server ); + + wxExecute( wxJoin( args, ' ', '\\' ), wxEXEC_SYNC|wxEXEC_HIDE_CONSOLE ); + + // load db + wxTextFile file; + if ( !file.Open( wxT( "auth.db" ) ) ) return false; + for ( int i = 0; i < file.GetLineCount(); i++ ) { + wxArrayString line = wxSplit( file.GetLine( i ), ' ', '\\' ); + m_users.Add( line[ 0 ] ); + } + file.Close(); + return true; +} + bool AuthDialog::IsValidUser( void ) { wxString id = m_textCtrlId->GetValue(); @@ -158,7 +162,6 @@ void AuthDialog::InDevelop( bool flag ) { - return; if ( !flag ) return; m_textCtrlId->SetValue( "test" ); m_textCtrlPw->SetValue( "test" );