/**
  * 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";
 }
Beispiel #2
0
 /**
  * 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";
 }
 /**
  *
  * @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;
     }
 }
Beispiel #4
0
 /**
  * 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;
     }
 }
Beispiel #5
0
 /**
  * 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";
 }
Beispiel #6
0
 /**
  * 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;
     }
 }
Beispiel #7
0
 /**
  * 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;
     }
 }
Beispiel #8
0
 /**
  * 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";
 }
 /**
  * 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;
     }
 }
Beispiel #10
0
 /**
  * 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";
 }