routeros-api-php icon indicating copy to clipboard operation
routeros-api-php copied to clipboard

PPPoE remote address unset-edit-remove

Open n4yeem opened this issue 2 years ago • 4 comments

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(); }

n4yeem avatar Jun 06 '22 17:06 n4yeem

Hello! Interesting question, probably the reason in a multiple equals, did you tried to change profile and remote-address via two different requests?

EvilFreelancer avatar Jun 07 '22 08:06 EvilFreelancer

I havent checked it yet. let me check it and see the result! maybe it will work if i made two different request!

n4yeem avatar Jun 08 '22 06:06 n4yeem

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?

n4yeem avatar Jun 08 '22 15:06 n4yeem

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.

jonth93 avatar Aug 16 '22 08:08 jonth93