Hide Admin - Plugins link from non-administrators

The Admin - Plugins link won't load for users who can't administrate
the server.  We shouldn't show it to these users.

Change-Id: I6c94ba26d0dc7cb7732ef9bba57b52984616c65c
Make RestoreChange accept options/args

In preparation for use in a servlet, RestoreChange should
have annotated options and arguments.

Change-Id: Ic970617ad1f94797c26e53de394ec799fbcdd483
Avoid that permalink is displayed multiple times after restore/abandon

Each time a change was restored/abandoned another permalink for the
change was added to the CommitMessageBlock.

Avoid this by clearing the permalinkPanel before adding the permaLink.
This also ensures that the permalink is removed when the changeId is
null.

Change-Id: I3a58094bdea3a5121957bd2d653b5c92dfcac457
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Show only changes of the same project in the 'Depends On' section

If two projects share the same history it can happen that the same
commit is pushed for both projects, resulting in two changes. If now
a successor commit is pushed for one of the projects, the resulting
successor change lists both changes in the 'Depends On' section on the
ChangeScreen. This is wrong, only the predecessor change of the own
project should be listed in the 'Depends On' section.

Showing the change of the other project in the 'Depends On' section
is especially bad if this other project is not visible to the user
because it reveals that this project exists.

Change-Id: Ibc20eaeab5dff30ab8ac9cc1bb209e5286c6d771
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Add documentation for the emailReviewers capability.

Just realised that the docs were missing. Most of the added docs are
copied from the javadoc in the GlobalCapability.java.

Also fix the javadoc as emailing those who starred the change is done
regardless of the emailReviewers capability.

Change-Id: I12a331e8408da0ca5284344b4cc1a69e2beb3461
Signed-off-by: Sasa Zivkov <sasa.zivkov@sap.com>
Log sign in failures on info level

If for a user signing in into the Gerrit WebUI fails, this can have
many reasons, e.g. username is wrong, password is wrong, user is marked
as inactive, user is locked in the user backend etc. In all cases the
user just gets a generic error message 'Incorrect username or
password.'. Gerrit administrators have trouble to find the exact reason
for the sign in problem because the corresponding AccountException is
not logged.

With this change a log message on info level is written if the sign in
fails with an AccountException. This enables Gerrit administrators to
find out the reason for sign in failures.

Change-Id: I723e9d1813b7bb1c453349356ff373b3df64045b
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Merge "Hide Admin - Plugins link from non-administrators"
Merge "Log sign in failures on info level"
Merge "Avoid that permalink is displayed multiple times after restore/abandon"
Merge "Show only changes of the same project in the 'Depends On' section"
Merge "Add documentation for the emailReviewers capability."
cmd-ls-groups.txt: Remove obsolete reference to LDAP group type

Commit 8363aa5 removed the LDAP member from the AccountGroup.Type
enum but didn't update the corresponding documentation of the
ls-groups SSH command.

Change-Id: Idb5e853334b36172b6b52d63257168f09ebf0701
Add user display formatting to AccountInfo

Since FormatUtil is in a client package it is not
available to be used server side, but it does allow
a user to be easily displayed by their fullname and
to fallback to their email.  It would be convenient
for the server to be able to format users this way
when it needs to return an error message mentioning
the user.  By adding the getName() and getNameEmail()
methods to AccountInfo, it can easily be accessed by
classes in both the client and server packages.

This change does not introduce any callers to these
methods yet, it simply makes them available.

Change-Id: Ia44009e118988c6c87a43c572d9d410f00b032b4
Do not log 'Object too large' as error with full stacktrace

If a user pushes an object which is larger than the configured
receive.maxObjectSizeLimit parameter, the push is rejected with an
'Object too large' error. In addition an error log entry with the full
stacktrace is written into the error log.

This is not really a server error, but just a user doing something that
is not allowed, and thus it should not be logged as error. For a Gerrit
administrator it might still be interesting how often the limit is hit.
This is why it makes sense to still log this on info level.

For the user pushing a too large object we now do not print the
'fatal: Unpack error, check server log' message anymore, but only the
'Object too large' error message.

Change-Id: I5b7228f9b2ce41614712fde4ecd85525de3901a7
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Fix formatting of user in RestApiServlet if username is not set

The error message from RestApiServlet that is displayed if a user
doesn't have a required capability, prints the user's username. This
username may be null, as fallback now the fullname and preferred email
address of the user are printed.

Change-Id: I786be9d1772b76eb6712d49cebe867b20d32d975
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>