This commit is contained in:
2018-11-02 07:37:22 +01:00
parent 6ff6cc9563
commit 09ee6ddc3e
37 changed files with 5659 additions and 553545 deletions

View File

@@ -17,11 +17,14 @@ define('SCHULPORTAL_ASD_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesigc3ba168505
define('SCHULPORTAL_MSTR_BASE_URL', SCHULPORTAL_BASE0_URL . '/uniquesig182e937bef9540ecffb7e0ba167caaea052491068bd93a46e70dbd73bf9f8963/uniquesig1/asd');
Configure::write('AsdCurl.proxy','10.1.248.1:82');
//Configure::write('AsdCurl.proxy','10.1.248.1:82');
//Configure::write('AsdCurl.proxy','www.proxy.bybn.de:80');
Configure::write('AsdCurl.proxy','127.0.0.1:8080');
Configure::write('AsdCurl.cookiejar', '/tmp/cookies.txt');
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.schulbase0url',SCHULPORTAL_BASE0_URL);
Configure::write('AsdCurl.schulbaseurl',SCHULPORTAL_BASE_URL);

View File

@@ -22,11 +22,14 @@ class AsdCurl
public function init_curl_params()
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, Configure::read('AsdCurl.proxy'));
$ch = curl_init('https://portal.schulen.bayern.de/');
//curl_setopt($ch, CURLOPT_PROXY, Configure::read('AsdCurl.proxy'));
//curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($ch, CURLOPT_PROXY, "");
curl_setopt($ch, CURLOPT_USERAGENT, Configure::read('AsdCurl.useragent'));
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, Configure::read('AsdCurl.cookiejar'));
@@ -58,6 +61,7 @@ class AsdCurl
public function exec_curl($ch, $url, $post)
{
//debug($url);die;
if ($post == false) {
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array());
@@ -68,6 +72,8 @@ class AsdCurl
}
curl_setopt($ch, CURLOPT_URL, $url);
$this->html = curl_exec($ch);
//echo 'Hallo';
//echo $this->html;die;
//debug(curl_errno($ch));
//debug(curl_getinfo($ch, CURLINFO_HTTP_CODE));
if (curl_errno($ch)) {
@@ -93,7 +99,9 @@ class AsdCurl
$login_data = [
'asd_username' => 'A005_TrinklW',
'asd_password' => 'HiegTzs!12',
'asd_password' => 'HiegTzs!183',
//'asd_username' => 'A005_KnollmüllerP',
//'asd_password' => 'Ooricha8e!',
];
$post = [
'login:username' => $login_data['asd_username'],
@@ -108,6 +116,7 @@ class AsdCurl
}
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
Configure::write('Session', ['viewstate' => $viewstate]);
//echo $this->html;die;
}
public function login_mstr($ch) {
@@ -154,17 +163,23 @@ class AsdCurl
public function login_school($ch)
{
//echo 'Hallo';die;
$SCHULPORTAL_BASE0_URL = Configure::read('AsdCurl.schulbase0url');
//$SCHULPORTAL_BASE0_URL = "https://portal.schulen.bayern.de/SecureSchulportalPortalHomePage";
$SCHULPORTAL_BASE_URL = Configure::read('AsdCurl.schulbaseurl');
//$SCHULPORTAL_BASE_URL = Configure::read('AsdCurl.schulbaseurl') . '/SecureSchulportalPortalHomePage';
//$login_data = $this->request->session()->read('data');
//echo $SCHULPORTAL_BASE_URL;
$this->exec_curl($ch, $SCHULPORTAL_BASE_URL, false);
if(!($this->status)) {
die($this->error);
}
//echo $this->html; die;
$login_data = [
'portal_username' => 'asd.trinkl',
'portal_password' => 'HiegTzs!182',
'portal_password' => 'HiegTzs!184',
];
$post = [
@@ -178,10 +193,13 @@ class AsdCurl
];
// Anmeldeformular fuer das Schulportal abschicken - Step 2
//https://portal.schulen.bayern.de/uniquesig2d1dfad4a11c25e42c462e53b4721e48/uniquesig0/SecureSchulportalPortalHomePage/
//$this->exec_curl($ch, $SCHULPORTAL_BASE_URL . '/SecureSchulportalPortalHomePage', $post);
$this->exec_curl($ch, $SCHULPORTAL_BASE_URL . '/InternalSite/Validate.asp', $post);
if(!($this->status)) {
die($this->error);
}
//debug($this->html);die;
}
public function exec_mstr($ch, $url, $post)

View File

@@ -24,12 +24,13 @@ class AsdUs extends AsdCurl
$post = [
'sideMenu' => 'sideMenu',
'javax.faces.ViewState' => $viewstate,
'sideMenu:j_idt51:0:j_idt57:1:j_idt59' => 'sideMenu:j_idt51:0:j_idt57:1:j_idt59',
'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 . '/asdus/us_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');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
@@ -52,6 +53,7 @@ class AsdUs extends AsdCurl
'mainForm:dienststelle_plzstrasse' => '',
'mainForm:dienststelle_ort' => '',
'mainForm:dienststelle_sat_kurz_bezeichnung' => 'EMPTY:0',
//'mainForm:dienststelle_sat_kurz_bezeichnung' => 'com.hp.asd.wl.domain.standard.SchulartRechtlich:747',
'mainForm:dienststelle_bdg_kurz_bezeichnung' => 'EMPTY:0',
'mainForm:dienststelle_wl_kurz_bezeichnung' => 'EMPTY:0',
'mainForm:dienststelle_dst_wl_regierung_id_u' => 'EMPTY:0',
@@ -67,10 +69,12 @@ class AsdUs extends AsdCurl
if(!($this->status)) {
die($this->error);
}
//echo $this->html;
// Auf der Ergebnisseite auf "Alle" Klicken
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" 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>');
$mainform = $this->get_string_between($this->html, '\\\':\\\'', '\\\'},\\\'\\\')\')\;return false\" class=\"ignoreChangeNotification notBold\">ALLE</a>');
//debug($mainform);die;
$post = [
'mainForm' => 'mainForm',
@@ -86,7 +90,7 @@ class AsdUs extends AsdCurl
'skipvalidation' => 'true',
'mainForm:istAnzeigeMaske' => 'false',
'javax.faces.ViewState' => $viewstate,
'mainForm:j_idt189' => 'mainForm:j_idt189',
'mainForm:j_idt184' => 'mainForm:j_idt184',
];
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdus/us_01_02.jsf?cid=' . $conversationId, $post);
if(!($this->status)) {
@@ -188,6 +192,7 @@ class AsdUs extends AsdCurl
if(!($this->status)) {
die($this->error);
}
echo $this->html;die;
// Auf der Ergebnisseite auf "Alle" Klicken
$viewstate = $this->get_string_between($this->html, 'id="javax.faces.ViewState" value="', '" autocomplete');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
@@ -207,7 +212,7 @@ class AsdUs extends AsdCurl
'skipvalidation' => 'true',
'mainForm:istAnzeigeMaske' => 'false',
'javax.faces.ViewState' => $viewstate,
'mainForm:j_idt189' => 'mainForm:j_idt189',
'mainForm:j_idt184' => 'mainForm:j_idt184'
];
$this->exec_curl($ch, $SCHULPORTAL_ASD_BASE_URL . '/asdup/up_03_02.jsf?cid=' . $conversationId, $post);
if(!($this->status)) {