コード例 #1
0
 /**
  * This method used for enable Ip Firewall Service Port
  * @param type $id string
  * @return type array
  */
 public function enable($id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ip/firewall/service-port/enable");
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     return "Success";
 }
コード例 #2
0
ファイル: Active.php プロジェクト: beecode/mikrotik-api
 /**
  * This method is used to delete ppp active
  * @param type $id string
  * @return type array
  */
 public function delete($id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ppp/active/remove");
     $sentence->where(".id", "=", $id);
     $enable = $this->talker->send($sentence);
     return "Sucsess";
 }
コード例 #3
0
ファイル: HotspotCookies.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method is used to delete hotspot cookie by id
  * @param string $id
  * @return string
  * 
  */
 public function delete($id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ip/hotspot/cookie/remove");
     $sentence->where(".id", "=", $id);
     $enable = $this->talker->send($sentence);
     return "Success";
 }
コード例 #4
0
 /**
  * This method used for delete firewall connection
  * @param type $id string
  * @return type array
  */
 public function delete($id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ip/firewall/connection/remove");
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     return "Sucsess";
 }
コード例 #5
0
ファイル: Wireless.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method is used to disable interface by id
  * @param type $id string
  * @return type array
  */
 public function disable($id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/interface/wireless/disable");
     $sentence->where(".id", "=", $id);
     $enable = $this->talker->send($sentence);
     return "Success";
 }
コード例 #6
0
ファイル: AAA.php プロジェクト: beecode/mikrotik-api
 /**
  * This method is used to set ppp aaa
  * @param type $use_radius string
  * @param type $accounting string
  * @param type $interim_update string
  * @return type array
  */
 public function set($use_radius, $accounting, $interim_update)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ppp/aaa/set");
     $sentence->setAttribute("use-radius", $use_radius);
     $sentence->setAttribute("accounting", $accounting);
     $sentence->setAttribute("interim-update", $interim_update);
     $this->talker->send($sentence);
     return "Sucsess";
 }
コード例 #7
0
ファイル: WebProxy.php プロジェクト: xwiz/mikrotik-api
 /**
  *
  * This method used for set Web Proxy configuration
  * @param array $param
  * @return array
  */
 public function set($param)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ip/proxy/set");
     foreach ($param as $name => $value) {
         $sentence->setAttribute($name, $value);
     }
     $this->talker->send($sentence);
     return "Success";
 }
コード例 #8
0
ファイル: Profile.php プロジェクト: beecode/mikrotik-api
 /**
  * This method is used to set or edit ppp profile by id
  * @param type $param array
  * @param type $id string
  * @return type array
  * 
  */
 public function set($param, $id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ppp/profile/set");
     foreach ($param as $name => $value) {
         $sentence->setAttribute($name, $value);
     }
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     return "Sucsess";
 }
コード例 #9
0
ファイル: System.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method is used to system reset configuration
  * @param type $keep_users string (yes or no)
  * @param type $no_defaults string (yes or no)
  * @param type $skip_backup string (yes or no)
  * @return type array
  */
 public function reset($keep_users, $no_defaults, $skip_backup)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ip/address/add");
     $sentence->setAttribute("keep-users", $keep_users);
     $sentence->setAttribute("no-defaults", $no_defaults);
     $sentence->setAttribute("skip-backup", $skip_backup);
     $this->talker->send($sentence);
     return "Success";
 }
コード例 #10
0
ファイル: Bonding.php プロジェクト: beecode/mikrotik-api
 /**
  * This method is used to delete interface bonding by id
  * 
  * $this->mikrotik_api->interfaces()->bonding()->delete('*1');
  * @param type $id string
  * @return type array
  */
 public function delete($id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/interface/bonding/remove");
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     return "Sucsess";
 }
コード例 #11
0
ファイル: Bridge.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method used for set or edit interface bridge
  * @param type $param array
  * @param type $id string
  * @return type array
  */
 public function set_bridge_nat($param, $id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/interface/bridge/nat/set");
     foreach ($param as $name => $value) {
         $sentence->setAttribute($name, $value);
     }
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     return "Success";
 }
コード例 #12
0
ファイル: DHCPClient.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method is used to remove dhcp client by id
  * @param type $id string
  * @return type array
  */
 public function delete_dhcp_client($id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ip/dhcp-client/remove");
     $sentence->where(".id", "=", $id);
     $enable = $this->talker->send($sentence);
     return "Success";
 }
コード例 #13
0
ファイル: File.php プロジェクト: xwiz/mikrotik-api
 public function create_file($filename, $content)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand('[/lua "local f=assert(io.open(/' . $filename . ', w+));');
     $sentence->addCommand('f:write(' . $content . ');');
     $sentence->addCommand('f:close();');
     $this->talker->send($sentence);
     return "Success";
 }
コード例 #14
0
ファイル: L2TPServer.php プロジェクト: beecode/mikrotik-api
 /**
  * This method used for set l2tp server server
  * @param type $param array
  * @return type array
  */
 public function setServer($param)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/interface/l2tp-server/server/set");
     foreach ($param as $name => $value) {
         $sentence->setAttribute($name, $value);
     }
     $this->talker->send($sentence);
     return "Sucsess";
 }
コード例 #15
0
ファイル: Accounting.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method is used to ip accounting set web-acces
  * @param type $accessible_via_web string default : yes or no
  * @return type array
  * 
  */
 public function set_web_access($accessible_via_web)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ip/accounting/web-access/set");
     $sentence->setAttribute("accessible-via-web", $accessible_via_web);
     $sentence->setAttribute("address", "0.0.0.0/0");
     $this->talker->send($sentence);
     return "Success";
 }
コード例 #16
0
 /**
  * This method is used to change firewall nat based on the id
  * @param type $param array
  * @param type $id string
  * @return type array
  * 
  */
 public function set($param, $id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ip/firewall/address-list/set");
     foreach ($param as $name => $value) {
         $sentence->setAttribute($name, $value);
     }
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     return "Success";
 }
コード例 #17
0
ファイル: DHCPRelay.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method is used to remove ip dhcp relay by id
  * @param type $id string
  * @return type array
  */
 public function delete($id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ip/dhcp-relay/remove");
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     return "Success";
 }