/** * 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"; }
/** * * 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"; }
/** * 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"; }
/** * 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"; }
/** * 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"; }
/** * 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"; }
/** * [[Description]] * @param [[Type]] $filename [[Description]] * @param [[Type]] $contents [[Description]] * @return string [[Description]] */ public function create_file_compat($filename, $contents) { $sentence = new SentenceUtil(); $sentence->addCommand("/file/print"); $sentence->setAttribute("file", $filename); $this->talker->send($sentence); $sentence = new SentenceUtil(); $sentence->addCommand("/file/set"); $sentence->setAttribute("{$filename}.txt", "contents=\"{$contents}\""); $enable = $this->talker->send($sentence); return "Success"; }
/** * 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"; }
/** * This method used for set interface Bridge Settings * @param type $use_ip_firewall string (default : yes or no) * @param type $use_ip_firewall_for_vlan string (default : yes or no) * @param type $use_ip_firewall_for_pppoe string (default : yes or no) * @return type array */ public function set_bridge_settings($use_ip_firewall, $use_ip_firewall_for_vlan, $use_ip_firewall_for_pppoe) { $sentence = new SentenceUtil(); $sentence->fromCommand("/interface/bridge/settings/set"); $sentence->setAttribute("use-ip-firewall", $use_ip_firewall); $sentence->setAttribute("use-ip-firewall-for-vlan", $use_ip_firewall_for_vlan); $sentence->setAttribute("use-ip-firewall-for-pppoe", $use_ip_firewall_for_pppoe); $this->talker->send($sentence); return "Success"; }