auth_remove.php 859 B

123456789101112131415161718192021
  1. <?php
  2. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
  3. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
  4. if (! defined("CONFIG")) die("Not defined");
  5. if (isset($_POST["RemoveAuth"]) and (isset($_POST["f_deleted"]))) {
  6. if ($_POST["f_deleted"]*1) {
  7. $auth_id = $_POST["fid"];
  8. $all_ok = 1;
  9. foreach ($auth_id as $key => $val) {
  10. if ($val) {
  11. run_sql($db_link, 'DELETE FROM connections WHERE auth_id='.$val);
  12. run_sql($db_link, 'DELETE FROM User_auth_alias WHERE auth_id='.$val);
  13. $changes=delete_record($db_link, "User_auth", "id=" . $val);
  14. if (!empty($changes)) { LOG_WARNING($db_link,"Remove user ip: $changes"); } else { $all_ok =1; }
  15. }
  16. }
  17. if ($all_ok) { print "Success!"; } else { print "Fail!"; }
  18. }
  19. }