SourceControl.P4.AllowNonTicketLogins

SourceControl.P4.AllowNonTicketLogins

#Overview

name: SourceControl.P4.AllowNonTicketLogins

This variable is created as a Console Variable (cvar).

It is referenced in 6 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of SourceControl.P4.AllowNonTicketLogins is to control whether non-ticket-based logins are allowed in the Perforce source control integration for Unreal Engine. This setting is primarily related to the source control system, specifically for Perforce.

This setting variable is used in the Perforce Source Control plugin for Unreal Engine. It’s part of the Developer plugins category and is utilized in the PerforceSourceControl module.

The value of this variable is set using an FAutoConsoleVariableRef, which means it can be modified at runtime through console commands. By default, it’s set to false.

The associated variable bAllowP4NonTicketBasedLogins directly interacts with SourceControl.P4.AllowNonTicketLogins. They share the same value, and bAllowP4NonTicketBasedLogins is used throughout the code to control the visibility of certain UI elements related to non-ticket-based logins.

Developers must be aware that enabling this option (setting it to true) is considered less secure. As mentioned in the comment, Perforce may store the password as plain text in environment variables, which poses a security risk.

Best practices when using this variable include:

  1. Keeping it disabled (false) in most scenarios to maintain security.
  2. Only enabling it when absolutely necessary and understanding the security implications.
  3. If enabled, ensure that other security measures are in place to protect user credentials.

Regarding the associated variable bAllowP4NonTicketBasedLogins:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Developer/PerforceSourceControl/Source/PerforceSourceControl/Private/SPerforceSourceControlSettings.cpp:25

Scope: file

Source code excerpt:

static bool bAllowP4NonTicketBasedLogins = false;
FAutoConsoleVariableRef CVarAllowP4NonTicketBasedLogins(
	TEXT("SourceControl.P4.AllowNonTicketLogins"),
	bAllowP4NonTicketBasedLogins,
	TEXT("Whether or not to allow logging in with a password directly from the perforce dialog. This is off by default because it is not a secure option. Perforce often your password as plain text in their enviroment variables")
);

void SPerforceSourceControlSettings::Construct(const FArguments& InArgs, FPerforceSourceControlProvider* InSCCProvider)
{

#Associated Variable and Callsites

This variable is associated with another variable named bAllowP4NonTicketBasedLogins. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Plugins/Developer/PerforceSourceControl/Source/PerforceSourceControl/Private/SPerforceSourceControlSettings.cpp:23

Scope: file

Source code excerpt:

#define LOCTEXT_NAMESPACE "SPerforceSourceControlSettings"

static bool bAllowP4NonTicketBasedLogins = false;
FAutoConsoleVariableRef CVarAllowP4NonTicketBasedLogins(
	TEXT("SourceControl.P4.AllowNonTicketLogins"),
	bAllowP4NonTicketBasedLogins,
	TEXT("Whether or not to allow logging in with a password directly from the perforce dialog. This is off by default because it is not a secure option. Perforce often your password as plain text in their enviroment variables")
);

void SPerforceSourceControlSettings::Construct(const FArguments& InArgs, FPerforceSourceControlProvider* InSCCProvider)
{
	checkf(InSCCProvider != nullptr, TEXT("SPerforceSourceControlSettings Requires a pointer to a valid FPerforceSourceControlProvider to function"));

#Loc: <Workspace>/Engine/Plugins/Developer/PerforceSourceControl/Source/PerforceSourceControl/Private/SPerforceSourceControlSettings.cpp:115

Scope (from outer to inner):

file
function     void SPerforceSourceControlSettings::Construct

Source code excerpt:

			[
				SNew(STextBlock)
				.Visibility(bAllowP4NonTicketBasedLogins ? EVisibility::Visible : EVisibility::Collapsed)
				.Text(LOCTEXT("HostLabel", "Host"))
				.ToolTipText(LOCTEXT("HostLabel_Tooltip", "If you wish to impersonate a particular host, enter this here. This is not normally needed."))
			]
			+ SVerticalBox::Slot()
			.Padding(FMargin(0.0f, 0.0f, 0.0f, 10.0f))
			.VAlign(VAlign_Center)

#Loc: <Workspace>/Engine/Plugins/Developer/PerforceSourceControl/Source/PerforceSourceControl/Private/SPerforceSourceControlSettings.cpp:125

Scope (from outer to inner):

file
function     void SPerforceSourceControlSettings::Construct

Source code excerpt:

			[
				SNew(STextBlock)
				.Visibility(bAllowP4NonTicketBasedLogins ? EVisibility::Visible : EVisibility::Collapsed)
				.Text(LOCTEXT("PasswordLabel", "Password"))
				.ToolTipText(LOCTEXT("PasswordLabel_Tooltip", "Perforce password. This normally only needs to be entered if your ticket has expired."))
			]
		]
		+SHorizontalBox::Slot()
		.FillWidth(2.0f)

#Loc: <Workspace>/Engine/Plugins/Developer/PerforceSourceControl/Source/PerforceSourceControl/Private/SPerforceSourceControlSettings.cpp:195

Scope: file

Source code excerpt:

			[
				SNew(SEditableTextBox)
				.Visibility(bAllowP4NonTicketBasedLogins ? EVisibility::Visible : EVisibility::Collapsed)
				.Text(this, &SPerforceSourceControlSettings::GetHostText)
				.ToolTipText(LOCTEXT("HostLabel_Tooltip", "If you wish to impersonate a particular host, enter this here. This is not normally needed."))
				.OnTextCommitted(this, &SPerforceSourceControlSettings::OnHostTextCommitted)
				.OnTextChanged(this, &SPerforceSourceControlSettings::OnHostTextCommitted, ETextCommit::Default)
			]
			+ SVerticalBox::Slot()

#Loc: <Workspace>/Engine/Plugins/Developer/PerforceSourceControl/Source/PerforceSourceControl/Private/SPerforceSourceControlSettings.cpp:206

Scope (from outer to inner):

file
function     void SPerforceSourceControlSettings::Construct

Source code excerpt:

			[
				SAssignNew(PasswordTextBox, SEditableTextBox)
				.Visibility(bAllowP4NonTicketBasedLogins ? EVisibility::Visible : EVisibility::Collapsed)
				.ToolTipText(LOCTEXT("PasswordLabel_Tooltip", "Perforce password. This normally only needs to be entered if your ticket has expired."))
				.IsPassword(true)
			]
		]	
	];