优化 密码显示

This commit is contained in:
LyLme 2022-05-21 19:26:27 +08:00
parent 6b089216ed
commit 415a691f51
2 changed files with 8 additions and 3 deletions

View File

@ -66,13 +66,13 @@ echo '
<select class="form-control" required name="group_pwd">'; <select class="form-control" required name="group_pwd">';
$pwd_lists = $DB->query("SELECT * FROM `lylme_pwd`"); $pwd_lists = $DB->query("SELECT * FROM `lylme_pwd`");
while ($pwd_list = $DB->fetch($pwd_lists)) { while ($pwd_list = $DB->fetch($pwd_lists)) {
if($row['group_pwd']==$pwd_list["pwd_id"]){$sel = 'selected="selected"';} if($row['group_pwd']==$pwd_list["pwd_id"]){$sel = 'selected="selected"';}else{$sel = '';}
echo '<option value="' . $pwd_list["pwd_id"] . '" '.$sel.' >' . $pwd_list["pwd_id"] . ' - ' . $pwd_list["pwd_name"] . ' | 密码['. $pwd_list["pwd_key"].']</option>'; echo '<option value="' . $pwd_list["pwd_id"] . '" '.$sel.' >' . $pwd_list["pwd_id"] . ' - ' . $pwd_list["pwd_name"] . ' | 密码['. $pwd_list["pwd_key"].']</option>';
} }
if(empty($row['group_pwd'])) $sele = 'selected="selected"'; if(empty($row['group_pwd'])) $sele = 'selected="selected"';
echo ' echo '
<option value="0" '.$sele.'>0 - 不加密</option></select> <option value="0" '.$sele.'>0 - 不加密</option></select>
<small class="help-block"><code>优先级:链接加密>分组加密</code><br> <small class="help-block"><code>优先级:分组加密>链接加密</code><br>
加密后只能通过输入密码访问,使用该功能先配置加密组 加密后只能通过输入密码访问,使用该功能先配置加密组
<a href="./pwd.php" target="_blank">管理加密组</a></small> <a href="./pwd.php" target="_blank">管理加密组</a></small>
</div> </div>

View File

@ -18,8 +18,13 @@ echo '<div class="alert alert-info">系统共有 <b>' . $groupsrows . '</b> 个
<td>'. $DB->num_rows($DB->query("SELECT `id` FROM `lylme_links` WHERE `group_id` =".$res['group_id'])).'</td> <td>'. $DB->num_rows($DB->query("SELECT `id` FROM `lylme_links` WHERE `group_id` =".$res['group_id'])).'</td>
<td>'; <td>';
if($pwd = $DB->get_row("SELECT `pwd_id`, `pwd_key` FROM `lylme_pwd` WHERE `pwd_id` = ".$res['group_pwd'])['pwd_key']){ if($pwd||$res['group_pwd']){
if(empty($pwd)){
echo '<font color="red">失效</font>';
}
else{
echo '<font color="f96197">'.$pwd.'</font>'; echo '<font color="f96197">'.$pwd.'</font>';
}
} }
else{echo '<font color="green">未加密</font>';} else{echo '<font color="green">未加密</font>';}
echo ' </td> echo ' </td>