Open-Source-Software-Entwicklung und Downloads

Browse Subversion Repository

Diff of /trunk/ttssh2/ttxssh/auth.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2939 by maya, Wed Nov 29 16:58:52 2006 UTC revision 2943 by maya, Wed Dec 6 14:25:40 2006 UTC
# Line 42  SOFTWARE, EVEN IF ADVISED OF THE POSSIBI Line 42  SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
42    
43  #define MAX_AUTH_CONTROL IDC_SSHUSETIS  #define MAX_AUTH_CONTROL IDC_SSHUSETIS
44    
45    #ifdef I18N
46    static HFONT DlgAuthFont;
47    static HFONT DlgTisFont;
48    static HFONT DlgAuthSetupFont;
49    #endif
50    
51  void destroy_malloced_string(char FAR * FAR * str)  void destroy_malloced_string(char FAR * FAR * str)
52  {  {
53          if (*str != NULL) {          if (*str != NULL) {
# Line 653  static BOOL CALLBACK auth_dlg_proc(HWND Line 659  static BOOL CALLBACK auth_dlg_proc(HWND
659          const int IDC_TIMER1 = 300;          const int IDC_TIMER1 = 300;
660          const int autologin_timeout = 10; // ミリ秒          const int autologin_timeout = 10; // ミリ秒
661          PTInstVar pvar;          PTInstVar pvar;
662    #ifdef I18N
663            LOGFONT logfont;
664            HFONT font;
665    #endif
666    
667          switch (msg) {          switch (msg) {
668          case WM_INITDIALOG:          case WM_INITDIALOG:
# Line 662  static BOOL CALLBACK auth_dlg_proc(HWND Line 672  static BOOL CALLBACK auth_dlg_proc(HWND
672    
673                  init_auth_dlg(pvar, dlg);                  init_auth_dlg(pvar, dlg);
674    
675    #ifdef I18N
676                    font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0);
677                    GetObject(font, sizeof(LOGFONT), &logfont);
678                    if (UTIL_get_lang_font("DLG_ABOUT_FONT", dlg, &logfont, &DlgAuthFont, pvar)) {
679                            SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
680                            SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER2, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
681                            SendDlgItemMessage(dlg, IDC_SSHUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
682                            SendDlgItemMessage(dlg, IDC_SSHPASSWORDCAPTION, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
683                            SendDlgItemMessage(dlg, IDC_REMEMBER_PASSWORD, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
684                            SendDlgItemMessage(dlg, IDC_SSHUSEPASSWORD, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
685                            SendDlgItemMessage(dlg, IDC_SSHUSERSA, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
686                            SendDlgItemMessage(dlg, IDC_CHOOSERSAFILE, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
687                            SendDlgItemMessage(dlg, IDC_SSHUSERHOSTS, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
688                            SendDlgItemMessage(dlg, IDC_LOCALUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
689                            SendDlgItemMessage(dlg, IDC_CHOOSEHOSTRSAFILE, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
690                            SendDlgItemMessage(dlg, IDC_SSHUSETIS, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
691                            SendDlgItemMessage(dlg, IDOK, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
692                            SendDlgItemMessage(dlg, IDCANCEL, WM_SETFONT, (WPARAM)DlgAuthFont, MAKELPARAM(TRUE,0));
693                    }
694                    else {
695                            DlgAuthFont = NULL;
696                    }
697    #endif
698    
699                  // SSH2 autologinが有効の場合は、タイマを仕掛ける。 (2004.12.1 yutaka)                  // SSH2 autologinが有効の場合は、タイマを仕掛ける。 (2004.12.1 yutaka)
700                  if (pvar->ssh2_autologin == 1) {                  if (pvar->ssh2_autologin == 1) {
701                          SetTimer(dlg, IDC_TIMER1, autologin_timeout, 0);                          SetTimer(dlg, IDC_TIMER1, autologin_timeout, 0);
# Line 686  static BOOL CALLBACK auth_dlg_proc(HWND Line 720  static BOOL CALLBACK auth_dlg_proc(HWND
720                          if (pvar->userauth_retry_count == 0 && (pvar->ssh_state.status_flags & STATUS_DONT_SEND_USER_NAME)) {                          if (pvar->userauth_retry_count == 0 && (pvar->ssh_state.status_flags & STATUS_DONT_SEND_USER_NAME)) {
721                                  return FALSE;                                  return FALSE;
722                          }                          }
723    
724    #ifdef I18N
725                            if (DlgAuthFont != NULL) {
726                                    DeleteObject(DlgAuthFont);
727                            }
728    #endif
729    
730                          return end_auth_dlg(pvar, dlg);                          return end_auth_dlg(pvar, dlg);
731    
732                  case IDCANCEL:                  /* kill the connection */                  case IDCANCEL:                  /* kill the connection */
733                          pvar->auth_state.auth_dialog = NULL;                          pvar->auth_state.auth_dialog = NULL;
734                          notify_closed_connection(pvar);                          notify_closed_connection(pvar);
735                          EndDialog(dlg, 0);                          EndDialog(dlg, 0);
736    
737    #ifdef I18N
738                            if (DlgAuthFont != NULL) {
739                                    DeleteObject(DlgAuthFont);
740                            }
741    #endif
742    
743                          return TRUE;                          return TRUE;
744    
745                  case IDC_SSHUSEPASSWORD:                  case IDC_SSHUSEPASSWORD:
# Line 933  static BOOL CALLBACK TIS_dlg_proc(HWND d Line 981  static BOOL CALLBACK TIS_dlg_proc(HWND d
981                                                                    LPARAM lParam)                                                                    LPARAM lParam)
982  {  {
983          PTInstVar pvar;          PTInstVar pvar;
984    #ifdef I18N
985            LOGFONT logfont;
986            HFONT font;
987    #endif
988    
989          switch (msg) {          switch (msg) {
990          case WM_INITDIALOG:          case WM_INITDIALOG:
# Line 941  static BOOL CALLBACK TIS_dlg_proc(HWND d Line 993  static BOOL CALLBACK TIS_dlg_proc(HWND d
993                  SetWindowLong(dlg, DWL_USER, lParam);                  SetWindowLong(dlg, DWL_USER, lParam);
994    
995                  init_TIS_dlg(pvar, dlg);                  init_TIS_dlg(pvar, dlg);
996    
997    #ifdef I18N
998                    font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0);
999                    GetObject(font, sizeof(LOGFONT), &logfont);
1000                    if (UTIL_get_lang_font("DLG_ABOUT_FONT", dlg, &logfont, &DlgTisFont, pvar)) {
1001                            SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0));
1002                            SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER2, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0));
1003                            SendDlgItemMessage(dlg, IDOK, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0));
1004                            SendDlgItemMessage(dlg, IDCANCEL, WM_SETFONT, (WPARAM)DlgTisFont, MAKELPARAM(TRUE,0));
1005                    }
1006                    else {
1007                            DlgTisFont = NULL;
1008                    }
1009    #endif
1010    
1011                  return FALSE;                   /* because we set the focus */                  return FALSE;                   /* because we set the focus */
1012    
1013          case WM_COMMAND:          case WM_COMMAND:
# Line 948  static BOOL CALLBACK TIS_dlg_proc(HWND d Line 1015  static BOOL CALLBACK TIS_dlg_proc(HWND d
1015    
1016                  switch (LOWORD(wParam)) {                  switch (LOWORD(wParam)) {
1017                  case IDOK:                  case IDOK:
1018    #ifdef I18N
1019                            if (DlgTisFont != NULL) {
1020                                    DeleteObject(DlgTisFont);
1021                            }
1022    #endif
1023    
1024                          return end_TIS_dlg(pvar, dlg);                          return end_TIS_dlg(pvar, dlg);
1025    
1026                  case IDCANCEL:                  /* kill the connection */                  case IDCANCEL:                  /* kill the connection */
1027                          pvar->auth_state.auth_dialog = NULL;                          pvar->auth_state.auth_dialog = NULL;
1028                          notify_closed_connection(pvar);                          notify_closed_connection(pvar);
1029                          EndDialog(dlg, 0);                          EndDialog(dlg, 0);
1030    
1031    #ifdef I18N
1032                            if (DlgTisFont != NULL) {
1033                                    DeleteObject(DlgTisFont);
1034                            }
1035    #endif
1036    
1037                          return TRUE;                          return TRUE;
1038    
1039                  default:                  default:
# Line 1140  static BOOL CALLBACK default_auth_dlg_pr Line 1220  static BOOL CALLBACK default_auth_dlg_pr
1220                                                                                     WPARAM wParam, LPARAM lParam)                                                                                     WPARAM wParam, LPARAM lParam)
1221  {  {
1222          PTInstVar pvar;          PTInstVar pvar;
1223    #ifdef I18N
1224            LOGFONT logfont;
1225            HFONT font;
1226    #endif
1227    
1228          switch (msg) {          switch (msg) {
1229          case WM_INITDIALOG:          case WM_INITDIALOG:
# Line 1147  static BOOL CALLBACK default_auth_dlg_pr Line 1231  static BOOL CALLBACK default_auth_dlg_pr
1231                  SetWindowLong(dlg, DWL_USER, lParam);                  SetWindowLong(dlg, DWL_USER, lParam);
1232    
1233                  init_default_auth_dlg(pvar, dlg);                  init_default_auth_dlg(pvar, dlg);
1234    
1235    #ifdef I18N
1236                    font = (HFONT)SendMessage(dlg, WM_GETFONT, 0, 0);
1237                    GetObject(font, sizeof(LOGFONT), &logfont);
1238                    if (UTIL_get_lang_font("DLG_ABOUT_FONT", dlg, &logfont, &DlgAuthSetupFont, pvar)) {
1239                            SendDlgItemMessage(dlg, IDC_SSHAUTHBANNER, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1240                            SendDlgItemMessage(dlg, IDC_SSHUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1241                            SendDlgItemMessage(dlg, IDC_SSHUSEPASSWORD, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1242                            SendDlgItemMessage(dlg, IDC_KEYBOARD_INTERACTIVE_CHECK, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1243                            SendDlgItemMessage(dlg, IDC_SSHUSERSA, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1244                            SendDlgItemMessage(dlg, IDC_CHOOSERSAFILE, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1245                            SendDlgItemMessage(dlg, IDC_SSHUSERHOSTS, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1246                            SendDlgItemMessage(dlg, IDC_LOCALUSERNAMELABEL, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1247                            SendDlgItemMessage(dlg, IDC_CHOOSEHOSTRSAFILE, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1248                            SendDlgItemMessage(dlg, IDC_SSHUSETIS, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1249                            SendDlgItemMessage(dlg, IDOK, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1250                            SendDlgItemMessage(dlg, IDCANCEL, WM_SETFONT, (WPARAM)DlgAuthSetupFont, MAKELPARAM(TRUE,0));
1251                    }
1252                    else {
1253                            DlgAuthSetupFont = NULL;
1254                    }
1255    #endif
1256    
1257                  return TRUE;                    /* because we do not set the focus */                  return TRUE;                    /* because we do not set the focus */
1258    
1259          case WM_COMMAND:          case WM_COMMAND:
# Line 1154  static BOOL CALLBACK default_auth_dlg_pr Line 1261  static BOOL CALLBACK default_auth_dlg_pr
1261    
1262                  switch (LOWORD(wParam)) {                  switch (LOWORD(wParam)) {
1263                  case IDOK:                  case IDOK:
1264    
1265    #ifdef I18N
1266                            if (DlgAuthSetupFont != NULL) {
1267                                    DeleteObject(DlgAuthSetupFont);
1268                            }
1269    #endif
1270    
1271                          return end_default_auth_dlg(pvar, dlg);                          return end_default_auth_dlg(pvar, dlg);
1272    
1273                  case IDCANCEL:                  case IDCANCEL:
1274                          EndDialog(dlg, 0);                          EndDialog(dlg, 0);
1275    
1276    #ifdef I18N
1277                            if (DlgAuthSetupFont != NULL) {
1278                                    DeleteObject(DlgAuthSetupFont);
1279                            }
1280    #endif
1281    
1282                          return TRUE;                          return TRUE;
1283    
1284                  case IDC_CHOOSERSAFILE:                  case IDC_CHOOSERSAFILE:
# Line 1330  void AUTH_end(PTInstVar pvar) Line 1451  void AUTH_end(PTInstVar pvar)
1451    
1452  /*  /*
1453   * $Log: not supported by cvs2svn $   * $Log: not supported by cvs2svn $
1454     * Revision 1.22  2006/11/29 16:58:52  maya
1455     * 表示メッセージの読み込み対応
1456     *
1457   * Revision 1.21  2006/11/23 02:19:30  maya   * Revision 1.21  2006/11/23 02:19:30  maya
1458   * 表示メッセージを言語ファイルから読み込みむコードの作成を開始した。   * 表示メッセージを言語ファイルから読み込みむコードの作成を開始した。
1459   *   *

Legend:
Removed from v.2939  
changed lines
  Added in v.2943

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26