Sfoglia il codice sorgente

add ajax form for mass change user auth records
add color scheme for disabled users

rajven 2 anni fa
parent
commit
b9e5af212c

+ 3 - 1
docs/Readme.ru.md

@@ -43,7 +43,9 @@ mkdir -p /opt/Eye/html/js/jq
 mkdir -p /opt/Eye/html/js/select2
 
 download from https://jquery.com/download/ production jQuery to /opt/Eye/html/js/jq
-#wget https://code.jquery.com/jquery-3.6.0.min.js -O /opt/Eye/html/js/jq/jquery.min.js
+#wget https://code.jquery.com/jquery-1.12.4.min.js -O /opt/Eye/html/js/jq/jquery.min.js
+or
+#wget https://code.jquery.com/jquery-3.7.0.min.js -O /opt/Eye/html/js/jq/jquery.min.js
 
 download from https://github.com/select2/select2 release
 #wget https://github.com/select2/select2/archive/4.0.12.tar.gz

+ 5 - 0
docs/addons/php-debug.php

@@ -0,0 +1,5 @@
+$debug_export = var_export($_POST, true);
+ob_start();
+var_dump($_POST);
+$debug_dump = ob_get_clean();
+LOG_DEBUG($db_link,$debug_dump);

+ 47 - 56
html/admin/iplist/index.php

@@ -16,46 +16,6 @@ if ($sort_field == 'fio') { $sort_table = 'User_list'; }
 
 $sort_url = "<a href=index.php?ou=" . $rou; 
 
