Vous êtes sur la page 1sur 60

WIFI COMMUNICATIONS

WIICOM

ANALYSE DES PROBLEMES


REMARQUES

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C:


M011712584572L

Site web : www.wiicomnetwork.com ;


E-mail : contact@wiicomnetwork.com
ANALYSE DES PROBLEMES REMARQUES

ANALYSE DES PROBLEMES REMARQUES

WIFI COMMUNICATIONS

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


SOMMAIRE

SOMMAIRE...............................................................................................................................................................3
HISTORIQUE DES MODIFICATIONS...........................................................................................................................4
Enoncé du problème................................................................................................................................................5
Problématique..........................................................................................................................................................5
Contexte et Description du cas d’utilisation.............................................................................................................5
Composants intervenants........................................................................................................................................5
Description des composants....................................................................................................................................5
Proposition de solution............................................................................................................................................5
HISTORIQUE DES MODIFICATIONS

Date Nom Description de la version


10/03/2021 MBIADJA SIEWE Ivan Wilfrid Création du document

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


Enoncé du problème

Il est question ici de fournir une analyse de la remarque selon laquelle il faut spécifier le port lors de la connexion aux routeurs
conformément à l’architecture.

Composants intervenants

Les composants affectés sont :

Application serveur Application serveur


<< WIICOMNETWORKADMIN >> << WIIDATA >>

Description des composants

1- Activation des datas

Application serveur WIIDATA

ControlMobile.php Abonnement.php

InitConnexionToInternet() ActivationInternetOnRouter()

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


Code source de la fonction ActivationInternetOnRouter()
2

