优化加密和描述

This commit is contained in:
LyLme 2022-05-21 13:33:58 +08:00
parent 340648f9b5
commit d1ab533b02
4 changed files with 26 additions and 10 deletions

View File

@ -34,7 +34,7 @@ while ($pwd_list = $DB->fetch($pwd_lists)) {
} }
echo ' echo '
<option value="0" selected="selected">0 - 不加密</option></select> <option value="0" selected="selected">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>
@ -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"';}else{ $sel ='';} if($row['group_pwd']==$pwd_list["pwd_id"]){$sel = 'selected="selected"';}
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

@ -362,9 +362,15 @@ function pwd_link(pwd_list) {
// } // }
// }); // });
// } // }
function pwd_links(){
$.alert({
title: '分组已加密',
content: '当前分组已设置为加密,若想单独设置链接加密,请先删除该分组的加密',
});
}
$(document).on('click', '.tips', function(){ $(document).on('click', '.tips', function(){
$.alert({ $.alert({
title: '提示', title: '提示',
content: '<hr><h4>拖动排序</h4>在电脑端可以拖拽链接的<b>名称</b>排序,拖拽完成后点击“保存排序”即可<hr><h4>链接加密</h4>加密后的链接地址在本页面显示为<font color="#f96197">粉色</font>,以便标识,加密后链接只能在输入密码后查看', content: '<hr><h4>拖动排序</h4><li>在电脑端可以拖拽链接的<b>名称</b>进行排序,拖拽完成后点击“保存排序”即可生效</li><hr><h4>链接加密</h4><li>加密后的链接地址在本页面显示为<font color="#f96197">粉色</font>,以便标识</li><li>加密分组后该分组下的链接使用加密分组的密码查看,链接的原单独设置的加密将失效,删除分组的加密后即可恢复</li><li><b>加密后链接只能使用密码登录后方可查看</b></li>',
}); });
}); });

View File

@ -93,7 +93,7 @@ if ($set == 'add') {
echo '</select> echo '</select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>分组加密:</label><br> <label>链接加密:</label><br>
<select class="form-control" required name="link_pwd">'; <select class="form-control" required name="link_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)) {
@ -103,7 +103,7 @@ while ($pwd_list = $DB->fetch($pwd_lists)) {
if(empty($row['link_pwd'])) $sele = 'selected="selected"'; if(empty($row['link_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>
@ -139,7 +139,8 @@ echo '
if ($name == NULL or $url == NULL) { if ($name == NULL or $url == NULL) {
echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>'; echo '<script>alert("保存错误,请确保带星号的都不为空!");history.go(-1);</script>';
} else { } else {
$sql = "UPDATE `lylme_links` SET `name` = '" . $name . "', `url` = '" . $url . "', `icon` = '" . $icon . "', `group_id` = '" . $group_id . "', `link_pwd` = '" . $link_pwd . "' WHERE `lylme_links`.`id` = '" . $id . "';"; $sql = "UPDATE `lylme_links` SET `name` = '" . $name . "', `url` = '" . $url . "', `icon` = '" . $icon . "', `group_id` = '" . $group_id . "', `link_pwd` = " . $link_pwd . " WHERE `lylme_links`.`id` = '" . $id . "';";
// exit($sql);
if ($DB->query($sql)) echo '<script>alert("修改链接 ' . $name . ' 成功!");window.location.href="./link.php";</script>'; if ($DB->query($sql)) echo '<script>alert("修改链接 ' . $name . ' 成功!");window.location.href="./link.php";</script>';
else echo '<script>alert("修改链接失败!");history.go(-1);</script>'; else echo '<script>alert("修改链接失败!");history.go(-1);</script>';
} }

View File

@ -5,6 +5,7 @@ if(isset($islogin)==1) {
$page = isset($_GET['page'])? $_GET['page'] : 1; $page = isset($_GET['page'])? $_GET['page'] : 1;
$groups = $DB->query("SELECT * FROM `lylme_groups` ORDER BY `group_order` ASC"); //获取分组 $groups = $DB->query("SELECT * FROM `lylme_groups` ORDER BY `group_order` ASC"); //获取分组
$gpwd = $DB->fetch($DB->query("SELECT `group_id`, `group_pwd` FROM `lylme_groups` WHERE `group_id` = ".$page))["group_pwd"]; //分组加密状态
$rs = $DB->query("SELECT * FROM `lylme_links` WHERE `group_id` = ".$page." ORDER BY `lylme_links`.`id` ASC"); //获取链接 $rs = $DB->query("SELECT * FROM `lylme_links` WHERE `group_id` = ".$page." ORDER BY `lylme_links`.`id` ASC"); //获取链接
$grouprows=$DB->num_rows($rs); $grouprows=$DB->num_rows($rs);
echo '<div class="alert alert-info">系统收录: <b>' . $linksrows . '</b> 个链接 / 当前分组: <b>'.$grouprows.'</b>个链接 echo '<div class="alert alert-info">系统收录: <b>' . $linksrows . '</b> 个链接 / 当前分组: <b>'.$grouprows.'</b>个链接
@ -30,8 +31,16 @@ while ($group = $DB->fetch($groups)) {
<label><i class="mdi mdi-window-close" aria-hidden="true"></i></label>删除</button> <label><i class="mdi mdi-window-close" aria-hidden="true"></i></label>删除</button>
<button id="edit_group" type="button" class="btn btn-info btn-label" onclick="edit_group(mv_group)"> <button id="edit_group" type="button" class="btn btn-info btn-label" onclick="edit_group(mv_group)">
<label><i class="mdi mdi-account-edit" aria-hidden="true"></i></label>移动</button> <label><i class="mdi mdi-account-edit" aria-hidden="true"></i></label>移动</button>
<button id="btn_delete" type="button" class="btn btn btn-pink btn-label" onclick="pwd_link(pwd_list)"> ';
<label><i class="mdi mdi-key-variant" aria-hidden="true"></i></label>加密</button> if(empty($gpwd)){
echo '<button id="btn_delete" type="button" class="btn btn btn-pink btn-label" onclick="pwd_link(pwd_list)">
<label><i class="mdi mdi-key-variant" aria-hidden="true"></i></label>加密</button>';
}
else{
echo '<button id="btn_delete" type="button" class="btn btn btn-pink btn-label" onclick="pwd_links()">
<label><i class="mdi mdi-key-variant" aria-hidden="true"></i></label>分组已加密</button>';
}
echo '
<button class="btn btn-label btn btn-purple" id="save_order" style="display:none" onclick="save_order()"> <button class="btn btn-label btn btn-purple" id="save_order" style="display:none" onclick="save_order()">
<label><i class="mdi mdi-checkbox-marked-circle-outline"></i></label> 保存排序</button> <label><i class="mdi mdi-checkbox-marked-circle-outline"></i></label> 保存排序</button>
</div> </div>
@ -54,7 +63,7 @@ while ($group = $DB->fetch($groups)) {
<a class="btn btn-cyan btn-xs sort-down" data-toggle="tooltip" data-placement="top" title="移到下一行"><i class="mdi mdi-arrow-down"></i></a></td> <a class="btn btn-cyan btn-xs sort-down" data-toggle="tooltip" data-placement="top" title="移到下一行"><i class="mdi mdi-arrow-down"></i></a></td>
<!-- 链接排序 E --> <!-- 链接排序 E -->
<td class="lylme">' . $res['name'] . '</td><td>'; <td class="lylme">' . $res['name'] . '</td><td>';
if(empty($res['link_pwd'])){ echo $res['url'];}else{echo '<font color="#f96197">'. $res['url'] .'</font>';} if(!empty($res['link_pwd'])||!empty($gpwd)){ echo '<font color="#f96197">'. $res['url'] .'</font>';}else{echo $res['url'];}
echo echo
'</td><td>'. $DB->fetch($DB->query("SELECT * FROM `lylme_groups` WHERE `group_id` = " . $res['group_id'])) ["group_name"]. '</td> '</td><td>'. $DB->fetch($DB->query("SELECT * FROM `lylme_groups` WHERE `group_id` = " . $res['group_id'])) ["group_name"]. '</td>
<td>'; <td>';