一、隐藏ID=1的超级用户
1、adminpath/user.php
2、在103行左右,找到$userList = zen_get_users();
3、在下边加一行$userList = array_values(array_filter($userList, function($u) {return (int)$u['id'] !== 1;}));
二、设置只有ID=1的Superuser才能添加用户
1、编辑在290-310行左右的<tfoot>内容为
<tfoot><?php if ($currentUser == 1 && $action != 'add' && $action != 'edit' && $action != 'password') { ?>
<tr>
<td colspan="5">
<a href="<?php echo zen_href_link(FILENAME_USERS, 'action=add'); ?>" class="btn btn-primary" role="button">
<?php echo IMAGE_ADD_USER; ?>
</a>
</td>
</tr><?php } ?>
2、在用户列表循环里(大概在 210–270 行),有如下代码
<a href="<?php echo zen_href_link(FILENAME_USERS, 'action=edit&user=' . $userDetails['id']) ?>" class="btn btn-primary" role="button"><?php echo IMAGE_EDIT; ?></a>改成
<?php if ($currentUser == 1 || $userDetails['id'] == $currentUser) { ?>原代码<?php } ?>


Comments | NOTHING