|
Synopsis
Create or edit Perforce user specifications and preferences.
Syntax
p4 [g-opts] user [-f] [username] p4 [g-opts] user -d [-f] username p4 [g-opts] user -o [username] p4 [g-opts] user -i [-f]
Description
By default, any system user becomes a valid Perforce user the first time he uses any Perforce command; Perforce automatically creates a user spec with default settings for the invoking user. Use the p4 user command to edit these settings or to create new user records.
Perforce superusers can prevent random users from accessing Perforce with p4 protect.
When p4 user is called, a form is brought up in the editor defined by the P4EDITOR environment or registry variable. Perforce expects the form's entries to be entered in Perforce's standard forms format.
When called without a username, p4 user edits specification of the current user. When called with a username, the user specification is displayed, but can't be changed. Perforce superusers can edit other users' specifications with the -f (force) flag: p4 user -f username.
The user who gives a Perforce command is not necessarily the user under whose name the command runs. The user for any particular command is determined by the following:
- If the user running the command is a Perforce superuser, and uses the syntax p4 user -f username, user username will be edited.
- If the -u username flag is used on the command line (for instance, p4 -u joe submit), the command runs as that user (a password may be required);
- If the above hasn't been done, but the file pointed to by the P4CONFIG environment or registry variable contains a setting for P4USER, then the command runs as that user.
- If neither of the above has been done, but the P4USER environment or registry variable has been set, then the command runs as that user.
- If none of the above apply, then the username is taken from the OS level USER or USERNAME environment variable.
Form Fields
Field Name
|
Type
|
Description
|
---|
User:
|
Read-only
|
The Perforce username under which p4 user was invoked. By default, this is the user's system username.
|
Email:
|
Writable
|
The user's email address. By default, this is user@client.
|
Update:
|
Read-only
|
The date and time this specification was last updated.
|
Access:
|
Read-only
|
The date and time this user last ran a Perforce command.
|
FullName:
|
Writable
|
The user's full name.
|
JobView:
|
Writable
|
A description of the jobs to appear automatically on all new changelists (described in the Usage Notes below).
|
Password:
|
Writable
|
The user's password (described in the Usage Notes below).
|
Reviews:
|
Writable List
|
A list of files the user would like to review (see the Usage Notes below).
|
Options
-d username
|
Deletes the specified user. Only user username, or the Perforce superuser, can run this command.
|
-f
|
Superuser force flag; allows the superuser to modify or delete the specified user.
|
-i
|
Read the user specification from standard input. The input must conform to the p4 user form's format.
|
-o
|
Write the user specification to standard output.
|
g_opts
|
See the Global Options section.
|
Usage Notes
Can File Arguments Use Revision Specifier?
|
Can File Arguments Use Revision Range?
|
Minimal Access Level Required
|
---|
N/A
|
N/A
|
list
|
- The -d flag may be used by non-superusers only to delete the user specification that the command runs as. Perforce superusers can delete any Perforce user.
- User deletion fails if the specified user has any open files. Submit (or revert) these files before deleting users.
- Passwords can be created, edited, or changed in the p4 user form or with the p4 passwd command. If you edit a password in the p4 user form, do not use the comment character # within the password; Perforce interprets everything following that character on the same line is a comment, and does not store it as part of the password.
- No matter what the length of the password is, it is displayed as six asterisks whenever you subsequently call p4 user.
- By default, user records are created without passwords, and any Perforce user can impersonate another by setting P4USER or by using the globally available -u flag. To prevent another user from impersonating you, set the value of the Password: field to any string that doesn't contain whitespace or the comment character #. Once a password has been set, it must be provided to each Perforce command; this can be done in one of three ways:
- The value of the environment or registry variable P4PASSWD can be set to the password value;
- The file pointed to by P4CONFIG can contain a setting for P4PASSWD;
- The -P password flag can be used on the command line, as in p4 -u ida -P idapwd submit.
- Each of these three methods overrides the methods above it. For more information on passwords, please see p4 passwd.
- then the change review daemon sends joe email whenever any README file has been submitted, and whenever any file under //depot/foo has been submitted.
- If you the Jobview: field to any valid jobview, jobs matching the jobview appear on any changelists created by this user. Jobs that are fixed by the changelist should be left in the changelist when it's submitted with p4 submit; other jobs should be deleted from the form before submission.
- For example, suppose the jobs at your site have a field called Owned-By:. If you set the Jobview: field on your p4 user form to Owned-By=yourname&status=open, all open jobs owned by you appear on all changelists you create. Please see p4 jobs for a full description of jobview usage and syntax.
Examples
p4 user joe
|
View the user specification of Perforce user joe.
|
p4 user
|
Edit the user specification for the current Perforce user.
|
p4 user -d sammy
|
Delete the user specification for the Perforce user sammy.
|
p4 -u joe -P hey submit
|
Run p4 submit as user joe, whose password is hey.
|
Related Commands
To view a list of all Perforce users
|
p4 users
|
To change a user's password
|
p4 passwd
|
To view a list of users who have subscribed to review particular files
|
p4 reviews
|
|