Community discussions

MikroTik App

Search found 53 matches

by MBAGA
Wed Dec 17, 2014 4:00 pm
Forum: Scripting
Topic: hotspot User Profile's on login script works only for first
Replies: 5
Views: 10819

hotspot User Profile's on login script works only for first

Hi i have a problem : i have a hotspot User Profile with scripts on login / on logout which write info into the log but when a User with that User Profile logged in , only if it is the first User Connected the on login script works , while the on logout script always works Shared users are 300. So i...
by MBAGA
Thu Nov 27, 2014 7:00 am
Forum: Scripting
Topic: write into th log bytes in /out on user logout
Replies: 3
Views: 1862

Re: write into th log bytes in /out on user logout

Seems that it can't be get on a on logout script . Nothing happen

There are other solution s?
by MBAGA
Wed Nov 26, 2014 4:15 pm
Forum: Scripting
Topic: write into th log bytes in /out on user logout
Replies: 3
Views: 1862

write into th log bytes in /out on user logout

I have a hotspot user profile with on login and on logout scripts which write into th log information about user .
is it possible to write also bytes in /out on logout ?
by MBAGA
Sun Nov 16, 2014 10:00 pm
Forum: Scripting
Topic: remove entry in walled garden [PHP]
Replies: 14
Views: 7978

Re: remove entry in walled garden [PHP]

fantastic
by MBAGA
Sun Nov 16, 2014 9:00 pm
Forum: Scripting
Topic: remove entry in walled garden [PHP]
Replies: 14
Views: 7978

Re: remove entry in walled garden [PHP]

indeed XD last 2 questions (hope) : 1 ) i tried to concatenate Query parameters like e.g. $util = new RouterOS\Util($client); $util->changeMenu('/ip hotspot walled-garden'); $util->remove(RouterOS\Query::where('dst-host', 'something') && ('comment', 'something'));  unsuccessfully how you Doi...
by MBAGA
Sun Nov 16, 2014 12:11 am
Forum: Scripting
Topic: remove entry in walled garden [PHP]
Replies: 14
Views: 7978

Re: remove entry in walled garden [PHP]

:D yes are apologies but a month ago I did not know what mikrtik was
Oh, I have. You have no idea :lol: .
Respect! :')
by MBAGA
Sat Nov 15, 2014 11:50 pm
Forum: Scripting
Topic: remove entry in walled garden [PHP]
Replies: 14
Views: 7978

Re: remove entry in walled garden [PHP]

I'm twenty & I'm Italian : have patience :roll:

Thanks!
by MBAGA
Sat Nov 15, 2014 10:48 pm
Forum: Scripting
Topic: remove entry in walled garden [PHP]
Replies: 14
Views: 7978

Re: remove entry in walled garden [PHP]

Like?
by MBAGA
Sat Nov 15, 2014 10:30 pm
Forum: Scripting
Topic: remove entry in walled garden [PHP]
Replies: 14
Views: 7978

Re: remove entry in walled garden [PHP]

Thanks aand if i want to print entries where comment="something" ? I tried $printRequest = new RouterOS\Request( '/ip hotspot walled-garden getall .proplist=dst-host', RouterOS\Query::where('comment', 'something') ); echo $client->sendSync($printRequest)->getArgument('dst-host');   but Pri...
by MBAGA
Wed Nov 12, 2014 8:15 pm
Forum: Scripting
Topic: remove entry in walled garden [PHP]
Replies: 14
Views: 7978

Re: remove entry in walled garden [PHP]

I tried this
$util = new RouterOS\Util($client);
$util
    ->changeMenu('/ip hotspot walled-garden')
    ->remove(RouterOS\Query::where('dst-host', 'www.example.com')
    );
$client($util);
but i get

Fatal error: Call to a member function remove() on string
by MBAGA
Wed Nov 12, 2014 6:55 pm
Forum: Scripting
Topic: remove entry in walled garden [PHP]
Replies: 14
Views: 7978

remove entry in walled garden [PHP]

I added "www.example.com" in walled garden with
$addRequest = new RouterOS\Request('/ip hotspot walled-garden add dst-host=www.example.com');
$client($addRequest);
 
now how can i remove it in php ?
Thanks
by MBAGA
Wed Nov 05, 2014 9:00 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

Probably some "protection" . I'll check
Thanks
by MBAGA
Wed Nov 05, 2014 8:39 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

I dont care to make nicer the error message , but to avoid it
Then something "physical" , not "logical" ... I mean , HW or cables ?

I just registered the domain with dns management . Could this got to do?
by MBAGA
Wed Nov 05, 2014 8:00 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