-if (isset($_POST["removeauth"])) {
-    $auth_id = $_POST["fid"];
-    foreach ($auth_id as $key => $val) {
-        if ($val) {
-                run_sql($db_link, 'DELETE FROM connections WHERE auth_id='.$val);
-                run_sql($db_link, 'DELETE FROM User_auth_alias WHERE auth_id='.$val);
-                $changes=delete_record($db_link, "User_auth", "id=" . $val);
-                if (!empty($changes)) { LOG_WARNING($db_link,"Remove user ip: \r\n $changes"); }
-                }
-            }
-    header("Location: " . $_SERVER["REQUEST_URI"]);
-    exit;
-    }
-
-if (isset($_POST["ApplyForAll"])) {
-    $auth_id = $_POST["fid"];
-    $a_enabled = $_POST["a_enabled"] * 1;
-    $a_dhcp = $_POST["a_dhcp"] * 1;
-    $a_dhcp_acl = $_POST["a_dhcp_acl"];
-    $a_queue = $_POST["a_queue_id"] * 1;
-    $a_group = $_POST["a_group_id"] * 1;
-    $a_traf = $_POST["a_traf"] * 1;
-    $msg="Massive User change!";
-    foreach ($auth_id as $key => $val) {
-        if ($val) {
-            unset($auth);
-            $auth['enabled'] = $a_enabled;
-            $auth['filter_group_id'] = $a_group;
-            $auth['queue_id'] = $a_queue;
-            $auth['dhcp'] = $a_dhcp;
-            $auth['dhcp_acl'] = $a_dhcp_acl;
-            $auth['save_traf'] = $a_traf;
-            update_record($db_link, "User_auth", "id='" . $val . "'", $auth);
-            }
-        }
-    LOG_WARNING($db_link,$msg);
-    header("Location: " . $_SERVER["REQUEST_URI"]);
-    exit;
-    }
-
 if ($rou == 0) { $ou_filter = ''; } else { $ou_filter = " and User_list.ou_id=$rou "; }
 
 if ($rsubnet == 0) { $subnet_filter = ''; } else {
@@ -88,7 +48,8 @@ print_ip_submenu($page_url);
 
 ?>
 <div id="cont">
-<form name="def" action="index.php" method="post">
+
+<form name="filter" action="index.php" method="post">
 <table class="data">
 	<tr>
         <td>
@@ -101,6 +62,43 @@ print_ip_submenu($page_url);
         </td>
 	</tr>
 </table>
+</form>
+
+<a class="mainButton" href="#modal"><?php print WEB_btn_apply_selected; ?></a>
+<div class="remodal" data-remodal-options="closeOnConfirm: true" data-remodal-id="modal" role="dialog" aria-labelledby="modal1Title" aria-describedby="modal1Desc">
+ <div class="remodalBorder">
+  <button data-remodal-action="close" class="remodal-close" aria-label="Close"></button>
+      <form id="formAuthApply">
+        <h2 id="modal1Title"><?php print WEB_selection_title; ?></h2>
+	<input type="hidden" name="ApplyForAll" value="MassChange">
+	<table class="data" align=center>
+	<tr><td><input type=checkbox class="putField" name="e_enabled" value='1'></td><td><?php print WEB_cell_enabled."&nbsp"; print_qa_select('a_enabled', 1);?></td></rr>
+	<tr><td><input type=checkbox class="putField" name="e_group_id" value='1'></td><td><?php print WEB_cell_filter."&nbsp";print_group_select($db_link, 'a_group_id', 0);?></td></rr>
+	<tr><td><input type=checkbox class="putField" name="e_queue_id" value='1'></td><td><?php print WEB_cell_shaper."&nbsp";print_queue_select($db_link, 'a_queue_id', 0);?></td></rr>
+	<tr><td><input type=checkbox class="putField" name="e_dhcp" value='1'></td><td><?php print "Dhcp&nbsp"; print_qa_select('a_dhcp', 1);?></td></rr>
+	<tr><td><input type=checkbox class="putField" name="e_dhcp_acl" value='1'></td><td><?php print "Dhcp-acl&nbsp";print_dhcp_acl_select('a_dhcp_acl','');?></td></rr>
+	<tr><td><input type=checkbox class="putField" name="e_traf" value='1'></td><td><?php print "Save traffic&nbsp"; print_qa_select('a_traf',1);?></td></rr>
+	</tr>
+	</table>
+	<input type="submit" name="submit" class="btn" value="<?php echo WEB_btn_apply; ?>">
+    </form>
+</div>
+</div>
+
+<a class="delButton" href="#modalDel"><?php print WEB_btn_delete; ?></a>
+<div class="remodal" data-remodal-options="closeOnConfirm: true" data-remodal-id="modalDel" role="dialog" aria-labelledby="modal1Title" aria-describedby="modal1Desc">
+ <div class="remodalBorder">
+  <button data-remodal-action="close" class="remodal-close" aria-label="Close"></button>
+    <form id="formAuthDel">
+        <h2 id="modal1Title"><?php print WEB_msg_delete_selected; ?></h2>
+	<input type="hidden" name="RemoveAuth" value="MassChange">
+	<?php print_qa_select('f_deleted', 0);?><br><br>
+	<input type="submit" name="submit" class="btn" value="<?php echo WEB_btn_apply; ?>">
+    </form>
+</div>
+</div>
+
+<form id="def" name="def" action="index.php" method="post">
 
 <?php
 $countSQL="SELECT Count(*) FROM User_auth, User_list WHERE User_auth.user_id = User_list.id AND User_auth.deleted =0 $ip_list_filter";
@@ -114,19 +112,6 @@ print_navigation($page_url,$page,$displayed,$count_records[0],$total);
 ?>
 <br>
 
-<table class="data">
-<tr>
-<td><?php print WEB_selection_title.": ".WEB_cell_enabled."&nbsp"; print_qa_select('a_enabled', 1); ?></td>
-<td><?php print WEB_cell_filter."&nbsp";print_group_select($db_link, 'a_group_id', 0); ?></td>
-<td><?php print WEB_cell_shaper."&nbsp";print_queue_select($db_link, 'a_queue_id', 0); ?></td>
-<td>Dhcp&nbsp<?php print_qa_select('a_dhcp', 1); ?></td>
-<td>Dhcp-acl&nbsp<?php print_dhcp_acl_select('a_dhcp_acl',''); ?></td>
-<td>Save traffic&nbsp<?php print_qa_select('a_traf',1); ?></td>
-<td>&nbsp<input type="submit" onclick="return confirm('<?php echo WEB_msg_apply_selected; ?>?')" name="ApplyForAll" value="<?php echo WEB_btn_apply; ?>"></td>
-<td align=right><input type="submit" onclick="return confirm('<?php echo WEB_msg_delete; ?>?')" name="removeauth" value="<?php echo WEB_btn_delete; ?>"></td>
-</tr>
-</table>
-
 <table class="data">
 	<tr>
         <td align=Center><input type="checkbox" onClick="checkAll(this.checked);"></td>
@@ -147,7 +132,7 @@ print_navigation($page_url,$page,$displayed,$count_records[0],$total);
 	</tr>
 <?php
 
-$sSQL = "SELECT User_auth.*, User_list.login FROM User_auth, User_list
+$sSQL = "SELECT User_auth.*, User_list.login, User_list.enabled as UEnabled, User_list.blocked as UBlocked FROM User_auth, User_list
 WHERE User_auth.user_id = User_list.id AND User_auth.deleted =0 $ip_list_filter
 ORDER BY $sort_table.$sort_field $order LIMIT $start,$displayed";
 
@@ -163,6 +148,7 @@ foreach ($users as $user) {
     $cl = "data";
     if (!$user['enabled']) { $cl = "warn"; }
     if ($user['blocked']) { $cl = "error"; }
+    if (!$user['UEnabled'] or $user['UBlocked']) { $cl = "off"; }
     print "<td class=\"$cl\" style='padding:0'><input type=checkbox name=fid[] value=".$user['id']."></td>\n";
     print "<td class=\"$cl\" ><a href=/admin/users/edituser.php?id=".$user['user_id'].">" . $user['login'] . "</a></td>\n";
     print "<td class=\"$cl\" ><a href=/admin/users/editauth.php?id=".$user['id'].">" . $user['ip'] . "</a></td>\n";
@@ -191,9 +177,14 @@ print_navigation($page_url,$page,$displayed,$count_records[0],$total);
 <table class="data">
 <tr><td><?php echo WEB_color_description; ?></td></tr>
 <tr>
-<td class="warn"><?php echo WEB_color_user_disabled; ?></td>
+<td class="warn"><?php echo WEB_color_auth_disabled; ?></td>
 <td class="error"><?php echo WEB_color_user_blocked; ?></td>
+<td class="off"><?php echo WEB_color_user_disabled; ?></td>
 </table>
+
+<script src="/js/remodal/remodal.min.js"></script>
+<script src="/js/remodal-auth.js"></script>
+
 <?php
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");
 ?>

+ 24 - 29
html/admin/iplist/nagios.php

@@ -10,26 +10,6 @@ require_once ($_SERVER['DOCUMENT_ROOT']."/inc/sortfilter.php");
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/gatefilter.php");
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/enabledfilter.php");
 
-if (isset($_POST["ApplyForAll"])) {
-    $auth_id = $_POST["fid"];
-    $n_enabled = $_POST["n_enabled"] * 1;
-    $n_link = $_POST["n_link"] * 1;
-    $n_handler = $_POST["n_handler"];
-    $msg="Массовое изменение пользователей!";
-    foreach ($auth_id as $key => $val) {
-        if ($val) {
-            unset($auth);
-            $auth['nagios'] = $n_enabled;
-            $auth['link_check'] = $n_link;
-            $auth['nagios_handler'] = $n_handler;
-            update_record($db_link, "User_auth", "id='" . $val . "'", $auth);
-            }
-        }
-    LOG_WARNING($db_link,$msg);
-    header("Location: " . $_SERVER["REQUEST_URI"]);
-    exit;
-    }
-
 $sort_table = 'User_auth';
 if ($sort_field == 'login') { $sort_table = 'User_list'; }
 if ($sort_field == 'fio') { $sort_table = 'User_list'; }
@@ -55,7 +35,7 @@ print_ip_submenu($page_url);
 
 ?>
 <div id="cont">
-<form name="def" action="nagios.php" method="post">
+<form name="filter" action="nagios.php" method="post">
 <table class="data">
 	<tr>
         <td>
@@ -67,6 +47,25 @@ print_ip_submenu($page_url);
         </td>
 	</tr>
 </table>
+</form>
+
+<a class="mainButton" href="#modal"><?php print WEB_btn_apply_selected; ?></a>
+<div class="remodal" data-remodal-options="closeOnConfirm: true" data-remodal-id="modal" role="dialog" aria-labelledby="modal1Title" aria-describedby="modal1Desc">
+ <div class="remodalBorder">
+  <button data-remodal-action="close" class="remodal-close" aria-label="Close"></button>
+      <form id="formAuthApply">
+        <h2 id="modal1Title"><?php print WEB_selection_title; ?></h2>
+        <input type="hidden" name="ApplyForAll" value="MassChange">
+        <table class="data" align=center>
+        <tr><td><input type=checkbox class="putField" name="e_nag_enabled" value='1'></td><td>Nagios&nbsp<?php print_qa_select('n_enabled', 1); ?></td></rr>
+        <tr><td><input type=checkbox class="putField" name="e_nag_link" value='1'></td><td>Link&nbsp<?php print_qa_select('n_link', 0); ?></td></rr>
+        <tr><td><input type=checkbox class="putField" name="e_nag_handler" value='1'></td><td>Event-handler&nbsp<?php print_nagios_handler_select('n_handler', ''); ?></td></rr>
+        </tr>
+        </table>
+        <input type="submit" name="submit" class="btn" value="<?php echo WEB_btn_apply; ?>">
+    </form>
+</div>
+</div>
 
 <?php
 $countSQL="SELECT Count(*) FROM User_auth, User_list WHERE User_auth.user_id = User_list.id AND User_auth.deleted =0 $ip_list_filter";
@@ -80,14 +79,7 @@ print_navigation($page_url,$page,$displayed,$count_records[0],$total);
 ?>
 <br>
 
-<table class="data">
-<tr>
-<td><?php echo WEB_selection_title; ?>: Nagios&nbsp<?php print_qa_select('n_enabled', 1); ?></td>
-<td>Link&nbsp<?php print_qa_select('n_link', 0); ?></td>
-<td>Event-handler&nbsp<?php print_nagios_handler_select('n_handler', ''); ?></td>
-<td>&nbsp<input type="submit" onclick="return confirm('<?php echo WEB_msg_apply_selected; ?>?')" name="ApplyForAll" value="<?php echo WEB_btn_apply; ?>"></td>
-</tr>
-</table>
+<form id="def" name="def" action="nagios.php" method="post">
 
 <table class="data">
 	<tr>
@@ -170,6 +162,9 @@ print_navigation($page_url,$page,$displayed,$count_records[0],$total);
 <td class="down"><?php echo WEB_nagios_host_down; ?></td>
 <td class="data"><?php echo WEB_nagios_host_unknown; ?></td>
 </table>
+<script src="/js/remodal/remodal.min.js"></script>
+<script src="/js/remodal-auth.js"></script>
+
 <?php
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");
 ?>

+ 2 - 2
html/admin/users/index.php

@@ -170,7 +170,7 @@ $users = get_records_sql($db_link, $sSQL);
 foreach ($users as $row) {
     $cl = "data";
     if (! $row['enabled']) {
-        $cl = "warn";
+        $cl = "off";
     }
     if ($row['blocked']) {
         $cl = "error";
@@ -206,7 +206,7 @@ print_navigation($page_url,$page,$displayed,$count_records[0],$total);
 </tr>
 <tr>
 <td class="nb"><?php echo WEB_color_user_empty; ?></td>
-<td class="warn"><?php echo WEB_color_user_disabled; ?></td>
+<td class="off"><?php echo WEB_color_user_disabled; ?></td>
 <td class="error"><?php echo WEB_color_user_blocked; ?></td>
 </table>
 <?php

+ 86 - 0
html/css/remodal-custom.css

@@ -0,0 +1,86 @@
+.mainButton{
+  padding: 1px 5px;
+  background: #ffebcd;
+  border-radius: 15px;
+  box-shadow: 0 0 5px rgba(206, 57, 57, 0.5);
+  color: #fff;
+  text-decoration: none;
+}
+
+.delButton{
+  padding: 1px 5px;
+  background: #ffb3b3;
+  border-radius: 15px;
+  box-shadow: 0 0 5px rgba(206, 57, 57, 0.5);
+  color: #fff;
+  text-decoration: none;
+}
+
+.success, .fail{
+  color: #fff;
+}
+
+#modal1Title{
+    font-size: 18px;
+    font-weight: bold;
+    color: red;
+}
+
+.putField {
+  width: 100px;
+  padding: 0 15px;
+  height: 20px;
+  background: #fff;
+  margin-bottom: 15px;
+  border-radius: 2px;
+  border:none;
+  outline: none;
+}
+
+.btn{
+  width: 242px;
+  height: 42px;
+  background: #e57373;
+  margin-bottom: 15px;
+  border-radius: 2px;
+  border:none;
+  outline: none;
+  color: #fff;
+  cursor: pointer;
+}
+
+.btn:hover{
+  background: #C94141;
+}
+
+.remodal {
+  -webkit-box-sizing: border-box;
+  box-sizing: border-box;
+  width: 99.2%;
+  padding: .8%;
+  -webkit-transform: translate3d(0, 0, 0);
+  transform: translate3d(0, 0, 0);
+  color: black;
+  background: white;
+  margin-bottom: 10px;
+  overflow: hidden;
+}
+
+.remodalDel {
+  -webkit-box-sizing: border-box;
+  box-sizing: border-box;
+  width: 99.2%;
+  padding: .8%;
+  -webkit-transform: translate3d(0, 0, 0);
+  transform: translate3d(0, 0, 0);
+  color: black;
+  background: white;
+  margin-bottom: 10px;
+  overflow: hidden;
+}
+
+@media only screen and (min-width: 140px) {
+  .remodal {
+    max-width: 380px;
+  }
+}

+ 56 - 0
html/css/white.css

@@ -0,0 +1,56 @@
+body                            { font-family: tahoma; font-size: 12pt; color: #181818; margin: 0; background-color: #ffffff; }
+img                             { border: 0; }
+
+table                           { font-family: tahoma; font-size: 12pt; border-spacing: 1px; }
+table.data                      { background-color: #cfcfcf; margin-bottom: 5px; }
+table.info                      { background-color: #f8f2aa; margin-bottom: 5px; }
+
+td                              { padding: 4px; border-bottom: 1px solid #ddd; }
+td.data                         { background-color: #ffffff; }
+td.info                         { background-color: #f8f2aa; }
+td.up                           { background-color: #33ff99; }
+td.down                         { background-color: #ffffff; opacity: .4; }
+td.shutdown                     { background-color: #FF8033; }
+td.off                          { background-color: #b3ccff; }
+td.error                        { background-color: #ff6666; }
+td.nb                           { background-color: #ffcc99; }
+td.warn                         { background-color: #ffcccc; }
+td.speed10M                     { background-color: #ffff99; }
+td.speed100M                    { background-color: #33cc33; }
+td.speed1G                      { background-color: #58FA82; }
+td.speed10G                     { background-color: #ffcc00; }
+td.crc                          { background-color: #ff6666; }
+
+input                           { font-family: tahoma; padding: 1px; }
+textarea                        { font-family: tahoma; padding: 1px; }
+select                          { font-family: tahoma; width: auto; padding: 0; }
+
+form                            { margin: 0; margin-top: 5px; }
+.cont                           { font-family: tahoma; }
+
+span.num_page_not_link          { border: 1px solid; color: black; padding: 3px; margin-bottom: 1em;}
+
+div.records                     { color: black; margin-bottom: 1em; margin-top: 1em; }
+div.simple                      { margin-bottom: 1em; margin-top: 1em; }
+
+a                               { font-family: tahoma; color: #000000; text-decoration: underline; }
+a.first_page_link               { border: 1px solid green; color: black; background-color: #A5FF33; padding: 3px; margin-bottom: 1em;}
+a:visited                       { color: #000000; text-decoration: underline; }
+a:link                          { color: #000000; text-decoration: underline; }
+a:active                        { color: #ed8b0d; text-decoration: none; }
+a:hover                         { color: #ed8b0d; text-decoration: none; }
+
+#navi                           { position: absolute; font-size: 12pt; top: 15px; left: 190px; }
+#title                          { position: absolute; top: 15px; left: 15px; font-size: 18pt; color: #ed8b0d; }
+#subtitle                       { position: absolute; top: 43px; left: 15px; font-size: 8pt; }
+#submenu                        { position: absolute; top: 55px; left: 20px; }
+#cont                           { position: absolute; top: 70px; left: 15px; background-color: url('img/vr.gif'); background-repeat: repeat-y; background-position: right; }
+#subsubmenu                     { position: absolute; top: 80px; left: 20px; }
+#contsubmenu                    { position: absolute; top: 105px; left: 15px; background-color: url('img/vr.gif'); background-repeat: repeat-y; background-position: right; }
+
+#copyright                      { margin-top: 10px; margin-bottom: 10px; }
+#msg                            { font-size: 18pt; color: black; color: red; }
+
+html                            { margin:0; padding:0; font-size:62.5%; }
+h1                              { font-size:1.8em; }
+.tree                           { overflow:auto; border:0px; }

BIN
html/img/android-chrome-192x192.png


BIN
html/img/android-chrome-256x256.png


+ 56 - 0
html/inc/auth_apply.php

@@ -0,0 +1,56 @@
+<?php
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
+
+if (! defined("CONFIG")) die("Not defined");
+
+if (isset($_POST["ApplyForAll"])) {
+
+    $auth_id = $_POST["fid"];
+
+    if (empty($_POST["a_enabled"])) { $_POST["a_enabled"]=0; }
+    if (empty($_POST["a_dhcp"])) { $_POST["a_dhcp"]=0; }
+    if (empty($_POST["a_queue_id"])) { $_POST["a_queue_id"]=0; }
+    if (empty($_POST["a_group_id"])) { $_POST["a_group_id"]=0; }
+    if (empty($_POST["a_traf"])) { $_POST["a_traf"]=0; }
+
+    if (empty($_POST["n_enabled"])) { $_POST["n_enabled"]=0; }
+    if (empty($_POST["n_link"])) { $_POST["n_link"]=0; }
+
+    $a_enabled  = $_POST["a_enabled"] * 1;
+    $a_dhcp     = $_POST["a_dhcp"] * 1;
+    $a_dhcp_acl = $_POST["a_dhcp_acl"];
+    $a_queue    = $_POST["a_queue_id"] * 1;
+    $a_group    = $_POST["a_group_id"] * 1;
+    $a_traf     = $_POST["a_traf"] * 1;
+
+    $n_enabled = $_POST["n_enabled"] * 1;
+    $n_link    = $_POST["n_link"] * 1;
+    $n_handler = $_POST["n_handler"];
+
+    $msg="Massive User change!";
+    LOG_WARNING($db_link,$msg);
+
+    $all_ok=1;
+    foreach ($auth_id as $key => $val) {
+        if ($val) {
+            unset($auth);
+	    if (isset($_POST["e_enabled"]))    { $auth['enabled'] = $a_enabled; }
+	    if (isset($_POST["e_group_id"]))   { $auth['filter_group_id'] = $a_group; }
+	    if (isset($_POST["e_queue_id"]))   { $auth['queue_id'] = $a_queue; }
+	    if (isset($_POST["e_dhcp"]))       { $auth['dhcp'] = $a_dhcp; }
+	    if (isset($_POST["e_dhcp_acl"]))   { $auth['dhcp_acl'] = $a_dhcp_acl; }
+	    if (isset($_POST["e_traf"]))       { $auth['save_traf'] = $a_traf; }
+//nagios
+	    if (isset($_POST["e_nag_enabled"])){ $auth['nagios'] = $n_enabled; }
+	    if (isset($_POST["e_nag_link"]))   { $auth['link_check'] = $n_link; }
+	    if (isset($_POST["e_nag_handler"])){ $auth['nagios_handler'] = $n_handler; }
+
+	    if (!empty($auth)) {
+        	$ret = update_record($db_link, "User_auth", "id='" . $val . "'", $auth);
+		if (!$ret) { $all_ok = 0; }
+		}
+            }
+        }
+    if ($all_ok) { print "Success!"; } else { print "Fail!"; }
+    }

+ 21 - 0
html/inc/auth_remove.php

@@ -0,0 +1,21 @@
+<?php
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
+require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
+
+if (! defined("CONFIG")) die("Not defined");
+
+if (isset($_POST["RemoveAuth"]) and (isset($_POST["f_deleted"]))) {
+    if ($_POST["f_deleted"]*1) {
+        $auth_id = $_POST["fid"];
+	$all_ok = 1;
+	foreach ($auth_id as $key => $val) {
+    	    if ($val) {
+                run_sql($db_link, 'DELETE FROM connections WHERE auth_id='.$val);
+                run_sql($db_link, 'DELETE FROM User_auth_alias WHERE auth_id='.$val);
+                $changes=delete_record($db_link, "User_auth", "id=" . $val);
+                if (!empty($changes)) { LOG_WARNING($db_link,"Remove user ip: $changes"); } else { $all_ok =1; }
+                }
+            }
+	if ($all_ok) { print "Success!"; } else { print "Fail!"; }
+	}
+    }

+ 12 - 5
html/inc/header.php

@@ -8,17 +8,24 @@
 <link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
 <link rel="manifest" href="/site.webmanifest">
 <link rel="mask-icon" href="/img/safari-pinned-tab.svg" color="#5bbad5">
-<meta name="msapplication-TileColor" content="#da532c">
-<meta name="theme-color" content="#ffffff">
 
-<link rel="stylesheet" type="text/css" href="/<?php echo HTML_STYLE.'.css'; ?>">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<meta http-equiv="content-type" content="application/xhtml+xml" />
+<meta charset="UTF-8" />
+
+<link rel="stylesheet" href="/js/remodal/remodal.css">
+<link rel="stylesheet" href="/js/remodal/remodal-default-theme.css">
+<link rel="stylesheet" href="/css/remodal-custom.css">
+
+<link rel="stylesheet" type="text/css" href="/css/<?php echo HTML_STYLE.'.css'; ?>">
+
 <script src="/js/jq/jquery.min.js"></script>
+
 <link href="/js/select2/css/select2.min.css" rel="stylesheet"/>
 <script src="/js/select2/js/select2.min.js"></script>
+
 <link rel="stylesheet" href="/js/jstree/themes/default/style.min.css" />
 <script src="/js/jstree/jstree.min.js"></script>
-<meta http-equiv="content-type" content="application/xhtml+xml" />
-<meta charset="UTF-8" />
 
 <script language="javascript">
 function checkAll(check) {

+ 1 - 1
html/inc/header_public.php

@@ -19,7 +19,7 @@ $page_url = $page_url_array[0];
 <html>
 <head>
 <title>Панель статистики</title>
-<link rel="stylesheet" type="text/css" href="/<?php echo HTML_STYLE.".css"; ?>">
+<link rel="stylesheet" type="text/css" href="/css/<?php echo HTML_STYLE.".css"; ?>">
 <meta http-equiv="content-type" content="text/html; charset=utf-8">
 </head>
 <body>

+ 55 - 0
html/js/remodal-auth.js

@@ -0,0 +1,55 @@
+$(document).ready(function () {
+    $("form").submit(function () {
+	var formID = $(this).attr('id');
+
+        if (formID == "formAuthApply") {
+            var formNm = $('#' + formID);
+	    var formTID = $('#def').attr('id');
+    	    var formTm = $('#' + formTID);
+	    var post_data = {};
+            post_data = formTm.serializeArray();
+	    post_data = post_data.concat(formNm.serializeArray());
+    	    $.ajax({
+        	type: "POST",
+        	url: "/inc/auth_apply.php",
+        	data: post_data,
+        	success: function (data) {
+            	    $(formNm).html(data);
+		    location.href=formTm.attr("action");
+		    setTimeout(location.reload,1000);
+        	},
+        	error: function (jqXHR, text, error) {
+        	    $(formNm).html(error);
+		    location.href=formTm.attr("action");
+		    setTimeout(location.reload,5000);
+        	}
+	    });
+	    }
+
+        if (formID == "formAuthDel") {
+            var formNm = $('#' + formID);
+	    var formTID = $('#def').attr('id');
+    	    var formTm = $('#' + formTID);
+	    var post_data = {};
+            post_data = formTm.serializeArray();
+	    post_data = post_data.concat(formNm.serializeArray());
+    	    $.ajax({
+        	type: "POST",
+        	url: "/inc/auth_remove.php",
+        	data: post_data,
+        	success: function (data) {
+            	    $(formNm).html(data);
+		    location.href=formTm.attr("action");
+		    setTimeout(location.reload,1000);
+        	},
+        	error: function (jqXHR, text, error) {
+        	    $(formNm).html(error);
+		    location.href=formTm.attr("action");
+		    setTimeout(location.reload,5000);
+        	}
+	    });
+	    }
+
+        return true;
+    });
+});

+ 323 - 0
html/js/remodal/remodal-default-theme.css

@@ -0,0 +1,323 @@
+/*
+ *  Remodal - v1.1.1
+ *  Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
+ *  http://vodkabears.github.io/remodal/
+ *
+ *  Made by Ilya Makarov
+ *  Under MIT License
+ */
+
+/* ==========================================================================
+   Remodal's default mobile first theme
+   ========================================================================== */
+
+/* Default theme styles for the background */
+
+.remodal-bg.remodal-is-opening,
+.remodal-bg.remodal-is-opened {
+  -webkit-filter: blur(3px);
+  filter: blur(3px);
+}
+
+/* Default theme styles of the overlay */
+
+.remodal-overlay {
+  background: rgba(43, 46, 56, 0.9);
+}
+
+.remodal-overlay.remodal-is-opening,
+.remodal-overlay.remodal-is-closing {
+  -webkit-animation-duration: 0.3s;
+  animation-duration: 0.3s;
+  -webkit-animation-fill-mode: forwards;
+  animation-fill-mode: forwards;
+}
+
+.remodal-overlay.remodal-is-opening {
+  -webkit-animation-name: remodal-overlay-opening-keyframes;
+  animation-name: remodal-overlay-opening-keyframes;
+}
+
+.remodal-overlay.remodal-is-closing {
+  -webkit-animation-name: remodal-overlay-closing-keyframes;
+  animation-name: remodal-overlay-closing-keyframes;
+}
+
+/* Default theme styles of the wrapper */
+
+.remodal-wrapper {
+  padding: 10px 10px 0;
+}
+
+/* Default theme styles of the modal dialog */
+
+.remodal {
+  box-sizing: border-box;
+  width: 100%;
+  margin-bottom: 10px;
+  padding: 35px;
+
+  -webkit-transform: translate3d(0, 0, 0);
+  transform: translate3d(0, 0, 0);
+
+  color: #2b2e38;
+  background: #fff;
+}
+
+.remodal.remodal-is-opening,
+.remodal.remodal-is-closing {
+  -webkit-animation-duration: 0.3s;
+  animation-duration: 0.3s;
+  -webkit-animation-fill-mode: forwards;
+  animation-fill-mode: forwards;
+}
+
+.remodal.remodal-is-opening {
+  -webkit-animation-name: remodal-opening-keyframes;
+  animation-name: remodal-opening-keyframes;
+}
+
+.remodal.remodal-is-closing {
+  -webkit-animation-name: remodal-closing-keyframes;
+  animation-name: remodal-closing-keyframes;
+}
+
+/* Vertical align of the modal dialog */
+
+.remodal,
+.remodal-wrapper:after {
+  vertical-align: middle;
+}
+
+/* Close button */
+
+.remodal-close {
+  position: absolute;
+  top: 0;
+  left: 0;
+
+  display: block;
+  overflow: visible;
+
+  width: 35px;
+  height: 35px;
+  margin: 0;
+  padding: 0;
+
+  cursor: pointer;
+  -webkit-transition: color 0.2s;
+  transition: color 0.2s;
+  text-decoration: none;
+
+  color: #95979c;
+  border: 0;
+  outline: 0;
+  background: transparent;
+}
+
+.remodal-close:hover,
+.remodal-close:focus {
+  color: #2b2e38;
+}
+
+.remodal-close:before {
+  font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif !important;
+  font-size: 25px;
+  line-height: 35px;
+
+  position: absolute;
+  top: 0;
+  left: 0;
+
+  display: block;
+
+  width: 35px;
+
+  content: "\00d7";
+  text-align: center;
+}
+
+/* Dialog buttons */
+
+.remodal-confirm,
+.remodal-cancel {
+  font: inherit;
+
+  display: inline-block;
+  overflow: visible;
+
+  min-width: 110px;
+  margin: 0;
+  padding: 12px 0;
+
+  cursor: pointer;
+  -webkit-transition: background 0.2s;
+  transition: background 0.2s;
+  text-align: center;
+  vertical-align: middle;
+  text-decoration: none;
+
+  border: 0;
+  outline: 0;
+}
+
+.remodal-confirm {
+  color: #fff;
+  background: #81c784;
+}
+
+.remodal-confirm:hover,
+.remodal-confirm:focus {
+  background: #66bb6a;
+}
+
+.remodal-cancel {
+  color: #fff;
+  background: #e57373;
+}
+
+.remodal-cancel:hover,
+.remodal-cancel:focus {
+  background: #ef5350;
+}
+
+/* Remove inner padding and border in Firefox 4+ for the button tag. */
+
+.remodal-confirm::-moz-focus-inner,
+.remodal-cancel::-moz-focus-inner,
+.remodal-close::-moz-focus-inner {
+  padding: 0;
+
+  border: 0;
+}
+
+/* Keyframes
+   ========================================================================== */
+
+@-webkit-keyframes remodal-opening-keyframes {
+  from {
+    -webkit-transform: scale(1.05);
+    transform: scale(1.05);
+
+    opacity: 0;
+  }
+  to {
+    -webkit-transform: none;
+    transform: none;
+
+    opacity: 1;
+
+    -webkit-filter: blur(0);
+    filter: blur(0);
+  }
+}
+
+@keyframes remodal-opening-keyframes {
+  from {
+    -webkit-transform: scale(1.05);
+    transform: scale(1.05);
+
+    opacity: 0;
+  }
+  to {
+    -webkit-transform: none;
+    transform: none;
+
+    opacity: 1;
+
+    -webkit-filter: blur(0);
+    filter: blur(0);
+  }
+}
+
+@-webkit-keyframes remodal-closing-keyframes {
+  from {
+    -webkit-transform: scale(1);
+    transform: scale(1);
+
+    opacity: 1;
+  }
+  to {
+    -webkit-transform: scale(0.95);
+    transform: scale(0.95);
+
+    opacity: 0;
+
+    -webkit-filter: blur(0);
+    filter: blur(0);
+  }
+}
+
+@keyframes remodal-closing-keyframes {
+  from {
+    -webkit-transform: scale(1);
+    transform: scale(1);
+
+    opacity: 1;
+  }
+  to {
+    -webkit-transform: scale(0.95);
+    transform: scale(0.95);
+
+    opacity: 0;
+
+    -webkit-filter: blur(0);
+    filter: blur(0);
+  }
+}
+
+@-webkit-keyframes remodal-overlay-opening-keyframes {
+  from {
+    opacity: 0;
+  }
+  to {
+    opacity: 1;
+  }
+}
+
+@keyframes remodal-overlay-opening-keyframes {
+  from {
+    opacity: 0;
+  }
+  to {
+    opacity: 1;
+  }
+}
+
+@-webkit-keyframes remodal-overlay-closing-keyframes {
+  from {
+    opacity: 1;
+  }
+  to {
+    opacity: 0;
+  }
+}
+
+@keyframes remodal-overlay-closing-keyframes {
+  from {
+    opacity: 1;
+  }
+  to {
+    opacity: 0;
+  }
+}
+
+/* Media queries
+   ========================================================================== */
+
+@media only screen and (min-width: 641px) {
+  .remodal {
+    max-width: 700px;
+  }
+}
+
+/* IE8
+   ========================================================================== */
+
+.lt-ie9 .remodal-overlay {
+  background: #2b2e38;
+}
+
+.lt-ie9 .remodal {
+  width: 700px;
+}

+ 93 - 0
html/js/remodal/remodal.css

@@ -0,0 +1,93 @@
+/*
+ *  Remodal - v1.1.1
+ *  Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
+ *  http://vodkabears.github.io/remodal/
+ *
+ *  Made by Ilya Makarov
+ *  Under MIT License
+ */
+
+/* ==========================================================================
+   Remodal's necessary styles
+   ========================================================================== */
+
+/* Hide scroll bar */
+
+html.remodal-is-locked {
+  overflow: hidden;
+
+  -ms-touch-action: none;
+  touch-action: none;
+}
+
+/* Anti FOUC */
+
+.remodal,
+[data-remodal-id] {
+  display: none;
+}
+
+/* Necessary styles of the overlay */
+
+.remodal-overlay {
+  position: fixed;
+  z-index: 9999;
+  top: -5000px;
+  right: -5000px;
+  bottom: -5000px;
+  left: -5000px;
+
+  display: none;
+}
+
+/* Necessary styles of the wrapper */
+
+.remodal-wrapper {
+  position: fixed;
+  z-index: 10000;
+  top: 0;
+  right: 0;
+  bottom: 0;
+  left: 0;
+
+  display: none;
+  overflow: auto;
+
+  text-align: center;
+
+  -webkit-overflow-scrolling: touch;
+}
+
+.remodal-wrapper:after {
+  display: inline-block;
+
+  height: 100%;
+  margin-left: -0.05em;
+
+  content: "";
+}
+
+/* Fix iPad, iPhone glitches */
+
+.remodal-overlay,
+.remodal-wrapper {
+  -webkit-backface-visibility: hidden;
+  backface-visibility: hidden;
+}
+
+/* Necessary styles of the modal dialog */
+
+.remodal {
+  position: relative;
+
+  outline: none;
+
+  -webkit-text-size-adjust: 100%;
+  -ms-text-size-adjust: 100%;
+  text-size-adjust: 100%;
+}
+
+.remodal-is-initialized {
+  /* Disable Anti-FOUC */
+  display: inline-block;
+}

File diff suppressed because it is too large
+ 9 - 0
html/js/remodal/remodal.min.js


+ 1 - 1
html/login.php

@@ -31,7 +31,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['submit'])) {
 <html>
     <head>
     <title><?php echo WEB_site_title; ?> login</title>
-    <link rel="stylesheet" type="text/css" href="/<?php echo HTML_STYLE.'.css'; ?>">
+    <link rel="stylesheet" type="text/css" href="/css/<?php echo HTML_STYLE.'.css'; ?>">
     <link rel="stylesheet" type="text/css" href="/login.css" >
     <meta http-equiv="content-type" content="application/xhtml+xml" />
     <meta charset="UTF-8" />

Some files were not shown because too many files changed in this diff