07.03.2024 -> Hinweise eingebaut; Cookie wird nicht mehr auf der Platte gespeichert;

This commit is contained in:
2024-03-07 15:44:28 +01:00
parent 30c09c19b8
commit 2994444f1a
2 changed files with 11 additions and 12 deletions

View File

@@ -1,8 +1,6 @@
<?php
$cURL = curl_init();
$_csrf = '';
$userMail = 'xxx@yyyy';
$userPassword = 'password';
//Curl Optionen setzen
function diveraWebCURL($_url,$_post=''){
@@ -18,8 +16,7 @@
}else{
curl_setopt($cURL, CURLOPT_POST, false);
}
curl_setopt($cURL, CURLOPT_COOKIEJAR, __DIR__.'/data/diveraWebConnectCookie.txt' );
curl_setopt($cURL, CURLOPT_COOKIEFILE, __DIR__.'/data/diveraWebConnectCookie.txt' );
curl_setopt($cURL, CURLOPT_COOKIEFILE, NULL);
curl_setopt($cURL, CURLINFO_HEADER_OUT, true);
}
@@ -28,9 +25,6 @@
function diveraWebLogin(){
global $cURL,$_csrf,$userMail,$userPassword;
//Cookie Löschen falls logout nicht geklappt hat, oder vergessen wurde
unlink(__DIR__.'/data/diveraWebConnectCookie.txt');
//_csrf der Session ermitteln
$url = 'https://app.divera247.com/login.html';
diveraWebCURL($url);
@@ -64,7 +58,7 @@
return true;
}else{
$now = new DateTime();
file_put_contents(__DIR__.'/data/diveraWebConnectError.log',$now->format('Ymd\THis').' || Curl error: ' . curl_error($cURL).print_r($cURL,true),FILE_APPEND);
file_put_contents(__DIR__.'/diveraWebConnectError.log',$now->format('Ymd\THis').' || Curl error: ' . curl_error($cURL).print_r($cURL,true),FILE_APPEND);
return false;
}
}

View File

@@ -1,21 +1,26 @@
!!! DAS SCRIPT IST NUR IN EINER GESICHERTEN UMGEBUNG ZU NUTZEN !!!
Das Speichern von Zugangsdaten auf öffentlichen Servern stellt ein hohes Risiko da!
Nenninger N-Tools.de
* 05.03.2024 -> Erste Version Benutzer CSV Export
* 07.03.2024 -> Hinweise eingebaut; Cookie wird nicht mehr auf der Platte gespeichert;
curl und php >= 7.4
Mit diesem Script, kann man die Beutzer von Divera als CSV exportieren.
im Path des Scripts "diveraWebConnect.php" muss eine Order "data" angelegt sein (Cookieablage + evtl. Log)
der Verwendete Zugang muss Berechtigung auf die Verwaltung haben
Beispiel:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
include_once(__DIR__.'/php/diveraWebConnect.php');
$userMail = 'xxx@yyyy';
$userPassword = 'password';
echo diveraWebExportCSV();
?>