SHARE
TWEET

vpn proses

BimoSora Aug 14th, 2019 (edited) 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     session_start();
  3.     if($_SESSION['group_name'] <> 'Administrator'){
  4.         echo '<meta http-equiv="Refresh" Content="0; URL=../../id/error">';
  5.         exit;
  6.     }
  7. ?>
  8.  
  9. <?php
  10. require_once("../../connection.php");
  11. $tw_status_vpn = $db->prepare("SELECT * FROM tw_status_vpn ORDER BY status_vpn_id");
  12. $tw_status_vpn->execute();
  13. while($d = $tw_status_vpn->fetch(PDO::FETCH_ASSOC)){
  14. ?>
  15.  
  16. <?php
  17. if ($_POST['name']) {
  18. $name = $_POST['name'];
  19. $password = $_POST['password'];
  20. $profile = $_POST['profile'];
  21. $local = $_POST['local'];
  22. $remote = $_POST['remote'];
  23. $disabled = $_POST['disabled'];
  24.                                                
  25. require_once('../../routeros_api.class.php');
  26.  
  27. $API = new RouterosAPI();
  28.  
  29. $API->debug = true;
  30.  
  31. if ($API->connect($d['status_ip'], $d['status_login'], $d['status_password'])) {
  32.  
  33. $API->comm("/ppp/secret/add", array(
  34.  
  35. "name" => "$name",
  36. "password" => "$password",
  37. "profile" => "$profile",
  38. "local-address" => "$local",
  39. "remote-address" => "$remote",
  40. "disabled" => "no",
  41.  
  42. ));
  43.                                                        
  44. $API->disconnect();
  45.  
  46. } else {
  47. echo "Tidak bisa koneksi";
  48. }
  49. ?>
  50. <?php } ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top