forked from kevinowino869/mitrobill
Add login Internet from User account
This commit is contained in:
@ -19,6 +19,38 @@ class Mikrotik
|
||||
}
|
||||
}
|
||||
|
||||
public static function isUserLogin($client, $username){
|
||||
$printRequest = new RouterOS\Request(
|
||||
'/ip hotspot active print',
|
||||
RouterOS\Query::where('user', $username)
|
||||
);
|
||||
return $client->sendSync($printRequest)->getProperty('.id');
|
||||
}
|
||||
|
||||
public static function logMeIn($client, $user, $pass, $ip, $mac){
|
||||
$addRequest = new RouterOS\Request('/ip/hotspot/active/login');
|
||||
$client->sendSync(
|
||||
$addRequest
|
||||
->setArgument('user', $user)
|
||||
->setArgument('password', $pass)
|
||||
->setArgument('ip', $ip)
|
||||
->setArgument('mac-address', $mac)
|
||||
);
|
||||
}
|
||||
|
||||
public static function logMeOut($client, $user){
|
||||
$printRequest = new RouterOS\Request(
|
||||
'/ip hotspot active print',
|
||||
RouterOS\Query::where('user', $user)
|
||||
);
|
||||
$id = $client->sendSync($printRequest)->getProperty('.id');
|
||||
$removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
|
||||
$client(
|
||||
$removeRequest
|
||||
->setArgument('numbers', $id)
|
||||
);
|
||||
}
|
||||
|
||||
public static function addHotspotPlan($client, $name, $sharedusers, $rate){
|
||||
$addRequest = new RouterOS\Request('/ip/hotspot/user/profile/add');
|
||||
$client->sendSync(
|
||||
|
@ -1,17 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
|
||||
**/
|
||||
|
||||
Class User{
|
||||
public static function _info(){
|
||||
/**
|
||||
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
|
||||
**/
|
||||
|
||||
class User
|
||||
{
|
||||
public static function _info()
|
||||
{
|
||||
$id = $_SESSION['uid'];
|
||||
$d = ORM::for_table('tbl_customers')->find_one($id);
|
||||
return $d;
|
||||
}
|
||||
public static function _billing(){
|
||||
|
||||
public static function _billing()
|
||||
{
|
||||
$id = $_SESSION['uid'];
|
||||
$d = ORM::for_table('tbl_user_recharges')->where('customer_id',$id)->find_one();
|
||||
$d = ORM::for_table('tbl_user_recharges')->where('customer_id', $id)->find_one();
|
||||
return $d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user