// // Copyright 2000 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wPasswdTestView: // Run a small command to see if we get a password error #include <stdlib.h> #include <string.h> #include <p4wp4.h> #include "p4wView.h" #include "p4wPasswdTestView.h" #include "p4wPasswdTestPane.h" #include "p4wClientRootPane.h" p4wPasswdTestView::p4wPasswdTestView( p4wRequest & Request ) : p4wView(Request), fHadPasswordError(0), fHadLoginError(0), fHadUnicodeError(0), fHadGroupError(0), fHadClientError(0), fHadSSLError(0), fHadMiscError(0), fHadAnyError(0), fCheckClient(0) { } p4wPasswdTestView::~p4wPasswdTestView() { } void p4wPasswdTestView::Render() { if (fCheckClient && !fRequest.GetBrowseMode() && !SEC_ALLOW_ALL_CLIENTS && !fRequest.isLocalRequest() && fRequest.GetIsTagged() && fRequest.GetCmd() != AC_CONFIGURATION && fRequest.GetCmd() != AC_CONFIGPROCESSOR && fRequest.GetCmd() != AC_MULTIUSER && fRequest.GetCmd() != AC_MULTIUSERPROCESSOR && fRequest.GetCmd() != AC_CLIENTS && fRequest.GetCmd() != AC_CLIENTVIEW && fRequest.GetCmd() != AC_CLIENTSWITCH && fRequest.GetCmd() != AC_CLIENTSPROCESSOR && fRequest.GetCmd() != AC_LOGOUT && fRequest.GetCmd() != AC_LOGOUT2) { if (fRequest.fClientRun) { fHadClientError = fRequest.fHadClientError; fErrorText.Set(fRequest.fErrorText); } else { p4wClientRootPane clientRootPane(*this, fRequest); const char *cliArgs[] = { "-o" }; fRequest.p4("client", 1, cliArgs, &clientRootPane); fRequest.p4Wait(); fRequest.fHadClientError = fHadClientError = clientRootPane.IsInvalidClient(); if (fHadClientError) { fErrorText.Set(clientRootPane.GetErrorMsg()); fRequest.fErrorText.Set(fErrorText); } else { if (SEC_ALLOW_UNOWNED_CLIENTS && !clientRootPane.GetOwner().Length()) ; else if (strcmp(clientRootPane.GetOwner().Text(), fRequest.GetUser().Text())) fRequest.fHadClientError = fHadClientError = 1; if (!SEC_ALLOW_NOHOST_CLIENTS && !clientRootPane.GetHost().Length()) { fRequest.fHadClientError = fHadClientError = 1; fErrorText.Set("Clients whose host field is not specified can not be used."); fRequest.fErrorText.Set(fErrorText); } } if (!fHadClientError) fRequest.fClientRun = 1; } } if (fRequest.fGroupsRun) { fHadPasswordError = fRequest.fHadPasswordError; fHadLoginError = fRequest.fHadLoginError; fHadUnicodeError = fRequest.fHadUnicodeError; fHadGroupError = fRequest.fHadGroupError; fHadSSLError = fRequest.fHadSSLError; fHadAnyError = fRequest.fHadAnyError; fHadMiscError = fRequest.fHadMiscError; fErrorText.Set(fRequest.fErrorText); } else { p4wPasswdTestPane errorPane( *this, fRequest ); if (fRequest.GetMultiUser() && fRequest.GetGroup().Length()) { errorPane.SetCheckGroup(1); fRequest.p4Arg( fRequest.GetUser().Text() ); fRequest.p4( "groups", 0, 0, &errorPane ); } else { fRequest.p4Arg( "change" ); fRequest.p4( "counter", 0, 0, &errorPane ); } fRequest.p4Wait(); if( errorPane.FatalError() ) fHadAnyError = 1; if( errorPane.HadPasswordError() ) fHadPasswordError = 1; if( errorPane.HadLoginError() ) fHadLoginError = 1; if( errorPane.HadUnicodeError() ) fHadUnicodeError = 1; if( errorPane.HadSSLError() ) fHadSSLError = 1; if( errorPane.GotError() ) { fHadAnyError = 1; fErrorText.Set(errorPane.GetErrorMsg()); } if (fRequest.GetMultiUser() && fRequest.GetGroup().Length()) if( errorPane.HadGroupError() ) fHadGroupError = fHadAnyError = 1; fRequest.fHadPasswordError = fHadPasswordError; fRequest.fHadLoginError = fHadLoginError; fRequest.fHadUnicodeError = fHadUnicodeError; fRequest.fHadGroupError = fHadGroupError; fRequest.fHadSSLError = fHadSSLError; fRequest.fHadAnyError = fHadAnyError; fRequest.fHadMiscError = fHadMiscError; fRequest.fErrorText.Set(fErrorText); if (!fHadGroupError && !fHadPasswordError && !fHadLoginError && !fHadUnicodeError && !fHadSSLError && !fHadMiscError && !fHadAnyError) fRequest.fGroupsRun = 1; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 12234 | Matt Attaway |
Rejigger P4Web project in preparation for official sunsetting The bin directory contains the last official builds of P4Web from the Perforce download site. P4Web is soon to be completely sunsetted; these builds are here for folks who don't want to build their own. To better handle the archived builds the source code has been moved into a separate src directory. |
||
//guest/perforce_software/p4web/Views/p4wPasswdTestView.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |