Skip to content
Permalink
Browse files

Hide User Info table footer when not needed

Low-privileged users do not have any available buttons in the footer
below the User Information section on View User Page, so an empty DIV is
displayed.

With this change, the DIV is only shown if user can manage and/or
impersonate users.

Fixes #25059
  • Loading branch information...
dregad authored and atrol committed Dec 10, 2018
1 parent 62f6c18 commit 41557152f71a9519c82538c8b15ed8ccfe3e7284
Showing with 7 additions and 4 deletions.
  1. +7 −4 view_user_page.php
@@ -67,6 +67,7 @@
$t_can_see_realname = $t_can_manage || user_show_realname() ||
access_has_project_level( config_get( 'show_user_realname_threshold' ) );
$t_can_see_email = $t_can_manage || access_has_project_level( config_get( 'show_user_email_threshold' ) );
$t_can_impersonate = auth_can_impersonate( $f_user_id );
# In case we're using LDAP to get the email address... this will pull out
# that version instead of the one in the DB
@@ -175,25 +176,27 @@
</table>
</div>
</div>
<?php if( $t_can_manage || $t_can_impersonate ) { ?>
<div class="widget-toolbox padding-8 clearfix">
<?php if( $t_can_manage ) { ?>
<?php if( $t_can_manage ) { ?>
<form id="manage-user-form" method="get" action="manage_user_edit_page.php" class="pull-left">
<fieldset>
<input type="hidden" name="user_id" value="<?php echo $f_user_id ?>" />
<input type="submit" class="btn btn-primary btn-white btn-round" value="<?php echo lang_get( 'manage_user' ) ?>" /></span>
</fieldset>
</form>
<?php } ?>
<?php if( auth_can_impersonate( $f_user_id ) ) { ?>
<?php } ?>
<?php if( $t_can_impersonate ) { ?>
<form id="manage-user-impersonate-form" method="post" action="manage_user_impersonate.php" class="pull-right">
<fieldset>
<?php echo form_security_field( 'manage_user_impersonate' ) ?>
<input type="hidden" name="user_id" value="<?php echo $f_user_id ?>" />
<span><input type="submit" class="btn btn-primary btn-white btn-round" value="<?php echo lang_get( 'impersonate_user_button' ) ?>" /></span>
</fieldset>
</form>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
</div>

0 comments on commit 4155715

Please sign in to comment.
You can’t perform that action at this time.