Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CONTENTCONTROLDIALOG_H
  8. #define CONTENTCONTROLDIALOG_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "vgui_controls/Frame.h"
  13. //-----------------------------------------------------------------------------
  14. // Purpose:
  15. //-----------------------------------------------------------------------------
  16. class CContentControlDialog : public vgui::Frame
  17. {
  18. DECLARE_CLASS_SIMPLE( CContentControlDialog, vgui::Frame );
  19. public:
  20. CContentControlDialog(vgui::Panel *parent);
  21. ~CContentControlDialog();
  22. virtual void OnCommand( const char *command );
  23. virtual void OnClose();
  24. virtual void Activate();
  25. void ResetPassword();
  26. void ApplyPassword();
  27. bool IsPasswordEnabledInDialog();
  28. bool IsPasswordEnabled() { return ( m_szGorePW[0] != 0 ); }
  29. protected:
  30. void WriteToken( const char *str );
  31. bool CheckPassword( char const *oldPW, char const *newPW, bool enableContentControl );
  32. void UpdateContentControlStatus( void );
  33. void Explain( PRINTF_FORMAT_STRING char const *fmt, ... );
  34. void HashPassword(const char *newPW, char *hashBuffer, int maxlen );
  35. bool EnablePassword(const char *newPW);
  36. bool DisablePassword(const char *oldPW);
  37. enum
  38. {
  39. MAX_GORE_PW = 64,
  40. };
  41. char m_szGorePW[ MAX_GORE_PW ];
  42. bool m_bDefaultPassword;
  43. vgui::Label *m_pStatus;
  44. vgui::Button *m_pOK;
  45. vgui::TextEntry *m_pPassword;
  46. vgui::Label *m_pPasswordLabel;
  47. vgui::Label *m_pPassword2Label;
  48. vgui::TextEntry *m_pPassword2;
  49. vgui::Label *m_pExplain;
  50. };
  51. #endif // CONTENTCONTROLDIALOG_H