mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-01-27 00:33:34 +00:00
Hide change password fields if the user can't change the principal
There is no need to show these fields as they do nothing.
This commit is contained in:
parent
15e9231ae3
commit
5347680642
@ -327,8 +327,10 @@ function principal_editor() {
|
||||
}
|
||||
|
||||
$admin_row_entry = '';
|
||||
$default_passwd_row_entry = '<tr> <th class="right">' . $prompt_password_1 . ':</th> <td class="left">##newpass1.password.' . $pwstars . '##</td> </tr>';
|
||||
$default_passwd_row_entry .= '<tr> <th class="right">' . $prompt_password_2 . ':</th> <td class="left">##newpass2.password.' . $pwstars . '##</td> </tr>';
|
||||
if ($can_write_principal) {
|
||||
$default_passwd_row_entry = '<tr> <th class="right">' . $prompt_password_1 . ':</th> <td class="left">##newpass1.password.' . $pwstars . '##</td> </tr>';
|
||||
$default_passwd_row_entry .= '<tr> <th class="right">' . $prompt_password_2 . ':</th> <td class="left">##newpass2.password.' . $pwstars . '##</td> </tr>';
|
||||
}
|
||||
$delete_principal_button = '';
|
||||
if ( $session->AllowedTo('Admin') ) {
|
||||
$passwd_row_entry = $default_passwd_row_entry;
|
||||
@ -337,12 +339,14 @@ function principal_editor() {
|
||||
if ( isset($id) )
|
||||
$delete_principal_button = '<a href="' . $c->base_url . '/admin.php?action=edit&t=principal&subaction=delete_principal&id='.$id.'" class="submit">' . translate("Delete Principal") . '</a>';
|
||||
} else {
|
||||
if ( isset($c->password_change_override) ) {
|
||||
$passwd_row_entry = '<tr> <th class="right">' . $prompt_password_1 . ':</th>';
|
||||
$passwd_row_entry .= '<td class="left"><a href="' . $c->password_change_override['href'] . '">';
|
||||
$passwd_row_entry .= $c->password_change_override['label'] . '</a></td> </tr>';
|
||||
} else {
|
||||
$passwd_row_entry = $default_passwd_row_entry;
|
||||
if ($can_write_principal) {
|
||||
if ( isset($c->password_change_override) ) {
|
||||
$passwd_row_entry = '<tr> <th class="right">' . $prompt_password_1 . ':</th>';
|
||||
$passwd_row_entry .= '<td class="left"><a href="' . $c->password_change_override['href'] . '">';
|
||||
$passwd_row_entry .= $c->password_change_override['label'] . '</a></td> </tr>';
|
||||
} else {
|
||||
$passwd_row_entry = $default_passwd_row_entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user