コード例 #1
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";
 }
コード例 #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
 /**
  *
  * @param type $id string 
  * @return type array
  * 
  */
 public function detail($id)
 {
     $sentence = new SentenceUtil();
     $sentence->fromCommand("/ip/firewall/service-port/print");
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     $rs = $this->talker->getResult();
     $i = 0;
     if ($i < $rs->size()) {
         return $rs->getResultArray();
     } else {
         return "No Ip Firewall Service-Port With This id = " . $id;
     }
 }
コード例 #4
0
ファイル: HotspotCookies.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method is used to display hotspot cookie
  * in detail based on the id
  * @param string $id 
  * @return  array
  *  
  */
 public function detail($id)
 {
     $sentence = new SentenceUtil();
     $sentence->fromCommand("/ip/hotspot/cookie/print");
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     $rs = $this->talker->getResult();
     $i = 0;
     if ($i < $rs->size()) {
         return $rs->getResultArray();
     } else {
         return "No IP Hotspot Cookie With This id = " . $id;
     }
 }
コード例 #5
0
ファイル: PPPServer.php プロジェクト: beecode/mikrotik-api
 /**
  * This method used for set or edit interface ppp-sever
  * @param type $param array
  * @param type $id string
  * @return type array
  */
 public function set($param, $id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/interface/ppp-server/set");
     foreach ($param as $name => $value) {
         $sentence->setAttribute($name, $value);
     }
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     return "Sucsess";
 }
コード例 #6
0
ファイル: VLAN.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method is used to display one vlan
  * in detail based on the id
  * @param type $id string
  * @return type array
  * 
  */
 public function detail($id)
 {
     $sentence = new SentenceUtil();
     $sentence->fromCommand("/interface/vlan/print");
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     $rs = $this->talker->getResult();
     $i = 0;
     if ($i < $rs->size()) {
         return $rs->getResultArray();
     } else {
         return "No Interface VLAN With This id = " . $id;
     }
 }
コード例 #7
0
ファイル: DNS.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method is used to display one dns cache all 
  * in detail based on the id
  * @param type $id string
  * @return type array
  * 
  */
 public function detailCacheAll($id)
 {
     $sentence = new SentenceUtil();
     $sentence->fromCommand("/ip/dns/cache/all/print");
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     $rs = $this->talker->getResult();
     $i = 0;
     if ($i < $rs->size()) {
         return $rs->getResultArray();
     } else {
         return "No Ip DNS Cache All With This Id = " . $id;
     }
 }
コード例 #8
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";
 }
コード例 #9
0
 /**
  * This method is used to display one layer7 protocol
  * in detail based on the id
  * @param type $id string
  * @return type array
  * 
  */
 public function detail($id)
 {
     $sentence = new SentenceUtil();
     $sentence->fromCommand("/ip/firewall/layer7-protocol/print");
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     $rs = $this->talker->getResult();
     $i = 0;
     if ($i < $rs->size()) {
         return $rs->getResultArray();
     } else {
         return "No IP Firewall Layer7 Protocol With This id = " . $id;
     }
 }
コード例 #10
0
ファイル: FirewallMangle.php プロジェクト: xwiz/mikrotik-api
 /**
  * This method used for set or edit Ip Firewall Mangle
  * @param type $param array
  * @param type $id string
  * @return type array
  */
 public function set($param, $id)
 {
     $sentence = new SentenceUtil();
     $sentence->addCommand("/ip/firewall/mangle/set");
     foreach ($param as $name => $value) {
         $sentence->setAttribute($name, $value);
     }
     $sentence->where(".id", "=", $id);
     $this->talker->send($sentence);
     return "Success";
 }