Neue Statistik

This commit is contained in:
2021-05-28 07:24:22 +02:00
parent c9bfd40728
commit 9bf57f696b
36 changed files with 91139 additions and 4743 deletions

View File

@@ -16,8 +16,8 @@ define('SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesigc3ba168505
//define('PROD_SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesigc3ba1685059aaf325d44099df697a0a635e79a4ec36ec614a98f3bf4b79d7c043ac3880605b7751df91d11233380ad86/uniquesig0/asd');
//define('PROD_SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesig632cea04e8c585dd8dd40ffb367af53448ad1113e945323b22126735ae9513abb1f12262cb9414f17e32ca470882289a/uniquesig0/asd');
define('PROD_SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/f5-w-687474703a2f2f6173642d6170702d70726f642e727a2d737565642e62617965726e2e64653a38323830$$/asd/');
define('PARA_SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesiga877c16a8d4fa0326c4d1f7447020d3867d9b0ca4503652219a0f5b2b569f316747c8c199bc9626ccb01613a0a36a342/uniquesig0/asd');
//define('PARA_SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesiga877c16a8d4fa0326c4d1f7447020d3867d9b0ca4503652219a0f5b2b569f316747c8c199bc9626ccb01613a0a36a342/uniquesig0/asd');
define('PARA_SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/f5-w-687474703a2f2f6173642d6170702d766d7030312e727a2d737565642e6279626e2e64653a38323830$$/asd/');
//define('SCHULPORTAL_MSTR_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesig9adaec6129c81dbeb2f42638bc9f27ac0c442a10891f0c915c9d7f0c371a00b3/uniquesig1/asd');
define('SCHULPORTAL_MSTR_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesig182e937bef9540ecffb7e0ba167caaea052491068bd93a46e70dbd73bf9f8963/uniquesig1/asd');
@@ -31,7 +31,8 @@ Configure::write('AsdCurl.cookiefile', '/tmp/cookies.txt');
Configure::write('AsdCurl.cookie', 'cookiename=cookievalue');
Configure::write('AsdCurl.useragent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0');
//Configure::write('AsdCurl.useragent', 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36');
Configure::write('AsdCurl.cert','/var/www/html/ssl_KM_Z2016_asd.trinkl.pem');
//Configure::write('AsdCurl.cert','/var/www/html/ssl_KM_Z2016_asd.trinkl.pem');
Configure::write('AsdCurl.cert','/var/www/html/ssl_Z_KM2019_asd.trinkl.pem');
Configure::write('AsdCurl.schulbase0url',SCHULPORTAL_BASE0_URL);
Configure::write('AsdCurl.schulbaseurl',SCHULPORTAL_BASE_URL);
Configure::write('AsdCurl.asdbaseurl',SCHULPORTAL_ASD_BASE_URL);

View File

@@ -97,13 +97,12 @@ class AsdCurl
if(!($this->status)) {
die($this->error);
}
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
//debug($this->html);die;
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
//debug($viewstate);
$login_data = [
'asd_username' => 'A005_TrinklW',
'asd_password' => 'HiegTzs!195',
//'asd_username' => 'A005_KnollmüllerP',
//'asd_password' => 'Ooricha8e!',
'asd_password' => 'qQ8r&Dm->>sAKv<r',
];
$post = [
'login:username' => $login_data['asd_username'],
@@ -116,7 +115,7 @@ class AsdCurl
if(!($this->status)) {
die($this->error);
}
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_jdi:javax.faces.ViewState:0" value="', '" autocomplete');
Configure::write('Session', ['viewstate' => $viewstate]);
//echo $this->html;die;
}
@@ -131,7 +130,7 @@ class AsdCurl
$post = [
'Uid' => 'A005_TrinklW',
'Pwd' => 'HiegTzs!12',
'Pwd' => 'geheim',
];
$pvar['ConnMode'] = $this->get_string_between($this->html, '<input name="ConnMode" id="ConnMode" type="hidden" class="mstrHiddenInput" value="', '"/>');
$pvar['3054'] = $this->get_string_between($this->html, '<input name="3054" id="3054" type="submit" value="', '" class="mstrButton"/>');
@@ -178,10 +177,9 @@ class AsdCurl
if(!($this->status)) {
die($this->error);
}
$vorschalt = $this->get_string_between($this->html,'an parallelen Zugriffen zu ',' beim');
$vorschalt = $this->get_string_between($this->html,'gibt es vereinzelt ',' beim');
//debug($vorschalt);
if($vorschalt == 'Anmeldeproblemen') {
if($vorschalt == 'Störungen') {
$post = [
'choice' => 1
@@ -191,7 +189,7 @@ class AsdCurl
//debug($this->html);
}
//echo $this->html; die;
//echo $this->html; die;
$login_data = [
'portal_username' => 'asd.trinkl',
'portal_password' => 'HiegTzs!193',
@@ -208,7 +206,7 @@ class AsdCurl
];
// Anmeldeformular fuer das Schulportal abschicken - Step 2
//https://portal.schulen.bayern.de/uniquesig2d1dfad4a11c25e42c462e53b4721e48/uniquesig0/SecureSchulportalPortalHomePage/
//https://portal.schulen.bayern.de/uniquesig2d1dfad4a11c25e42c462e53b4721e48/uniquesig0/SecureSchulportalPortalHomePage/
//$this->exec_curl($ch, $SCHULPORTAL_BASE_URL . '/SecureSchulportalPortalHomePage', $post);
//debug($SCHULPORTAL_BASE_URL);
//$this->exec_curl($ch, $SCHULPORTAL_BASE_URL . '/InternalSite/Validate.asp', $post);
@@ -216,9 +214,10 @@ class AsdCurl
if(!($this->status)) {
die($this->error);
}
//debug($this);die;
//debug($this->html);die;
//$this->exec_curl($ch, $SCHULPORTAL_BASE_URL . '/SecureSchulportalPortalHomePage/',false);
//debug($this->html);die;
//echo $this->html;die;
}
public function exec_mstr($ch, $url, $post)

View File

@@ -57,7 +57,7 @@ class AsdUs extends AsdCurl
public function save_us_data($ch,$env) {
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl.'.$env);
// Maske US 01 01 vom linken Menü aufrufen
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
$post = [
'sideMenu' => 'sideMenu',
@@ -70,7 +70,7 @@ class AsdUs extends AsdCurl
}
//echo $this->html;die;
// In Maske US 01 01 alle Felder leer lassen und "Suchen" ausführen
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
$post = [
'mainForm' => 'mainForm',
@@ -109,14 +109,16 @@ class AsdUs extends AsdCurl
}
//echo $this->html;
// Auf der Ergebnisseite auf "Alle" Klicken
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
$htmlParser = new \DOMDocument(); //to parse html using DOMDocument
libxml_use_internal_errors(true); // your HTML gives parser warnings, keep them internal
$htmlParser->loadHTML($this->html); //Loaded the html string we took from simple xml
//debug($this->html);
$htmlParser->preserveWhiteSpace = false;
$hrefs = $htmlParser->getElementsByTagName('a');
//debug($hrefs);die;
foreach($hrefs as $href) {
if($href->textContent == 'ALLE') {
foreach ($href->attributes as $attribute) {
@@ -197,22 +199,31 @@ class AsdUs extends AsdCurl
}
public function save_up_data($ch,$env) {
//echo $this->html;die;
$SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl.'.$env);
// Maske US 01 01 vom linken Menü aufrufen
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
//$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
//debug($viewstate);
//debug($conversationId);
$post = [
'sideMenu' => 'sideMenu',
'javax.faces.ViewState' => $viewstate,
'sideMenu:j_idt52:0:j_idt58:1:j_idt60' => 'sideMenu:j_idt52:0:j_idt58:1:j_idt60',
];
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_18_01.jsf?cid=' . $conversationId, $post);
//$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_18_01.jsf?cid=' . $conversationId, $post);
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_00_00.jsf?cid=' . $conversationId, $post);
if(!($this->status)) {
die($this->error);
}
//echo $this->html;die;
// In Maske US 01 01 alle Felder leer lassen und "Suchen" ausführen
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
//$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
//debug($viewstate);
//debug($conversationId);
$post = [
'mainForm' => 'mainForm',
'referenzBaumAnzeigen' => 'false',
@@ -243,17 +254,21 @@ class AsdUs extends AsdCurl
'mainForm:action_suchen' => 'Suchen',
'javax.faces.ViewState' => $viewstate,
];
//debug($post);
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_03_01.jsf?cid=' . $conversationId, $post);
if(!($this->status)) {
die($this->error);
}
//debug($this->html);die;
$htmlParser = new \DOMDocument(); //to parse html using DOMDocument
libxml_use_internal_errors(true); // your HTML gives parser warnings, keep them internal
$htmlParser->loadHTML($this->html); //Loaded the html string we took from simple xml
$htmlParser->preserveWhiteSpace = false;
$hrefs = $htmlParser->getElementsByTagName('a');
//debug($hrefs);
foreach($hrefs as $href) {
debug($href->textContent);
if($href->textContent == 'ALLE') {
foreach ($href->attributes as $attribute) {
if($attribute->name == 'onclick') {
@@ -263,10 +278,12 @@ class AsdUs extends AsdCurl
}
}
}
}
//echo $this->html;die;
}
//debug($linkid);
//debug($this->html);die;
// Auf der Ergebnisseite auf "Alle" Klicken
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
//$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$viewstate = $this->get_string_between($this->html, 'id="j_id1:javax.faces.ViewState:0" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
//$mainform = $this->get_string_between($this->html, '\\\':\\\'', '\\\'},\\\'\\\')\');return false\" class=\"ignoreChangeNotification notBold\">ALLE</a>');
//debug($mainform);die;
@@ -285,12 +302,14 @@ class AsdUs extends AsdCurl
'mainForm:istAnzeigeMaske' => 'false',
'javax.faces.ViewState' => $viewstate,
'mainForm:j_idt'.$linkid => 'mainForm:j_idt'.$linkid
//'mainForm:j_idt189' => 'mainForm:j_idt189'
];
//debug($post);
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_03_02.jsf?cid=' . $conversationId, $post);
if(!($this->status)) {
die($this->error);
}
//echo $this->html;die;
//debug($this->html);die;
// Ergebnisse parsen und in die MySQL - Datenbank schreiben
$htmlParser = new \DOMDocument(); //to parse html using DOMDocument
libxml_use_internal_errors(true); // your HTML gives parser warnings, keep them internal