// // Copyright 2000 Perforce Software. All rights reserved. // // This file is part of Perforce - the FAST SCM System. // // p4wBranchesPane: // Displays output of the branches command #include <p4wp4.h> #include "p4wStrBuf.h" #include "p4wPane.h" #include "p4wPasswdTestPane.h" p4wPasswdTestPane::p4wPasswdTestPane( p4wView & ParentView, p4wRequest & Request ) : p4wPane(ParentView, Request), fHadPasswordError(0), fSetError(0), fHadLoginError(0), fHadUnicodeError(0), fHadSSLError(0), fHadGroupError(0), fCheckGroup(0), fTestClient(0) { fClientRoot.Set(""); fUnknownClient = fRequest.fUnknownClient; } p4wPasswdTestPane::~p4wPasswdTestPane() { } void p4wPasswdTestPane::RenderError( char *error, int escapeHTML ) { // // Set flag that specifically indicates if we had // a password violation error, or a p4 login error if( strstr( error, "P4PASSWD" ) ) fHadPasswordError = 1; if( strstr( error, "p4 login" ) ) fHadLoginError = 1; if( strstr( error, "Unicode server permits" ) ) fHadUnicodeError = 1; if( strstr( error, "server using SSL" ) ) fHadSSLError = 1; // // Save error string, and set flag indicating we // had any sort of error. fErrorText.Set( error ); fSetError = 1; } void p4wPasswdTestPane::RenderInfo( char *data, char level ) { if (fCheckGroup && !strcmp(data, fRequest.GetGroup().Text())) fHadGroupError = 0; else if (strstr(data, "Client root: ") == data) fClientRoot.Set(data + sizeof("Client Root: ")-1); } void p4wPasswdTestPane::Prompt( const StrPtr &msg, StrBuf &rsp, int noEcho, Error *e ) { // // Send back the old or new password based on what the // server is asking for. if( strstr( msg.Text(), "old" ) ) rsp.Set( fView.GetOldPasswd() ); else rsp.Set( fView.GetNewPasswd() ); } void p4wPasswdTestPane::Render( StrDict * varList ) { StrPtr *clientRoot = varList->GetVar( "clientRoot" ); if (clientRoot) fClientRoot.Set(clientRoot); else if (fTestClient) { StrPtr *clientName = varList->GetVar( "clientName" ); if (!clientName || !strcmp(clientName->Text(), "*unknown*")) fUnknownClient = 1; } if (fCheckGroup) { StrPtr *group = varList->GetVar( "group" ); if (group) { StrPtr *user = varList->GetVar( "user" ); if (user) { if (!strcmp(group->Text(), fRequest.GetGroup().Text()) && !strcmp(user->Text(), fRequest.GetUser().Text())) fHadGroupError = 0; } } } }
# | 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/Panes/p4wPasswdTestPane.cpp | |||||
#1 | 8914 | Matt Attaway | Initial add of the P4Web source code |