Table is ok with your setting I get : Fatal error: Uncaught exception 'PEAR2\Net\Transmitter\SocketException' with message 'Failed while receiving word' in C:\inetpub\wwwroot\prova\PEAR2\Net\Transmitter\TcpClient.php:199 Stack trace: #0 C:\inetpub\wwwroot\prova\PEAR2\Net\Transmitter\Stream.php(356):...
by MBAGA
Wed Nov 05, 2014 7:00 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

Going back to my server I creatd a VPN PPTP-CLIENT and I added a static route now trying to print the log at the beginning it worked. Then I tried again and after minutes (!) appeared only the first row of the table <tr> <th>Time</th> <th>Topics</th> <th>Message</th> </tr> as if there were no logs ....
by MBAGA
Thu Oct 30, 2014 7:00 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

Now i tried from ether2-TX and it worked, from ether5-GUEST and it worked, from my smartphone and it worked. Then i retried from ether2-TX and it didn't work, from ether5-GUEST and it didn't work, from my smartphone and it didn't work. about 15 minutes later i retried from ether2-TX and it worked, t...
by MBAGA
Thu Oct 30, 2014 5:30 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

Ok but $_SERVER['REMOTE_ADDR'] is anyway 2.34.105.123 which doesn't work The php page with: $client = new RouterOS\Client('2.34.105.123', 'admin', 'XXXXX'); Works on my Easyphp localhost Instead the same page on my hosting doesn't work! unless sometimes (and this is the funny thing) which it works p...
by MBAGA
Wed Oct 29, 2014 9:40 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

RouterBOARD
but I don't need to do this . this is a temporary Situation just to tryy
by MBAGA
Wed Oct 29, 2014 9:30 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

i haven't it
by MBAGA
Wed Oct 29, 2014 9:20 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

yes it change occasionally now is 2.34.105.123
by MBAGA
Wed Oct 29, 2014 9:02 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

>/ip address print Flags: X - disabled, I - invalid, D - dynamic # ADDRESS NETWORK INTERFACE 0 X 192.168.23.1/24 192.168.23.0 bridge2 1 ;;; hotspot network 172.16.0.1/24 172.16.0.0 ether5-GUEST 2 192.168.5.1/24 192.168.5.0 ether2-TX 3 D 192.168.1.3/24 192.168.1.0 ether4_OUTSIDE Port Forwarding Indir...
by MBAGA
Wed Oct 29, 2014 8:19 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

This
just access the same web server (the same PHP file, located at the same place) from a different PC?
by MBAGA
Wed Oct 29, 2014 3:20 am
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

I'm going mad caus I have noticed that works intermittently ! I'm making a few attempts using "Print router logs" http://wiki.mikrotik.com/wiki/API_PHP_package#Print_router_logs that MUST work, and so is, it immediately prints the results. also reloading the page or re-opening the browser ...
by MBAGA
Tue Oct 28, 2014 8:49 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

Try to replace
$client($addRequest);
with
$client->sendSync($addRequest);
Fatal error: Call to a member function sendSync() on a non-object
by MBAGA
Tue Oct 28, 2014 8:19 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

<?php         include('config.php');         include('hybridauth/Hybrid/Auth.php'); use PEAR2\Net\RouterOS; require_once 'PEAR2/Autoload.php'; try {$client = new RouterOS\Client('2.34.107.153', 'admin', 'password');} catch (Exception $e) { ?> <div>Unable to connect to RouterOS.</div> <?php } $addRe...
by MBAGA
Tue Oct 28, 2014 7:36 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

$addRequest = new RouterOS\Request('/ip hotspot user add'); $addRequest     //->setArgument('profile', 'facebook') //Maybe?     //The line below might be needed so that the router and facebook login expire together.     //Otherwise, the router login will persist even after the facebook login has ex...
by MBAGA
Thu Oct 09, 2014 1:15 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

understood
Thanks a lot!
by MBAGA
Thu Oct 09, 2014 12:55 am
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

Doesn't work
What is "login" in the URL?
by MBAGA
Thu Oct 09, 2014 12:23 am
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

This?
$routerQuery = http_build_query(
    array(
        'username' => $user,
        'password' => $psw
    )
);
header('Location: http://192.168.5.1/login?'.$routerQuery);
:?
by MBAGA
Thu Oct 09, 2014 12:00 am
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

So:
1 - I have user, password ($user, $pwd)
2 - I create the hotspot user

php code

$addRequest = new RouterOS\Request('/ip hotspot user add');
$addRequest
    ->setArgument('name', $user)
    ->setArgument('password', $psw);
$client($addRequest);
3 - Which http request for logging user in?
by MBAGA
Wed Oct 08, 2014 10:45 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

