From b721e05e17ad93ed5268049ac2c9f5f2def7dae1 Mon Sep 17 00:00:00 2001 From: TheMaxium69 <63310746+TheMaxium69@users.noreply.github.com> Date: Sat, 9 Apr 2022 06:12:28 +0200 Subject: [PATCH] whmcs connect --- actu.php | 8 ++++++++ api/api.php | 21 +++++++++++++++++++++ api/connect.php | 41 +++++++++++++++++++++++++++++++++++++++++ app/env.php | 9 +++++---- composant/footer.phtml | 9 +++------ composant/navbar.phtml | 10 +++++++++- fivem.php | 2 +- index.php | 20 ++++++++++---------- minecraft.php | 2 +- siteweb.php | 2 +- stockage.php | 2 +- support.php | 8 ++++++++ vps.php | 4 +++- 13 files changed, 112 insertions(+), 26 deletions(-) create mode 100644 actu.php create mode 100644 api/api.php create mode 100644 api/connect.php create mode 100644 support.php diff --git a/actu.php b/actu.php new file mode 100644 index 0000000..ef66a47 --- /dev/null +++ b/actu.php @@ -0,0 +1,8 @@ + +
+ +
+ +
+ + \ No newline at end of file diff --git a/api/api.php b/api/api.php new file mode 100644 index 0000000..793a0f2 --- /dev/null +++ b/api/api.php @@ -0,0 +1,21 @@ + + * @copyright Copyright (c) WHMCS Limited 2005-2016 + * @license http://www.whmcs.com/license/ WHMCS Eula + * @version $Id$ + * @link http://www.whmcs.com/ + */ + + +require_once '../../whmcs/whmcs-8.2.1/whmcs-8.2.1/init.php'; +var_dump($_SESSION); + +if ($_SESSION['login_auth_tk']){ + $isLog = true; +} else { + $isLog = false; +} \ No newline at end of file diff --git a/api/connect.php b/api/connect.php new file mode 100644 index 0000000..8cebde2 --- /dev/null +++ b/api/connect.php @@ -0,0 +1,41 @@ + + * @copyright Copyright (c) WHMCS Limited 2005-2016 + * @license http://www.whmcs.com/license/ WHMCS Eula + * @version $Id$ + * @link http://www.whmcs.com/ + */ + +var_dump($_POST); +$username = $_POST['username']; +$password = $_POST['password']; + + + +require_once '../../whmcs/whmcs-8.2.1/whmcs-8.2.1/init.php'; + +$command = 'ValidateLogin'; +$postData = array( + 'email' => $username, + 'password2' => $password, +); + +$results = localAPI($command, $postData); +var_dump($results); +print_r($results); + +if ($results['result'] == "success"){ + + $_SESSION['user-id'] = $results['userid']; + $_SESSION['user-email'] = $username; + $_SESSION['user-passhash'] = $results['passwordhash']; + + + + + +} \ No newline at end of file diff --git a/app/env.php b/app/env.php index 2dbcd23..8cb44c9 100644 --- a/app/env.php +++ b/app/env.php @@ -1,11 +1,12 @@ array( "title" => "Actualité | SolidServ", "name" => "Actualité", - "url" => "Actualite.php", + "url" => "actu.php", "css" => "Actualite", ), 4 => array( @@ -39,10 +40,10 @@ ), 5 => array( "name" => "Espace client", - "url" => "...", + "url" => $env_whmcs."login" , ), 6 => array( "name" => 'Panier', - "url" => '...', + "url" => $env_whmcs."cart.php?a=view", ), ); diff --git a/composant/footer.phtml b/composant/footer.phtml index c8df54f..3e0c27c 100644 --- a/composant/footer.phtml +++ b/composant/footer.phtml @@ -36,14 +36,11 @@ } } ?> - diff --git a/composant/navbar.phtml b/composant/navbar.phtml index 2618bdf..7df7768 100644 --- a/composant/navbar.phtml +++ b/composant/navbar.phtml @@ -32,7 +32,15 @@ ' . $env_page[$i]["name"] . ''; + require_once '../whmcs/whmcs-8.2.1/whmcs-8.2.1/init.php'; + + if ($_SESSION['login_auth_tk']){ + echo '
  • Tu est co
  • '; + + } else { + echo '
  • pas co
  • '; + + } } else if ($i == 6){ diff --git a/fivem.php b/fivem.php index cdb16f5..eaff3d8 100644 --- a/fivem.php +++ b/fivem.php @@ -16,4 +16,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/index.php b/index.php index af93788..4bf1ce5 100644 --- a/index.php +++ b/index.php @@ -107,7 +107,7 @@
    - +
    @@ -144,7 +144,7 @@ - + @@ -179,7 +179,7 @@ - + @@ -214,7 +214,7 @@ - + @@ -248,7 +248,7 @@ - + @@ -265,7 +265,7 @@

    à partir de :
    30€/Mois

    - +