//Define nas types $config['nas_types'][0] = ['name' => 'Other', 'id' => 'other', 'active' => true]; $config['nas_types'][1] = ['name' => 'Coova-On-Meshdesk', 'id' => 'CoovaMeshdesk', 'active' => true]; $config['nas_types'][2] = ['name' => 'Mikrotik-API', 'id' => 'Mikrotik-API', 'active' => true];
//First we try to find the client under dynamic_clients $dc = $this->DynamicClients->find() ->where(['DynamicClients.nasidentifier' => $nasidentifier]) ->contain(['DynamicClientSettings']) ->first(); if($dc){ //===CoovaMeshdesk==== if($dc->type == $this->coova_md){ //It is type CoovaMeshdesk => Now try and locate AP to send command to //We have a convention of nasidentifier for meshdesk => mcp_<captive_portal_id> and apdesk => ap_<ap id>_cp_<captive_portal_id> if(preg_match('/^mcp_/' ,$nasidentifier)){ //MESHdesk $this->kickMeshNodeUser($ent,$dc->cloud_id,$token); } if(preg_match('/^ap_/' ,$nasidentifier)){ //APdesk $this->kickApUser($ent,$dc->cloud_id,$token); } sleep(1); //Give MQTT time to do its thing.... } //===Mikrotik-API===