ok if I have understood is the http request which gives users access to ...
So I have a problem with this because after the http request I get redirected to the captive portal page
by MBAGA
Wed Oct 08, 2014 9:50 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

The router will "unlock" the client device
ok so since the router can't interpret php I imagine that there is some javascript that "unlocks" the client device... how?
by MBAGA
Wed Oct 08, 2014 9:31 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

NoNo wait I had already done this part. What I was wondering is:
once I create the hotspot user after login, he is still stuck in the walled garden, how can I "unlock" him?
Sorry for the bad English
by MBAGA
Wed Oct 08, 2014 8:40 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

header('Location: http://192.168.5.1/login?' .  $routerQuery);
I don't understand which page is that and what should I do there
by MBAGA
Wed Oct 08, 2014 7:00 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

It works! Thank you all!
by MBAGA
Wed Oct 08, 2014 6:36 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

It says:
Your IP Address Is: 2.34.107.153
Proxy: 172.16.0.1 2.34.107.153 1.1 (Mikrotik HttpProxy)
by MBAGA
Wed Oct 08, 2014 6:06 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

Specify 192.168.1.2 as the IP, not 192.168.5.1.
ok now from ether5-GUEST I open logs.php but I get "Unable to connect to RouterOS."
by MBAGA
Wed Oct 08, 2014 5:48 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

sure
by MBAGA
Wed Oct 08, 2014 5:16 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

use ip cloud, in the advanced section set that the local address should be used. your PHP code will happily take FQDN. but This http://wiki.mikrotik.com/wiki/Manual:IP/Cloud Applies to RouterOS: v6.14+ "Porta esterna" has two boxes, try adding the port number to both of them. And I think ...
by MBAGA
Wed Oct 08, 2014 4:44 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

You could use the API to create a temporary hotspot username and password (also set the account to remove itself on log out), and then redirect the user to the router with the generated username and password in the URL.
yes! but how?
by MBAGA
Wed Oct 08, 2014 4:33 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

after logging in via social networks, users are redirected to a PHP page that gets the data from the profile ... Then?
by MBAGA
Wed Oct 08, 2014 4:15 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

I had already tried, but I get the error: "Enter a port or range of ports valid" Maybe it's the wrong ip?? > /ip address print Flags: X - disabled, I - invalid, D - dynamic # ADDRESS NETWORK INTERFACE 0 X 192.168.23.1/24 192.168.23.0 bridge2 1 ;;; hotspot network 172.16.0.1/24 172.16.0.0 e...
by MBAGA
Wed Oct 08, 2014 3:00 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

Re: how can I "unlock" the internet (in PHP)?

yes. Sorry perhaps I should have to do only one thread?
by MBAGA
Wed Oct 08, 2014 1:22 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

how to compile it ??
by MBAGA
Wed Oct 08, 2014 12:44 pm
Forum: Scripting
Topic: how can I "unlock" the internet (in PHP)?
Replies: 52
Views: 25219

how can I "unlock" the internet (in PHP)?

hi in a captive portal with sites allowed in walled garden, after login, how can I "unlock" the internet (in PHP)?
by MBAGA
Tue Oct 07, 2014 7:00 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

Just be sure you have port-forwarded the correct ports on your gateway router.
how ?
by MBAGA
Tue Oct 07, 2014 6:47 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

But my router is behind another router ...
by MBAGA
Tue Oct 07, 2014 6:27 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

I just need the ip address for a test. Is there a script that writes it in the terminal?
Thanks
by MBAGA
Tue Oct 07, 2014 4:15 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

I'm trying this http://wiki.mikrotik.com/wiki/API_PHP_package#Print_router_logs Vodafone Station | RB750 (192.168.5.1) _____|_____ | | PHP page on localhost on my PC $client = new RouterOS\Client('192.168.5.1', 'admin', 'password'); and it works... but in this case Vodafone Station | RB750 (192.168....
by MBAGA
Mon Oct 06, 2014 4:33 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

I have to try some PHP that connects to the router via IP address and in local with subnet IP address (192.168.5.1) it works ... But from a server?
by MBAGA
Mon Oct 06, 2014 4:30 pm
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Re: Where can I find the IP address ...

I have to try some PHP that connects to the router via IP address and in local with subnet IP address (192.168.5.1) it works ... But from a server?
by MBAGA
Sun Oct 05, 2014 2:00 am
Forum: Scripting
Topic: Where can I find the IP address ...
Replies: 30
Views: 29827

Where can I find the IP address ...

Where can I find the IP address to connect to my RB750 (which is connected to the subnet of my Vodafone Station) from a server?
Thanks