public function ActivationInternetOnRouter($data)
    {
        if ($this->CheckParams($data))
        {
            $ipadr = $data['ip'];
            $adrmac = $data['adrmac'];
        }
        else
        {
            return array('succes' => false, 'msg' => "-1");
        }
        $request = $this->dao->getIdISIMFromIMPI($data['impi']);
        $succes = $this->validator->isDbUpdate($request, 'page');
        if ($succes)
        {
            $response = $request->getValue();
            $verif = $this->dao->CheckIfForfaitDataIsSouscribed($response['idisim']);
            $ok = $this->validator->isDbUpdate($verif, 'page');
            if ($ok)
            {
                $value = $verif->getValue();
                $datauser = $value['data'];
                if ($datauser > 0)
                {

                    //vérification si l'utilisateur a déjà une session dans la bd
                    $verif0 = $this->dao->CheckIfUserAllReadyHaveSessionData($data['impi']);
                    $ok0 = $this->validator->isDbUpdate($verif0, 'page');

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                    if ($ok0)
                    {

                        $this->routorAccess->debug = false; 2
                        $this->routor->debug = false;
                        if ($this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS))
                        {
                            $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA);
                        }
                        else
                        {
                            
                        }

                        // Vérification si l'utilisateur a déjà une session au noveau du routeur des data

                        if ($this->CheckIfActivationInternetOnRouterExist($ipadr))
                        {

                            // vérification si le l'utilisateur est présent dans le routeur d'accès

                            if ($this->CheckIfActivationInternetOnRouterExistInAccess($ipadr))
                            {

                                if ($this->DeleteOfMangleOnRouter($data))
                                {

                                    if ($this->DeleteScriptDecompteDataUser($data))
                                    {

                                        if ($this->DeleteSchedulerExecutionScript($data))
                                        {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                            if ($this->RedirectionUserAccess($ipadr, $data['adrmac']))
                                            {
                                                $result01 = $this->dao-
>DropSessionDataCurrentUser($data['adrmac']); 2
                                                $succes01 = $this->validator->isDbUpdate($result01, 'page');
                                                if ($succes01)
                                                {
                                                    $result = $this->dao->CreateSessionConsoData($data['impi'], 
$data['adrmac'], $data['ip']);
                                                    $succes = $this->validator->isDbUpdate($result, 'page');
                                                    if ($succes)
                                                    {
                                                        $this->routorAccess->debug = false;
                                                        $this->routor->debug = false;
                                                        if ($this->routorAccess->connect(IPROUTERACCESS, USERRO
UTERACCESS, PASSROUTERACCESS))
                                                        {
                                                            $this->routor->connect(IPROUTERDATA, USERROUTERDATA
, PASSROUTERDATA);
                                                            if (!$this-
>CheckIfActivationInternetOnRouterExist($ipadr))
                                                            {
                                                                if ($this->AddMangleDecompteData($data))
                                                                {
                                                                    if ($this-
>ExecutionAddingDecompteScript($data))
                                                                    {
                                                                        if ($this-
>ShedulerExecutionData($data))
                                                                        {
                                                                            if ($this->RedirectionUser($ipadr, 
$adrmac))
                                                                            {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                                                                if ($this->RunScript($adrmac))
                                                                                {
                                                                                    $this->routor-
>disconnect(); 2
                                                                                    $this->routorAccess-
>disconnect();
//                                                                var_dump('ok');
                                                                                    return array('succes' => tr
ue, 'msg' => "Connexion activée avec succès ! ");
                                                                                }
                                                                            }
                                                                            else
                                                                            {
                                                                                if ($this-
>DeleteScriptDecompteDataUser($data) && $this->DeleteOfMangleOnRouter($data) && $this-
>DeleteSchedulerExecutionScript($data))
                                                                                {
                                                                                    return array('succes' => tr
ue, 'msg' => "Erreur réseau ! veuillez réessayer ultérieurement ! last time ");
                                                                                }
                                                                            }
                                                                        }
                                                                        else
                                                                        {
                                                                            if ($this-
>DeleteScriptDecompteDataUser($data) && $this->DeleteOfMangleOnRouter($data))
                                                                            {
                                                                                return array('succes' => true, 
'msg' => "Erreur réseau ! veuillez réessayer ultérieurement ! second time");
                                                                            }
                                                                        }
                                                                    }
                                                                    else

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                                                    {
                                                                        if ($this-
>DeleteOfMangleOnRouter($data))
                                                                        { 2
                                                                            return array('succes' => true, 'msg
' => "Erreur réseau ! veuillez réessayer ultérieurement ! 1rt time");
                                                                        }
                                                                    }
                                                                }
                                                                else
                                                                {
                                                                    return array('succes' => true, 'msg' => "Er
reur réseau ! veuillez réessayer ultérieurement ! ");
                                                                }
                                                            }
                                                            else
                                                            {
                                                                return array("succes" => true, "msg" => "Votre 
connexion est activée");
                                                            }
                                                        }
                                                        return array('succes' => true, 'msg' => "Votre connexio
n est déjà activée !");
                                                    }
                                                    else
                                                    {
                                                        return array("succes" => FALSE, "msg" => "-1");
                                                    }
                                                }
                                                else
                                                {
                                                    
                                                }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                            }
                                            else
                                            {
                                                 2
                                            }
                                        }
                                        else
                                        {
                                            
                                        }
                                    }
                                    else
                                    {
                                        
                                    }
                                }
                                else
                                {
                                    
                                }
                            }
                            else
                            {
                                return array('succes' => true, 'msg' => "Votre connexion est déjà activée !");
                            }
                        }
                        else
                        {
                            if ($this->DeleteOfMangleOnRouter($data))
                            {
                                if ($this->DeleteScriptDecompteDataUser($data))
                                {
                                    if ($this->DeleteSchedulerExecutionScript($data))

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                    {
                                        
                                    }
                                } 2
                            }
                            $result01 = $this->dao->DropSessionDataCurrentUser($data['adrmac']);
                            $succes01 = $this->validator->isDbUpdate($result01, 'page');
                            if ($succes01)
                            {
                                $result = $this->dao->CreateSessionConsoData($data['impi'], $data['adrmac'], $da
ta['ip']);
                                $succes = $this->validator->isDbUpdate($result, 'page');
                                if ($succes)
                                {
                                    $this->routorAccess->debug = false;
                                    $this->routor->debug = false;
                                    if ($this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTE
RACCESS))
                                    {
                                        $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA);
                                        if (!$this->CheckIfActivationInternetOnRouterExist($ipadr))
                                        {
                                            if ($this->AddMangleDecompteData($data))
                                            {
                                                if ($this->ExecutionAddingDecompteScript($data))
                                                {
                                                    if ($this->ShedulerExecutionData($data))
                                                    {
                                                        if ($this->RedirectionUser($ipadr, $adrmac))
                                                        {
                                                            if ($this->RunScript($adrmac))
                                                            {
                                                                $this->routor->disconnect();

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                                                $this->routorAccess->disconnect();
//                                                                var_dump('ok');
                                                                return array('succes' => true, 'msg' => "Connex
ion activée avec succès ! "); 2
                                                            }
                                                        }
                                                        else
                                                        {
                                                            if ($this->DeleteScriptDecompteDataUser($data) && $
this->DeleteOfMangleOnRouter($data) && $this->DeleteSchedulerExecutionScript($data))
                                                            {
                                                                return array('succes' => true, 'msg' => "Erreur 
réseau ! veuillez réessayer ultérieurement ! last time ");
                                                            }
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if ($this->DeleteScriptDecompteDataUser($data) && $thi
s->DeleteOfMangleOnRouter($data))
                                                        {
                                                            return array('succes' => true, 'msg' => "Erreur rés
eau ! veuillez réessayer ultérieurement ! second time");
                                                        }
                                                    }
                                                }
                                                else
                                                {
                                                    if ($this->DeleteOfMangleOnRouter($data))
                                                    {
                                                        return array('succes' => true, 'msg' => "Erreur réseau 
! veuillez réessayer ultérieurement ! 1rt time");
                                                    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                                }
                                            }
                                            else
                                            { 2
                                                return array('succes' => true, 'msg' => "Erreur réseau ! veuill
ez réessayer ultérieurement ! ");
                                            }
                                        }
                                        else
                                        {
                                            return array("succes" => true, "msg" => "Votre connexion est activé
e");
                                        }
                                    }
                                    return array('succes' => true, 'msg' => "Votre connexion est déjà activée !
");
                                }
                                else
                                {
                                    return array("succes" => FALSE, "msg" => "-1");
                                }
                            }
                        }
                    }
                    else
                    {

                        $result = $this->dao->CreateSessionConsoData($data['impi'], $data['adrmac'], $dat
a['ip']);
                        $succes = $this->validator->isDbUpdate($result, 'page');
                        if ($succes)
                        {
                            $this->routorAccess->debug = false;

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                            $this->routor->debug = false;
                            if ($this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS)
)
                            { 2
                                $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA);
                                if (!$this->CheckIfActivationInternetOnRouterExist($ipadr))
                                {
                                    if ($this->AddMangleDecompteData($data))
                                    {
                                        if ($this->ExecutionAddingDecompteScript($data))
                                        {
                                            if ($this->ShedulerExecutionData($data))
                                            {
                                                if ($this->RedirectionUser($ipadr, $adrmac))
                                                {
                                                    if ($this->RunScript($adrmac))
                                                    {
                                                        $this->routor->disconnect();
                                                        $this->routorAccess->disconnect();

                                                        return array('succes' => true, 'msg' => "Connexion acti
vée avec succès ! ");
                                                    }
                                                }
                                                else
                                                {
                                                    if ($this->DeleteScriptDecompteDataUser($data) && $this-
>DeleteOfMangleOnRouter($data) && $this->DeleteSchedulerExecutionScript($data))
                                                    {
                                                        return array('succes' => true, 'msg' => "Erreur réseau 
! veuillez réessayer ultérieurement ! last time");
                                                    }
                                                }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                            }
                                            else
                                            {
                                                if ($this->DeleteScriptDecompteDataUser($data) && $this-
2
>DeleteOfMangleOnRouter($data))
                                                {
                                                    return array('succes' => true, 'msg' => "Erreur réseau ! ve
uillez réessayer ultérieurement ! second time");
                                                }
                                            }
                                        }
                                        else
                                        {

                                            if ($this->DeleteOfMangleOnRouter($data))
                                            {
                                                return array('succes' => true, 'msg' => "Erreur réseau ! veuill
ez réessayer ultérieurement ! 1rt time");
                                            }
                                        }
                                    }
                                    else
                                    {
                                        return array('succes' => true, 'msg' => "Erreur réseau ! veuillez réess
ayer ultérieurement ! ");
                                    }
                                }
                                else
                                {
                                    return array("succes" => true, "msg" => "Votre connexion est activée");
                                }
                            }
                            return array('succes' => true, 'msg' => "Votre connexion est déjà activée !");

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                        }
                        else
                        {
                            return array("succes" => FALSE, "msg" => "-1"); 2
                        }
                    }
                }
                else
                {
                    return array("succes" => FALSE, "msg" => "-2");
                }
            }
            else
            {
                return array("succes" => FALSE, "msg" => "-1");
            }
        }
    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


2- Test d’activation
2

Application serveur WIIDATA

ControlMobile.php Abonnement.php

InitTestActivation() TestActivationInternetOnRouter()

DesactivationInternetOnRouterOfExchangeEquipement()

Fonction TestActivationInternetOnRouter()
public function TestActivationInternetOnRouter($data)
    {
        if (isset($data['adrmac']))
        {
            $adrmac = $data['adrmac'];
            $ipadr = $data['ip'];
        }
        else
        {
            return array('succes' => 'false', 'msg' => "Erreur lors de l'envoi des paramètres ! ");
        }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


        $this->routor->debug = false;
//         var_dump(IPROUTERDATA);
//        var_dump(USERROUTERDATA);
//        var_dump(PASSROUTERDATA); 2
        if ($this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA))
        {

            if ($this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS))
            {
                $ARRAY = $this->routor->comm("/ip/firewall/mangle/print", array(
                    ".proplist" => ".id",
                    "?comment" => "out_$adrmac"
                ));
                if (isset($ARRAY[0]))
                {
                    // vérification si le l'utilisateur est présent dans le routeur d'accès

                    if ($this->CheckIfActivationInternetOnRouterExistInAccess($ipadr))
                    {
                        var_dump('ok');
                        if (isset($data['impi']))
                        {
                            if ($this->DeleteOfMangleOnRouter($data))
                            {
                                if ($this->DeleteScriptDecompteDataUser($data))
                                {
                                    if ($this->DeleteSchedulerExecutionScript($data))
                                    {
                                        if ($this->RedirectionUserAccess($ipadr, $data['adrmac']))
                                        {
                                            $result01 = $this->dao-
>DropSessionDataCurrentUser($data['adrmac']);
                                            $succes01 = $this->validator->isDbUpdate($result01, 'page');

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                            if ($succes01)
                                            {
                                                $result = $this->dao->CreateSessionConsoData($data['impi'], $da
ta['adrmac'], $data['ip']); 2
                                                $succes = $this->validator->isDbUpdate($result, 'page');
                                                var_dump('ok');
                                                if ($succes)
                                                {
                                                    $this->routorAccess->debug = false;
                                                    $this->routor->debug = false;
                                                    if ($this->routorAccess->connect(IPROUTERACCESS, USERROUTER
ACCESS, PASSROUTERACCESS))
                                                    {
                                                        $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PA
SSROUTERDATA);
                                                        if (!$this-
>CheckIfActivationInternetOnRouterExist($ipadr))
                                                        {
                                                            if ($this->AddMangleDecompteData($data))
                                                            {
                                                                if ($this-
>ExecutionAddingDecompteScript($data))
                                                                {
                                                                    if ($this->ShedulerExecutionData($data))
                                                                    {
                                                                        if ($this->RedirectionUser($ipadr, $adr
mac))
                                                                        {
                                                                            if ($this->RunScript($adrmac))
                                                                            {
                                                                                $this->routor->disconnect();
                                                                                $this->routorAccess-
>disconnect();

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


//                                                                var_dump('ok');
                                                                                return array('succes' => true, 
'msg' => "Votre connexion internet est activée");
                                                                            } 2
                                                                        }
                                                                        else
                                                                        {
                                                                            if ($this-
>DeleteScriptDecompteDataUser($data) && $this->DeleteOfMangleOnRouter($data) && $this-
>DeleteSchedulerExecutionScript($data))
                                                                            {
                                                                                return array('succes' => true, 
'msg' => "Erreur réseau ! veuillez réessayer ultérieurement ! last time ");
                                                                            }
                                                                        }
                                                                    }
                                                                    else
                                                                    {
                                                                        if ($this-
>DeleteScriptDecompteDataUser($data) && $this->DeleteOfMangleOnRouter($data))
                                                                        {
                                                                            return array('succes' => true, 'msg
' => "Erreur réseau ! veuillez réessayer ultérieurement ! second time");
                                                                        }
                                                                    }
                                                                }
                                                                else
                                                                {
                                                                    if ($this->DeleteOfMangleOnRouter($data))
                                                                    {
                                                                        return array('succes' => true, 'msg' => 
"Erreur réseau ! veuillez réessayer ultérieurement ! 1rt time");
                                                                    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                                                }
                                                            }
                                                            else
                                                            { 2
                                                                return array('succes' => true, 'msg' => "Erreur 
réseau ! veuillez réessayer ultérieurement ! ");
                                                            }
                                                        }
                                                        else
                                                        {
                                                            return array("succes" => true, "msg" => "Votre conn
exion est activée");
                                                        }
                                                    }
                                                    return array('succes' => true, 'msg' => "Votre connexion es
t activée");
                                                }
                                                else
                                                {
                                                    return array("succes" => FALSE, "msg" => "-1");
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            $eye = $this->DesactivationInternetOnRouterOfExchangeEquipement($data);
                            if ($eye['succes'])
                            {
                                $see = $this->ActivationInternetPc($data);

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                if ($see['succes'])
                                {
                                    return array('succes' => true, 'msg' => 'Votre connexion internet est activ
ée'); 2
                                }
                                else
                                {
                                    return array('succes' => false, 'msg' => 'Votre connexion internet est désa
ctivée');
                                }
                            }
                            else
                            {
                                return array('succes' => false, 'msg' => 'Votre connexion internet est désactiv
ée');
                            }
                        }
                    }
                    else
                    {
                        return array('succes' => true, 'msg' => 'Votre connexion internet est activée');
                    }
                }
                else
                {
                    return array('succes' => false, 'msg' => 'Votre connexion internet est désactivée');
                }

                $this->routor->disconnect();
                $this->routorAccess->disconnect();
            }
            else
            {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                return array('succes' => false, 'msg' => 'Erreur routeur Ac');
            }
        }
        else 2
        {
            return array('succes' => false, 'msg' => 'Erreur routeur data');
        }
    }

Fonction DesactivationInternetOnRouterOfExchangeEquipement()
public function DesactivationInternetOnRouterOfExchangeEquipement($data)
    {

        $result = $this->dao->SearchInfosDataCurrentUserPc($data['adrmac']);
        $succes = $this->validator->isResult($result, 'page');
        if ($succes)
        {
            $adrip = $result->getValue()['ip'];
            $this->routor->debug = false;
            $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA);
            if ($this->CheckIfActivationInternetOnRouterExist($adrip))
            {
                $this->routorAccess->debug = false;
                $this->routor->debug = false;
                $this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS);
                $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA);
                // suppression
                if ($this->RedirectionUserAccess($adrip, $data['adrmac']))
                {
WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L
2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                    if ($this->DeleteSchedulerExecutionScript($data))
                    {
                        if ($this->DeleteOfMangleOnRouter($data))
                        { 2
                            if ($this->DeleteScriptDecompteDataUser($data))
                            {
                                return array('succes' => true, 'msg' => "Déconnexion effectuée avec succès ! ")
;
                                $this->routor->disconnect();
                                $this->routorAccess->disconnect();
                            }
                            else
                            {
                                return array('succes' => false, 'msg' => "Erreur réseau ! ");
                            }
                        }
                        else
                        {
                            return array('succes' => false, 'msg' => "Erreur réseau ! ");
                        }
                    }
                    else
                    {
                        return array('succes' => false, 'msg' => "Erreur réseau ! ");
                    }
                }
                else
                {
                    return array('succes' => false, 'msg' => "Erreur réseau ! ");
                }
            }
            else
            {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                if ($this->DeleteSchedulerExecutionScript($data))
                {
                    if ($this->DeleteOfMangleOnRouter($data))
                    { 2
                        if ($this->DeleteScriptDecompteDataUser($data))
                        {
                            
                        }
                    }
                }
                return array('succes' => true, 'msg' => "Votre connexion est déjà désactivée ! ");
            }
        }
        else
        {
            return array('succes' => false, 'msg' => "Erreur réseau ! ");
        }
    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


3- Désactivation Internet 2

Application serveur WIIDATA

ControlMobile.php Abonnement.php

InitDeconnexionOnInternet() DesactivationInternetOnRouter()

Fonction DesactivationInternetOnRouter()
public function DesactivationInternetOnRouter($data)
    {
        if (isset($data['adrmac']))
        {
            $adrmac = $data['adrmac'];
        }
        else
        {
            return array('succes' => 'false', 'msg' => "Impossible de désactiver la connexion internet adresse i
p introuvable ! ");
        }
        $result = $this->dao->SearchInfosDataCurrentUser($data['adrmac']);
        $succes = $this->validator->isDbUpdate($result, 'page');
WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L
2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


        if ($succes)
        {
            $impi = $result->getValue()['impi'];
            $adrip = $result->getValue()['adrip']; 2
            $conso = $result->getValue()['conso'];
            $debut = $result->getValue()['datedebut'];
            $dateupda = $result->getValue()['dateupda'];
            $result0 = $this->dao->CreateHistoriqueConsoData($impi, $data['adrmac'], $adrip, $conso, $debut, $da
teupda);
            $succes0 = $this->validator->isDbUpdate($result0, 'page');
            if ($succes0)
            {
                $result01 = $this->dao->DropSessionDataCurrentUser($data['adrmac']);
                $succes01 = $this->validator->isDbUpdate($result01, 'page');
                if ($succes01)
                {
                    $this->routor->debug = false;
                    $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA);
                    if ($this->CheckIfActivationInternetOnRouterExist($adrip))
                    {
                        $this->routorAccess->debug = false;
                        $this->routor->debug = false;
                        $this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS);
                        $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA);
                        // suppression
                        if ($this->RedirectionUserAccess($adrip, $data['adrmac']))
                        {
                            if ($this->DeleteSchedulerExecutionScript($data))
                            {
                                if ($this->DeleteOfMangleOnRouter($data))
                                {
                                    if ($this->DeleteScriptDecompteDataUser($data))
                                    {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                        return array('succes' => true, 'msg' => "Déconnexion effectuée avec suc
cès ! ");
                                        $this->routor->disconnect();
                                        $this->routorAccess->disconnect(); 2
                                    }
                                    else
                                    {
                                        return array('succes' => false, 'msg' => "Erreur réseau ! ");
                                    }
                                }
                                else
                                {
                                    return array('succes' => false, 'msg' => "Erreur réseau ! ");
                                }
                            }
                            else
                            {
                                return array('succes' => false, 'msg' => "Erreur réseau ! ");
                            }
                        }
                        else
                        {
                            return array('succes' => false, 'msg' => "Erreur réseau ! ");
                        }
                    }
                    else
                    {
                        if ($this->DeleteSchedulerExecutionScript($data))
                        {
                            if ($this->DeleteOfMangleOnRouter($data))
                            {
                                if ($this->DeleteScriptDecompteDataUser($data))
                                {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                    
                                }
                            }
                        } 2
                        return array('succes' => true, 'msg' => "Votre connexion est déjà désactivée ! ");
                    }
                }
                else
                {
                    return array('succes' => false, 'msg' => "Erreur réseau ! ");
                }
            }
            else
            {
                return array('succes' => 'true', 'msg' => "Erreur réseau ! ");
            }
        }
        else
        {
            return array('succes' => 'true', 'msg' => "Erreur réseau ! ");
        }
    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


4- Activation Internet PC 2

Application serveur WIIDATA

ControlMobile.php Abonnement.php

InitConnexionToInternetpc() ActivationInternetPC()

Fonction ActivationInternetPC()
public function ActivationInternetPc($data)
    {
        if ($this->CheckParams($data))
        {
            $ipadr = $data['ip'];
            $adrmac = $data['adrmac'];
        }
        else
        {
            return array('succes' => false, 'msg' => "Paramètres incorrectes !");
        }
        if ($adrmac)
        {
            $verif = $this->dao->getInfosForPc($adrmac);

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


            $ok = $this->validator->isDbUpdate($verif, 'page');
            if ($ok)
            {
                $value = $verif->getValue(); 2
                $datauser = $value['data'];
                if ($datauser > 0)
                {
                    $this->routorAccess->debug = false;
                    $this->routor->debug = false;
                    if ($this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS))
                    {
                        $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA);
                        if (!$this->CheckIfActivationInternetOnRouterExist($ipadr))
                        {
                            if ($this->AddMangleDecompteData($data))
                            {
                                if ($this->ExecutionAddingDecompteScript($data))
                                {
                                    if ($this->ShedulerExecutionData($data))
                                    {
                                        if ($this->RedirectionUser($ipadr, $adrmac))
                                        {
                                            if ($this->RunScript($adrmac))
                                            {
                                                $this->routor->disconnect();
                                                $this->routorAccess->disconnect();
                                                return array('succes' => true, 'msg' => "Connexion activée avec 
succès ! ");
                                            }
                                        }
                                        else
                                        {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                                            if ($this->DeleteScriptDecompteDataUser($data) && $this-
>DeleteOfMangleOnRouter($data) && $this->DeleteSchedulerExecutionScript($data))
                                            {
                                                return array('succes' => true, 'msg' => "Erreur réseau ! veuill
2
ez réessayer ultérieurement ! last time ");
                                            }
                                        }
                                    }
                                    else
                                    {
                                        if ($this->DeleteScriptDecompteDataUser($data) && $this-
>DeleteOfMangleOnRouter($data))
                                        {
                                            return array('succes' => true, 'msg' => "Erreur réseau ! veuillez r
éessayer ultérieurement ! second time");
                                        }
                                    }
                                }
                                else
                                {
                                    if ($this->DeleteOfMangleOnRouter($data))
                                    {
                                        return array('succes' => true, 'msg' => "Erreur réseau ! veuillez réess
ayer ultérieurement ! 1rt time");
                                    }
                                }
                            }
                            else
                            {
                                return array('succes' => true, 'msg' => "Erreur réseau ! veuillez réessayer ult
érieurement ! ");
                            }
                        }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                        else
                        {
                            return array("succes" => true, "msg" => "Votre connexion est activée");
                        } 2
                    }
                    return array('succes' => true, 'msg' => "Votre connexion est déjà activée !");
                }
                else
                {
                    return array("succes" => FALSE, "msg" => "Vous n'avez plus assez de data pour vous connecter 
à internet !");
                }
            }
            else
            {
                return array("succes" => FALSE, "msg" => "-1");
            }
        }
    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


2

5- Désactivation Internet PC

Application serveur WIIDATA

ControlMobile.php Abonnement.php

InitConnexionToInternetPc() DesactivationInternetOnRouterOfExchangeEquipement()

Fonction DesactivationInternetOnRouterOfExchangeEquipement()
public function DesactivationInternetOnRouterOfExchangeEquipement($data)
    {

        $result = $this->dao->SearchInfosDataCurrentUserPc($data['adrmac']);
        $succes = $this->validator->isResult($result, 'page');
        if ($succes)
        {
            $adrip = $result->getValue()['ip'];
            $this->routor->debug = false;
            $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA);
            if ($this->CheckIfActivationInternetOnRouterExist($adrip))
            {
                $this->routorAccess->debug = false;
WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L
2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                $this->routor->debug = false;
                $this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS);
                $this->routor->connect(IPROUTERDATA, USERROUTERDATA, PASSROUTERDATA);
                // suppression 2
                if ($this->RedirectionUserAccess($adrip, $data['adrmac']))
                {
                    if ($this->DeleteSchedulerExecutionScript($data))
                    {
                        if ($this->DeleteOfMangleOnRouter($data))
                        {
                            if ($this->DeleteScriptDecompteDataUser($data))
                            {
                                return array('succes' => true, 'msg' => "Déconnexion effectuée avec succès ! ")
;
                                $this->routor->disconnect();
                                $this->routorAccess->disconnect();
                            }
                            else
                            {
                                return array('succes' => false, 'msg' => "Erreur réseau ! ");
                            }
                        }
                        else
                        {
                            return array('succes' => false, 'msg' => "Erreur réseau ! ");
                        }
                    }
                    else
                    {
                        return array('succes' => false, 'msg' => "Erreur réseau ! ");
                    }
                }
                else

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                {
                    return array('succes' => false, 'msg' => "Erreur réseau ! ");
                }
            } 2
            else
            {
                if ($this->DeleteSchedulerExecutionScript($data))
                {
                    if ($this->DeleteOfMangleOnRouter($data))
                    {
                        if ($this->DeleteScriptDecompteDataUser($data))
                        {
                            
                        }
                    }
                }
                return array('succes' => true, 'msg' => "Votre connexion est déjà désactivée ! ");
            }
        }
        else
        {
            return array('succes' => false, 'msg' => "Erreur réseau ! ");
        }
    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


2

6- Facturation VOD

Application serveur WIIDATA

ControlMobile.php Abonnement.php

UpdateDataUserForMedia() DesactivationInternetOnRouterVod()
DesactivationInternetOnRouterOfExchangeEquipementVod()

Fonction DesactivationInternetOnRouterVod()
    public function DesactivationInternetOnRouterVod($data)
    {
        if (isset($data['adrmac']))
        {
            $adrmac = $data['adrmac'];
        }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


        else
        {
            return array('succes' => 'false', 'msg' => "Impossible de désactiver la connexion internet adresse i
p introuvable ! "); 2
        }
        $result = $this->dao->SearchInfosDataCurrentUserVod($data['adrmac']);
        $succes = $this->validator->isResult($result, 'page');
        if ($succes)
        {
            $impi = $result->getValue()['impi'];
            $adrip = $result->getValue()['adrip'];
            $conso = $result->getValue()['conso'];
            $debut = $result->getValue()['datedebut'];
            $dateupda = $result->getValue()['dateupda'];
            $result0 = $this->dao->CreateHistoriqueConsoDataVod($impi, $data['adrmac'], $adrip, $conso, $debut, 
$dateupda);
            $succes0 = $this->validator->isDbUpdate($result0, 'page');
            if ($succes0)
            {
                $result01 = $this->dao->DropSessionDataCurrentUserVod($data['adrmac']);
                $succes01 = $this->validator->isDbUpdate($result01, 'page');
                if ($succes01)
                {
                    $this->routor->debug = false;
                    $this->routor->connect(IPROUTERSERVER, USERROUTERSERVER, PASSROUTERSERVER);
                    if ($this->CheckIfActivationInternetOnRouterVodExist($adrip))
                    {
                        $this->routorAccess->debug = false;
                        $this->routor->debug = false;
                        $this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS);
                        $this->routor->connect(IPROUTERSERVER, USERROUTERSERVER, PASSROUTERSERVER);
                        // suppression
                        if ($this->RedirectionUserAccessVod($adrip, $data['adrmac']))

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                        {
                            if ($this->DeleteSchedulerExecutionScript($data))
                            {
                                if ($this->DeleteOfMangleOnRouter($data)) 2
                                {
                                    if ($this->DeleteScriptDecompteDataUser($data))
                                    {
                                        return array('succes' => true, 'msg' => "Déconnexion effectuée avec suc
cès ! ");
                                        $this->routor->disconnect();
                                        $this->routorAccess->disconnect();
                                    }
                                    else
                                    {
                                        return array('succes' => false, 'msg' => "Erreur réseau ! ");
                                    }
                                }
                                else
                                {
                                    return array('succes' => false, 'msg' => "Erreur réseau ! ");
                                }
                            }
                            else
                            {
                                return array('succes' => false, 'msg' => "Erreur réseau ! ");
                            }
                        }
                        else
                        {
                            return array('succes' => false, 'msg' => "Erreur réseau ! ");
                        }
                    }
                    else

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                    {
                        if ($this->DeleteSchedulerExecutionScript($data))
                        {
                            if ($this->DeleteOfMangleOnRouter($data)) 2
                            {
                                if ($this->DeleteScriptDecompteDataUser($data))
                                {
                                    
                                }
                            }
                        }
                        return array('succes' => true, 'msg' => "Votre connexion est déjà désactivée ! ");
                    }
                }
                else
                {
                    return array('succes' => false, 'msg' => "Erreur réseau ! ");
                }
            }
            else
            {
                return array('succes' => 'true', 'msg' => "Erreur réseau ! ");
            }
        }
        else
        {
            return array('succes' => 'true', 'msg' => "Erreur réseau ! ");
        }
    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


2

Fonction DesactivationInternetOnRouterOfExchangeEquipementVod ()

    public function DesactivationInternetOnRouterOfExchangeEquipementVod($data)
    {

        $result = $this->dao->SearchInfosDataCurrentUserPc($data['adrmac']);
        $succes = $this->validator->isResult($result, 'page');
        if ($succes)
        {
            $adrip = $result->getValue()['ip'];
            $this->routor->debug = false;
            $this->routor->connect(IPROUTERSERVER, USERROUTERSERVER, PASSROUTERSERVER);
            if ($this->CheckIfActivationInternetOnRouterVodExist($adrip))
            {
                $this->routorAccess->debug = false;
                $this->routor->debug = false;
                $this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS);
                $this->routor->connect(IPROUTERSERVER, USERROUTERSERVER, PASSROUTERSERVER);
                // suppression
                if ($this->RedirectionUserAccessVod($adrip, $data['adrmac']))
                {
                    if ($this->DeleteSchedulerExecutionScript($data))
                    {
                        if ($this->DeleteOfMangleOnRouter($data))

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                        {
                            if ($this->DeleteScriptDecompteDataUser($data))
                            {
                                return array('succes' => true, 'msg' => "Déconnexion effectuée avec succès ! ")
2
;
                                $this->routor->disconnect();
                                $this->routorAccess->disconnect();
                            }
                            else
                            {
                                return array('succes' => false, 'msg' => "Erreur réseau ! ");
                            }
                        }
                        else
                        {
                            return array('succes' => false, 'msg' => "Erreur réseau ! ");
                        }
                    }
                    else
                    {
                        return array('succes' => false, 'msg' => "Erreur réseau ! ");
                    }
                }
                else
                {
                    return array('succes' => false, 'msg' => "Erreur réseau ! ");
                }
            }
            else
            {
                if ($this->DeleteSchedulerExecutionScript($data))
                {
                    if ($this->DeleteOfMangleOnRouter($data))

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                    {
                        if ($this->DeleteScriptDecompteDataUser($data))
                        {
                             2
                        }
                    }
                }
                return array('succes' => true, 'msg' => "Votre connexion est déjà désactivée ! ");
            }
        }
        else
        {
            return array('succes' => false, 'msg' => "Erreur réseau ! ");
        }
    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


2

7- Facturation Messagerie Multimédia

Application serveur WIIDATA

ControlMobile.php Abonnement.php

UpdateDataUserForChat() DesactivationInternetOnRouterChat()
DesactivationInternetOnRouterOfExchangeEquipementchat()

Fonction DesactivationInternetOnRouterChat()

    public function DesactivationInternetOnRouterChat($data)
    {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


        if (isset($data['adrmac']))
        {
            $adrmac = $data['adrmac'];
        } 2
        else
        {
            return array('succes' => 'false', 'msg' => "Impossible de désactiver la connexion internet adresse i
p introuvable ! ");
        }
        $result = $this->dao->SearchInfosDataCurrentUserChat($data['adrmac']);
        $succes = $this->validator->isResult($result, 'page');
        if ($succes)
        {
            $impi = $result->getValue()['impi'];
            $adrip = $result->getValue()['adrip'];
            $conso = $result->getValue()['conso'];
            $debut = $result->getValue()['datedebut'];
            $dateupda = $result->getValue()['dateupda'];
            $result0 = $this->dao->CreateHistoriqueConsoDataChat($impi, $data['adrmac'], $adrip, $conso, $debut, 
$dateupda);
            $succes0 = $this->validator->isDbUpdate($result0, 'page');
            if ($succes0)
            {
                $result01 = $this->dao->DropSessionDataCurrentUserChat($data['adrmac']);
                $succes01 = $this->validator->isDbUpdate($result01, 'page');
                if ($succes01)
                {
                    $this->routor->debug = false;
                    $this->routor->connect(IPROUTERSERVER, USERROUTERSERVER, PASSROUTERSERVER);
                    if ($this->CheckIfActivationInternetOnRouterChatExist($adrip))
                    {
                        $this->routorAccess->debug = false;
                        $this->routor->debug = false;

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                        $this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS);
                        $this->routor->connect(IPROUTERSERVER, USERROUTERSERVER, PASSROUTERSERVER);
                        // suppression
                        if ($this->RedirectionUserAccessChat($adrip, $data['adrmac'])) 2
                        {
                            if ($this->DeleteSchedulerExecutionScript($data))
                            {
                                if ($this->DeleteOfMangleOnRouterForChat($data))
                                {
                                    if ($this->DeleteScriptDecompteDataUser($data))
                                    {
                                        return array('succes' => true, 'msg' => "Déconnexion effectuée avec suc
cès ! ");
                                        $this->routor->disconnect();
                                        $this->routorAccess->disconnect();
                                    }
                                    else
                                    {
                                        return array('succes' => false, 'msg' => "Erreur réseau ! ");
                                    }
                                }
                                else
                                {
                                    return array('succes' => false, 'msg' => "Erreur réseau ! ");
                                }
                            }
                            else
                            {
                                return array('succes' => false, 'msg' => "Erreur réseau ! ");
                            }
                        }
                        else
                        {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                            return array('succes' => false, 'msg' => "Erreur réseau ! ");
                        }
                    }
                    else 2
                    {
                        if ($this->DeleteSchedulerExecutionScript($data))
                        {
                            if ($this->DeleteOfMangleOnRouterForChat($data))
                            {
                                if ($this->DeleteScriptDecompteDataUser($data))
                                {
                                    
                                }
                            }
                        }
                        return array('succes' => true, 'msg' => "Votre connexion est déjà désactivée ! ");
                    }
                }
                else
                {
                    return array('succes' => false, 'msg' => "Erreur réseau ! ");
                }
            }
            else
            {
                return array('succes' => 'true', 'msg' => "Erreur réseau ! ");
            }
        }
        else
        {
            return array('succes' => 'true', 'msg' => "Erreur réseau ! ");
        }
    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


2

Fonction DesactivationInternetOnRouterOfExchangeEquipementchat()

    public function DesactivationInternetOnRouterOfExchangeEquipementChat($data)
    {

        $result = $this->dao->SearchInfosDataCurrentUserPc($data['adrmac']);
        $succes = $this->validator->isResult($result, 'page');
        if ($succes)
        {
            $adrip = $result->getValue()['ip'];
            $this->routor->debug = false;
            $this->routor->connect(IPROUTERSERVER, USERROUTERSERVER, PASSROUTERSERVER);
            if ($this->CheckIfActivationInternetOnRouterChatExist($adrip))
            {
                $this->routorAccess->debug = false;
                $this->routor->debug = false;
                $this->routorAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS);
                $this->routor->connect(IPROUTERSERVER, USERROUTERSERVER, PASSROUTERSERVER);
                // suppression
                if ($this->RedirectionUserAccessChat($adrip, $data['adrmac']))
                {
                    if ($this->DeleteSchedulerExecutionScript($data))
WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L
2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                    {
                        if ($this->DeleteOfMangleOnRouterForChat($data))
                        {
                            if ($this->DeleteScriptDecompteDataUser($data)) 2
                            {
                                return array('succes' => true, 'msg' => "Déconnexion effectuée avec succès ! ")
;
                                $this->routor->disconnect();
                                $this->routorAccess->disconnect();
                            }
                            else
                            {
                                return array('succes' => false, 'msg' => "Erreur réseau ! ");
                            }
                        }
                        else
                        {
                            return array('succes' => false, 'msg' => "Erreur réseau ! ");
                        }
                    }
                    else
                    {
                        return array('succes' => false, 'msg' => "Erreur réseau ! ");
                    }
                }
                else
                {
                    return array('succes' => false, 'msg' => "Erreur réseau ! ");
                }
            }
            else
            {
                if ($this->DeleteSchedulerExecutionScript($data))

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                {
                    if ($this->DeleteOfMangleOnRouterForChat($data))
                    {
                        if ($this->DeleteScriptDecompteDataUser($data)) 2
                        {
                            
                        }
                    }
                }
                return array('succes' => true, 'msg' => "Votre connexion est déjà désactivée ! ");
            }
        }
        else
        {
            return array('succes' => false, 'msg' => "Erreur réseau ! ");
        }
    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


2

8- Lecture d’un Média vod

Application serveur WIICOMNETWORKADMIN

ControlMobile.php Service_mobile.php

RouterOnlineUser() RouterOnlineUser()

Fonction RouterOnlineUser()

    public function RouterOnlineUser($data)
    {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


        if (!isset($data['adrmac']))
        {
            return array('success' => false, 'msg' => 'Vérifier votre connectivité au réseau.');
        } 2
        if (!isset($data['impi']))
        {
            return array('success' => false, 'msg' => 'Aucune ISIM présente dans ce terminal.');
        }
        if (!isset($data['ip']))
        {
            return array('success' => false, 'msg' => 'Vérifier votre connectivité au réseau.');
        }
        if (!isset($data['etat']))
        {
            return array('success' => false, 'msg' => 'Média incorrect.');
        }
        require_once 'Service/routeros_api.class.php';

        $routerServer = new \RouterosAPI();
        $routerAccess = new \RouterosAPI();

        if (!$routerAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS))
        {
            return array('success' => false, 'msg' => 'Connexion impossible.');
        }
        if (!$routerServer->connect(IPROUTERSERVER, USERROUTERSERVER, PASSROUTERSERVER))
        {
            return array('success' => false, 'msg' => 'Connexion impossible.');
        }
        $premium = false;
        switch ($data['etat'])
        {
            case "1":

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


            case "5":
                $premium = true;
                $donnees = array('impi' => $data['impi']);
                $res = $this->verifyIfUserCanRead($donnees); 2
                if (!$res['succes'])
                {
                    $routerServer->disconnect();
                    $routerAccess->disconnect();
                    return array('success' => false, 'msg' => 'Veuillez souscrire à un forfait VOD pour lire ce 
type de média.');
                }
                break;
            case "3":
                $premium = false;
                break;
        }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


2

9- Envoie d’un message (Vérification)

Application serveur WIICOMNETWORKADMIN

ControlMobile.php Service_mobile.php

RouterOnlineUserForChat() RouterOnlineUserForChat()

Fonction RouterOnlineUserForChat()

    public function RouterOnlineUserForChat($data)
    {
        if (!isset($data['adrmac']))
        {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


            return array('success' => false, 'msg' => 'Vérifier votre connectivité au réseau.');
        }
        if (!isset($data['impi']))
        { 2
            return array('success' => false, 'msg' => 'Aucune ISIM présente dans ce terminal.');
        }
        if (!isset($data['ip']))
        {
            return array('success' => false, 'msg' => 'Vérifier votre connectivité au réseau.');
        }
        require_once 'Service/routeros_api.class.php';

        $routerServer = new \RouterosAPI();
        $routerAccess = new \RouterosAPI();

        if (!$routerAccess->connect(IPROUTERACCESS, USERROUTERACCESS, PASSROUTERACCESS))
        {
            return array('success' => false, 'msg' => 'Connexion impossible.');
        }
        if (!$routerServer->connect(IPROUTERSERVER, USERROUTERSERVER, PASSROUTERSERVER))
        {
            return array('success' => false, 'msg' => 'Connexion impossible.');
        }
        $premium = true;

        $donnees = array('impi' => $data['impi']);
        $res = $this->verifyIfUserCanReadForChat($donnees);
        if (!$res['succes'])
        {
            if($this->AddUserInBlockTable($routerAccess, $data['ip'], $data['adrmac'])){
                $routerServer->disconnect();
                $routerAccess->disconnect();

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                return array('success' => false, 'msg' => 'Veuillez souscrire à un forfait MMS pour envoyer des 
messages.');
            }else{
                $routerServer->disconnect(); 2
                $routerAccess->disconnect();
                return array('success' => false, 'msg' => 'Veuillez souscrire à un forfait MMS pour envoyer des 
messages.');
            }
        }
        $this->MoveUSerInBlockTable($routerAccess, $data['ip'], $data['adrmac']);

        //vérification si l'utilisateur a déjà une session dans la bd
        $verif = $this->dao->CheckIfUserAllReadyHaveSessionDataForChat($data['impi']);
        $ok = $this->validator->isDbUpdate($verif, 'page');

        if ($ok)
        {
            $result = $this->dao->DropSessionDataCurrentUserForChat($data['adrmac']);
            $succes = $this->validator->isDbUpdate($result, 'page');
        }

        $result = $this->dao->CreateSessionConsoDataForChat($data['impi'], $data['adrmac'], $data['ip']);
        $succes = $this->validator->isDbUpdate($result, 'page');

        if (!$succes)
        {
            $routerServer->disconnect();
            $routerAccess->disconnect();
            return array('success' => false, 'msg' => 'Impossible de créer votre session.');
        }

        $presentServer = false;
        $presentAccess = false;

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


        /* if($premium && $this->CheckIfUserExistOnServerRouter($routerServer, $data['ip'])){
          $presentServer = true;
          }else if(!$premium && $this->CheckIfUserExistOnServerRouterNoPremium($routerServer, $data['ip'])){
          $presentServer = true; 2
          } */

        if ($premium && $this->CheckIfUserExistOnServerRouterForChat($routerServer, $data['adrmac']))
        {
            $presentServer = true;
        }

        /* if($this->CheckIfUserExistOnAccesRouter($routerAccess, $data['ip'])){
          $presentAccess = true;
          } */

        if ($presentServer)
        {
            $routerServer->disconnect();
            $routerAccess->disconnect();
            return array('success' => true, 'msg' => '');
        }
        else
        {
            $this->DeleteOfMangleOnRouterForChat($routerServer, $data);
            $this->DeleteScriptDecompteDataUser($routerServer, $data);
            $this->DeleteSchedulerExecutionScript($routerServer, $data);

            if ($this->AddMangleDecompteDataForChat($routerServer, $data))
            {
                if ($premium)
                {
                    if ($this->ExecutionAddingDecompteScriptForChat($routerServer, $data))
                    {

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                        if ($this->ShedulerExecutionDataForChat($routerServer, $data))
                        {
                            //if ($this->RedirectionUser($routerAccess, $routerServer, $data['ip'], $data['adrma
c'])) { 2
                            if ($this->RunScript($routerServer, $data['adrmac']))
                            {
                                $routerServer->disconnect();
                                $routerAccess->disconnect();
                                return array('success' => true, 'msg' => "");
                            }
                            /* } else {
                              if ($this->DeleteScriptDecompteDataUser($data) && $this-
>DeleteOfMangleOnRouter($data) && $this->DeleteSchedulerExecutionScript($data)) {
                              return array('succes' => false, 'msg' => "Erreur réseau ! veuillez réessayer ultér
ieurement ! last time ");
                              }
                              } */
                        }
                        else
                        {
                            if ($this->DeleteScriptDecompteDataUser($routerServer, $data) && $this-
>DeleteOfMangleOnRouterForChat($routerServer, $data))
                            {
                                $routerServer->disconnect();
                                $routerAccess->disconnect();
                                return array('success' => false, 'msg' => "Erreur réseau ! veuillez réessayer u
ltérieurement !");
                            }
                        }
                    }
                    else
                    {
                        if ($this->DeleteOfMangleOnRouterForChat($routerServer, $data))

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com


                        {
                            $routerServer->disconnect();
                            $routerAccess->disconnect();
                            return array('success' => false, 'msg' => "Erreur réseau ! veuillez réessayer ultéri
2
eurement !");
                        }
                    }
                }
                else
                {
                    $routerServer->disconnect();
                    $routerAccess->disconnect();
                    return array('success' => true, 'msg' => "");
                }
            }
            else
            {
                $routerServer->disconnect();
                $routerAccess->disconnect();
                return array('success' => false, 'msg' => "Erreur réseau ! veuillez réessayer ultérieurement ! "
);
            }
        }
    }

WIFI COMMUNICATIONS NETWORK, WIICOM S.A.R.L, N.C: M011712584572L


2

Site web : www.wiicomnetwork.com ; E-mail : contact@wiicomnetwork.com