diff --git a/plugins/AsdCurl/src/AsdCurl.php b/plugins/AsdCurl/src/AsdCurl.php
index af437d6..68f2058 100644
--- a/plugins/AsdCurl/src/AsdCurl.php
+++ b/plugins/AsdCurl/src/AsdCurl.php
@@ -179,7 +179,7 @@ class AsdCurl
//echo $this->html; die;
$login_data = [
'portal_username' => 'asd.trinkl',
- 'portal_password' => 'HiegTzs!184',
+ 'portal_password' => 'HiegTzs!192',
];
$post = [
diff --git a/plugins/AsdCurl/src/AsdUs.php b/plugins/AsdCurl/src/AsdUs.php
index 6cdd933..a7bf9f7 100644
--- a/plugins/AsdCurl/src/AsdUs.php
+++ b/plugins/AsdCurl/src/AsdUs.php
@@ -173,8 +173,8 @@ class AsdUs extends AsdCurl
//die;
}
- public function save_up_data($ch) {
- $SCHULPORTAL_ASD_BASE_URL = Configure::read('AsdCurl.asdbaseurl');
+ public function save_up_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');
$conversationId = $this->get_string_between($this->html, 'name="conversationId" value="', '" />');
@@ -224,7 +224,7 @@ class AsdUs extends AsdCurl
if(!($this->status)) {
die($this->error);
}
- echo $this->html;die;
+ //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="', '" />');
diff --git a/src/Controller/CurlsController.php b/src/Controller/CurlsController.php
index 2c61c6c..d93d833 100644
--- a/src/Controller/CurlsController.php
+++ b/src/Controller/CurlsController.php
@@ -99,14 +99,20 @@ class CurlsController extends AppController
}
public function saveup() {
+ if(isset($this->request->params['pass'][0])) {
+ $env = $this->request->params['pass'][0];
+ }
+ else {
+ $env = 'prod';
+ }
$curl = new AsdUs();
//debug($curl->status);
$ch = $curl->init_curl_params();
$curl->login_school($ch);
- $curl->login_asd($ch);
- $curl->save_up_data($ch);
+ $curl->login_asd($ch,$env);
+ $curl->save_up_data($ch,$env);
$this->set('html',$curl->html);
- $this->redirect(['action' => 'getjsonup']);
+ $this->redirect(['action' => 'getjsonup/'.$env]);
}
diff --git a/src/Controller/EmploymentsController.php b/src/Controller/EmploymentsController.php
new file mode 100644
index 0000000..50aa201
--- /dev/null
+++ b/src/Controller/EmploymentsController.php
@@ -0,0 +1,65 @@
+Employments->newEntity();
+ if ($this->request->is('post')) {
+ //debug($this->request->data);
+ $xmldata = $this->request->data['xmldata'];
+ $filename = $xmldata['tmp_name'];
+ //echo $filename;
+ $dataxml = file_get_contents($filename);
+ $dataxml = '