routeros-api-php
routeros-api-php copied to clipboard
PPPoE remote address unset-edit-remove
i want to change remote address of an user.but the is command doesnt work., I want to remove remote-address key from object. how can i do this? This is what i am using
public function chnageUserProfile($username) { $system_profile = Softwaresystem::select('disconnected_package')->first(); $query_ppp_pool = (new Query("/ppp/secret/print"))->where('name', $username); $secrets = $this->client->query($query_ppp_pool)->read(); foreach ($secrets as $secret) { $query = (new Query('/ppp/secret/set')) ->equal('.id', $secret['.id']) ->equal('profile', $system_profile['disconnected_package']) ->equal('remote-address', ' '); $this->client->query($query)->read(); } $query_ppp_pool = (new Query("/ppp/secret/print"))->where('name', $username); return $this->client->query($query_ppp_pool)->read(); }
Hello! Interesting question, probably the reason in a multiple equals, did you tried to change profile and remote-address via two different requests?
I havent checked it yet. let me check it and see the result! maybe it will work if i made two different request!
Hello! Interesting question, probably the reason in a multiple equals, did you tried to change profile and remote-address via two different requests?
we did tried with two different request but i am unable to empty the remote-address field while i am trying to update the user? we want to remove the remove address. unset command doesn't work. it shows undefined properties.. any suggestion how can i unset remote-address?
In your ->equal('remote-address', ' ');
you've got a space between the apostrophes, I'm sure this needs to be ''
no space.
I've got this to remove all DNS servers from ip/dns
/ $dnsSettings->equal('servers' , '');
and I get the desired result.