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

@@ -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)