GDD
-Explorer
-User information
- -- - -
Contact information
- -- -
About me
--
- {{ this.$store.state.email }} - -
--
-
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 92ac77d86..104b85502 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -44,19 +44,19 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
with:
- submodules: recursive
+ submodules: true
##########################################################################
# BUILD LOGIN SERVER DOCKER IMAGE ########################################
##########################################################################
- - name: login server | Build `test` image
+ - name: login server | Build `release` image
run: |
- docker build --target login_server -t "gradido/login_server:test" -f ./login_server/Dockerfile login_server/
- docker save "gradido/login_server:test" > /tmp/login_server.tar
- - name: Upload Artifact
- uses: actions/upload-artifact@v2
- with:
- name: docker-login-server-test
- path: /tmp/login_server.tar
+ docker build --target release -t "gradido/login_server:release" -f ./login_server/Dockerfile login_server/
+ #docker save "gradido/login_server:test" > /tmp/login_server.tar
+ #- name: Upload Artifact
+ # uses: actions/upload-artifact@v2
+ #with:
+ # name: docker-login-server-test
+ #path: /tmp/login_server.tar
##############################################################################
# JOB: DOCKER BUILD TEST COMMUNITY SERVER ####################################
@@ -102,7 +102,7 @@ jobs:
##########################################################################
- name: mariadb | Build `test` image
run: |
- docker build -t "gradido/mariadb:test" -f ./mariadb/Dockerfile ./
+ docker build --target mariadb_server_test -t "gradido/mariadb:test" -f ./mariadb/Dockerfile ./
docker save "gradido/mariadb:test" > /tmp/mariadb.tar
- name: Upload Artifact
uses: actions/upload-artifact@v2
@@ -212,9 +212,138 @@ jobs:
report_name: Coverage Frontend
type: lcov
result_path: ./coverage/lcov.info
- min_coverage: 20
+ min_coverage: 21
token: ${{ github.token }}
+ ##############################################################################
+ # JOB: UNIT TEST LOGIN-SERVER ###############################################
+ ##############################################################################
+ unit_test_login_server:
+ name: Unit tests - Login-Server
+ runs-on: ubuntu-latest
+ needs: []
+ services:
+ mariadb:
+ image: gradido/mariadb:test
+ env:
+ MARIADB_ALLOW_EMPTY_PASSWORD: 1
+ MARIADB_USER: root
+ ports:
+ - 3306:3306
+ options: --health-cmd="mysqladmin ping"
+ --health-interval=6s
+ --health-timeout=3s
+ --health-retries=4
+ steps:
+ - name: Debug service
+ run: echo "$(docker ps)"
+ - name: Debug container choosing script
+ run: echo "$(docker container ls | grep mariadb | awk '{ print $1 }')"
+ ##########################################################################
+ # CHECKOUT CODE ##########################################################
+ ##########################################################################
+ - name: Checkout code
+ uses: actions/checkout@v2
+ with:
+ submodules: true
+ ##########################################################################
+ # Build Login-Server Test Docker image ###################################
+ ##########################################################################
+ - name: login server | Build `test` image
+ run: |
+ docker build --target test -t "gradido/login_server:test" -f ./login_server/Dockerfile login_server/
+ ##########################################################################
+ # UNIT TESTS BACKEND LOGIN-SERVER #######################################
+ ##########################################################################
+ - name: Login-Server | Unit tests
+ run: |
+ docker run --network container:$(docker container ls | grep mariadb | awk '{ print $1 }') -v ~/coverage:/code/build_cov/coverage -v $(pwd)/configs/login_server:/etc/grd_login gradido/login_server:test
+ cp -r ~/coverage ./coverage
+ ##########################################################################
+ # COVERAGE CHECK BACKEND LOGIN-SERVER ####################################
+ ##########################################################################
+ - name: backend login | Coverage check
+ uses: webcraftmedia/coverage-check-action@master
+ with:
+ report_name: Coverage Backend
+ type: lcov
+ result_path: ./coverage/coverage.info
+ min_coverage: 6
+ token: ${{ github.token }}
+
+ ##############################################################################
+ # JOB: UNIT TEST COMMUNITY-SERVER ###########################################
+ ##############################################################################
+ unit_test_community_server:
+ name: Unit tests - Community Server
+ runs-on: ubuntu-latest
+ needs: [build_test_community_server]
+ services:
+ mariadb:
+ image: gradido/mariadb:test
+ env:
+ MARIADB_ALLOW_EMPTY_PASSWORD: 1
+ MARIADB_USER: root
+ # ports:
+ # - 3306:3306
+ options: --health-cmd="mysqladmin ping"
+ --health-interval=5s
+ --health-timeout=5s
+ --health-retries=3
+ steps:
+ - name: get mariadb container id
+ run: echo "::set-output name=id::$(docker container ls | grep mariadb | awk '{ print $1 }')"
+ id: mariadb_container
+ - name: show networks
+ run: echo "$(docker network ls)"
+ - name: get automatic created network
+ run: echo "::set-output name=id::$(docker network ls | grep github_network | awk '{ print $1 }')"
+ id: network
+ - name: Start Login-Server
+ run: docker run --network ${{ steps.network.outputs.id }} --name=login-server -d gradido/login_server:default
+ - name: get login-server container id
+ run: echo "::set-output name=id::$(docker container ls | grep login_server | awk '{ print $1 }')"
+ id: login_server_container
+ ##########################################################################
+ # CHECKOUT CODE ##########################################################
+ ##########################################################################
+ - name: Checkout code
+ uses: actions/checkout@v2
+ ##########################################################################
+ # DOWNLOAD DOCKER IMAGE ##################################################
+ ##########################################################################
+ - name: Download Docker Image (Community-Server)
+ uses: actions/download-artifact@v2
+ with:
+ name: docker-community-server-test
+ path: /tmp
+ - name: Load Docker Image
+ run: docker load < /tmp/community_server.tar
+
+ # for debugging login-server
+ - name: check login-server
+ run: docker logs ${{ steps.login_server_container.outputs.id }}
+ - name: check mariadb
+ run: docker logs ${{ steps.mariadb_container.outputs.id }}
+ ##########################################################################
+ # UNIT TESTS BACKEND COMMUNITY-SERVER #######################################
+ ##########################################################################
+ - name: community server | Unit tests
+ run: |
+ docker run --network ${{ steps.network.outputs.id }} -v ~/coverage:/var/www/cakephp/webroot/coverage gradido/community_server:test
+ cp -r ~/coverage ./coverage
+ #########################################################################
+ # COVERAGE CHECK BACKEND COMMUNITY-SERVER ####################################
+ ##########################################################################
+ #- name: backend community simplecov | Coverage check
+ # uses: webcraftmedia/coverage-check-action@master
+ # with:
+ # report_name: Coverage Backend
+ # type: simplecov
+ # result_path: ./coverage/coverage.info
+ # min_coverage: 8
+ # token: ${{ github.token }}
+
#test:
# runs-on: ubuntu-latest
# steps:
@@ -228,4 +357,4 @@ jobs:
# GN_INSTANCE_FOLDER: /tmp/gradio-node-instance
# GN_CONTAINER_NAME: gradido-node-build
# run: docker run gradido-node-test
- # timeout-minutes: 2
\ No newline at end of file
+ # timeout-minutes: 2
diff --git a/community_server/Dockerfile b/community_server/Dockerfile
index 8129d581d..eabb37741 100644
--- a/community_server/Dockerfile
+++ b/community_server/Dockerfile
@@ -1,8 +1,8 @@
-FROM phpdockerio/php74-fpm
+FROM phpdockerio/php74-fpm as community_server
# install php fpm
RUN apt-get update \
- && apt-get -y --no-install-recommends install curl unzip php7.4-curl php7.4-fpm php7.4-mbstring php7.4-intl php7.4-xml php7.4-pdo php7.4-mysql \
+ && apt-get -y --no-install-recommends install curl unzip php7.4-curl php7.4-fpm php7.4-mbstring php7.4-intl php7.4-xml php7.4-pdo php7.4-mysql php7.4-xdebug \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
WORKDIR /var/www/cakephp
@@ -13,5 +13,17 @@ COPY ./configs/community_server/app.php ./config/
RUN composer update
RUN composer dump-autoload
+######### special for code coverage and testing
+FROM community_server as test
+
+
+RUN apt-get update \
+ && apt-get -y --no-install-recommends install php7.4-xdebug \
+ && apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
+
+WORKDIR /var/www/cakephp
+ENV XDEBUG_MODE=coverage
+
+CMD ./vendor/bin/phpunit --coverage-text=./webroot/coverage/coverage.info
diff --git a/community_server/config/routes.php b/community_server/config/routes.php
index 3b0dfedc1..20fc1ff62 100644
--- a/community_server/config/routes.php
+++ b/community_server/config/routes.php
@@ -60,19 +60,21 @@ Router::scope('/', function (RouteBuilder $routes) {
$whitelist = ['JsonRequestHandler', 'ElopageWebhook', 'AppRequests'];
$ajaxWhitelist = ['TransactionSendCoins', 'TransactionCreations'];
+ $callerIp = $request->clientIp();
+
foreach($whitelist as $entry) {
if($request->getParam('controller') === $entry) {
if($entry == 'ElopageWebhook' || $entry == 'AppRequests') {
return true;
}
$allowedIpLocalhost = ['127.0.0.1', 'localhost', '', '::1'];
- if(in_array($clientIp, $allowedIpLocalhost)) {
+ if(in_array($callerIp, $allowedIpLocalhost)) {
return true;
}
$allowedCaller = Configure::read('API.allowedCaller');
$ipPerHost = [];
if($allowedCaller && count($allowedCaller) > 0) {
- $callerIp = $request->clientIp();
+
foreach($allowedCaller as $allowed) {
$ip = gethostbyname($allowed);
$ipPerHost[$allowed] = $ip;
diff --git a/community_server/src/Controller/AppController.php b/community_server/src/Controller/AppController.php
index a1416678f..eb11299ce 100644
--- a/community_server/src/Controller/AppController.php
+++ b/community_server/src/Controller/AppController.php
@@ -88,19 +88,8 @@ class AppController extends Controller
// load current balance
$session = $this->getRequest()->getSession();
$state_user_id = $session->read('StateUser.id');
- if ($state_user_id) {
- $stateBalancesTable = TableRegistry::getTableLocator()->get('stateBalances');
- $stateBalanceQuery = $stateBalancesTable
- ->find('all')
- ->contain(false)
- ->where(['state_user_id' => $state_user_id]);
- if ($stateBalanceQuery->count() == 1) {
- //var_dump($stateBalanceEntry->first());
- $session->write('StateUser.balance', $stateBalanceQuery->first()->decay);
- //echo "stateUser.balance: " . $session->read('StateUser.balance');
- }
- }
-
+
+
// load error count
if ($state_user_id) {
$stateErrorsTable = TableRegistry::getTableLocator()->get('stateErrors');
@@ -111,8 +100,6 @@ class AppController extends Controller
->where(['state_user_id' => $state_user_id]);
$session->write('StateUser.errorCount', $stateErrorQuery->count());
}
- //echo "initialize";
-
// put current page into global for navi
$GLOBALS["passed"] = null;
diff --git a/community_server/src/Controller/AppRequestsController.php b/community_server/src/Controller/AppRequestsController.php
index 4d70a68b1..6b744ff69 100644
--- a/community_server/src/Controller/AppRequestsController.php
+++ b/community_server/src/Controller/AppRequestsController.php
@@ -276,7 +276,8 @@ class AppRequestsController extends AppController
$this->viewBuilder()->setLayout('ajax');
$login_result = $this->requestLogin($session_id, false);
if($login_result !== true) {
- return $this->returnJson($login_result);
+ $this->set('body', $login_result);
+ return;
}
$session = $this->getRequest()->getSession();
$user = $session->read('StateUser');
@@ -285,16 +286,24 @@ class AppRequestsController extends AppController
$state_balance = $state_balances_table->find()->where(['state_user_id' => $user['id']])->first();
- if(!$state_balance) {
- return $this->returnJson(['state' => 'success', 'balance' => 0]);
- }
+
$now = new FrozenTime();
- $body = [
- 'state' => 'success',
- 'balance' => $state_balance->amount,
- 'decay' => $state_balance->partDecay($now),
- 'decay_date' => $now
- ];
+ if(!$state_balance) {
+ $body = [
+ 'state' => 'success',
+ 'balance' => 0,
+ 'decay' => 0
+ ];
+ } else {
+
+ $body = [
+ 'state' => 'success',
+ 'balance' => $state_balance->amount,
+ 'decay' => $state_balance->partDecay($now),
+ ];
+ }
+
+ $body['decay_date'] = $now;
$this->set('body', $body);
}
@@ -302,35 +311,31 @@ class AppRequestsController extends AppController
{
$this->viewBuilder()->setLayout('ajax');
$startTime = microtime(true);
+
$login_result = $this->requestLogin($session_id, false);
+
if($login_result !== true) {
return $this->returnJson($login_result);
}
$session = $this->getRequest()->getSession();
$user = $session->read('StateUser');
-
-
+
$stateBalancesTable = TableRegistry::getTableLocator()->get('StateBalances');
$stateUserTransactionsTable = TableRegistry::getTableLocator()->get('StateUserTransactions');
$transactionsTable = TableRegistry::getTableLocator()->get('Transactions');
-
$stateBalancesTable->updateBalances($user['id']);
-
+
$gdtSum = 0;
+
$gdtEntries = $this->JsonRequestClient->sendRequestGDT(['email' => $user['email']], 'GdtEntries' . DS . 'sumPerEmailApi');
-
+
if('success' == $gdtEntries['state'] && 'success' == $gdtEntries['data']['state']) {
$gdtSum = intval($gdtEntries['data']['sum']);
} else {
$this->addAdminError('StateBalancesController', 'overview', $gdtEntries, $user['id'] ? $user['id'] : 0);
}
- $stateUserTransactions_total = $stateUserTransactionsTable
- ->find()
- ->select(['id'])
- ->where(['state_user_id' => $user['id']])
- ->contain([]);
$stateUserTransactionsQuery = $stateUserTransactionsTable
->find()
@@ -343,17 +348,18 @@ class AppRequestsController extends AppController
$decay = true;
$transactions = [];
$transactions_from_db = $stateUserTransactionsQuery->toArray();
- if($stateUserTransactionsQuery->count() > 0) {
+
+ if(count($transactions_from_db)) {
if($orderDirection == 'DESC') {
$transactions_from_db = array_reverse($transactions_from_db);
}
+
$transactions = $transactionsTable->listTransactionsHumanReadable($transactions_from_db, $user, $decay);
if($orderDirection == 'DESC') {
$transactions = array_reverse($transactions);
}
-
- }
+ }
$state_balance = $stateBalancesTable->find()->where(['state_user_id' => $user['id']])->first();
@@ -361,7 +367,7 @@ class AppRequestsController extends AppController
'state' => 'success',
'transactions' => $transactions,
'transactionExecutingCount' => $session->read('Transactions.executing'),
- 'count' => $stateUserTransactions_total->count(),
+ 'count' => $stateUserTransactionsQuery->count(),
'gdtSum' => $gdtSum,
'timeUsed' => microtime(true) - $startTime
];
@@ -375,8 +381,8 @@ class AppRequestsController extends AppController
$body['balance'] = $state_balance->amount;
$body['decay'] = $stateBalancesTable->calculateDecay($state_balance->amount, $state_balance->record_date, $now);
}
-
- $this->set('body', $body);
+
+ $this->set('body', $body);
}
private function acquireAccessToken($session_id)
diff --git a/community_server/src/Controller/JsonRequestHandlerController.php b/community_server/src/Controller/JsonRequestHandlerController.php
index 12e03be8d..611984118 100644
--- a/community_server/src/Controller/JsonRequestHandlerController.php
+++ b/community_server/src/Controller/JsonRequestHandlerController.php
@@ -340,12 +340,13 @@ class JsonRequestHandlerController extends AppController {
return;
}
$transaction_body = $transaction->getTransactionBody();
- $transaction_type_name = $transaction_body->getTransactionTypeName();
- $senderUser = null;
- if($transaction_type_name === 'transfer') {
- $senderUser = $transaction_body->getSpecificTransaction()->getSenderUser();
- } else if($transaction_type_name === 'creation') {
- $senderUser = $transaction->getFirstSigningUser();
+ $senderUser = $transaction->getFirstSigningUser();
+ if($transaction_body != null) {
+ $transaction_type_name = $transaction_body->getTransactionTypeName();
+
+ if($transaction_type_name === 'transfer') {
+ $senderUser = $transaction_body->getSpecificTransaction()->getSenderUser();
+ }
}
// send notification email
$noReplyEmail = Configure::read('noReplyEmail');
@@ -373,22 +374,29 @@ class JsonRequestHandlerController extends AppController {
private function putTransaction($transactionBase64) {
$transaction = new Transaction($transactionBase64);
- //echo "after new transaction
";
+
if($transaction->hasErrors()) {
$this->sendEMailTransactionFailed($transaction, 'parse');
return $this->returnJson(['state' => 'error', 'msg' => 'error parsing transaction', 'details' => $transaction->getErrors()]);
}
- //echo "after check on errors
";
+
if(!$transaction->validate()) {
//$transaction_details
$this->sendEMailTransactionFailed($transaction, 'validate');
- return $this->returnJsonSaveError($transaction, ['state' => 'error', 'msg' => 'error validate transaction', 'details' => $transaction->getErrors()]);
+ return $this->returnJsonSaveError($transaction, [
+ 'state' => 'error',
+ 'msg' => 'error validate transaction',
+ 'details' => $transaction->getErrors()
+ ]);
}
- //echo "after validate
";
if ($transaction->save()) {
+ $result = ['state' => 'success'];
+ if($transaction->hasWarnings()) {
+ $result['warnings'] = $transaction->getWarnings();
+ }
// success
- return $this->returnJson(['state' => 'success']);
+ return $this->returnJson($result);
} else {
$this->sendEMailTransactionFailed($transaction, 'save');
diff --git a/community_server/src/Controller/StateBalancesController.php b/community_server/src/Controller/StateBalancesController.php
index 0dc9b672d..f16ed407b 100644
--- a/community_server/src/Controller/StateBalancesController.php
+++ b/community_server/src/Controller/StateBalancesController.php
@@ -151,35 +151,6 @@ class StateBalancesController extends AppController
$this->set('gdtSum', $gdtSum);
}
- public function ajaxGetBalance($session_id = 0)
- {
- if(!$session_id) {
- return $this->returnJson(['state' => 'error', 'msg' => 'invalid session id']);
- }
- $login_result = $this->requestLogin($session_id, false);
- if($login_result !== true) {
- return $this->returnJson($login_result);
- }
- $session = $this->getRequest()->getSession();
- $user = $session->read('StateUser');
-
- $this->StateBalances->updateBalances($user['id']);
-
- $state_balance = $this->StateBalances->find()->where(['state_user_id' => $user['id']])->first();
-
- if(!$state_balance) {
- return $this->returnJson(['state' => 'success', 'balance' => 0]);
- }
- $now = new FrozenTime();
-
- return $this->returnJson([
- 'state' => 'success',
- 'balance' => $state_balance->amount,
- 'decay' => $this->StateBalances->calculateDecay($state_balance->amount, $state_balance->record_date, $now),
- 'decay_date' => $now
- ]);
- }
-
public function ajaxGdtOverview()
{
diff --git a/community_server/src/Controller/TransactionsController.php b/community_server/src/Controller/TransactionsController.php
index 90e78b7fb..67526dfcc 100644
--- a/community_server/src/Controller/TransactionsController.php
+++ b/community_server/src/Controller/TransactionsController.php
@@ -7,6 +7,7 @@ use Model\Transactions\Transaction;
use Model\Transactions\TransactionBody;
use Cake\Core\Configure;
+use Cake\I18n\Time;
use Cake\ORM\TableRegistry;
/**
@@ -24,7 +25,7 @@ class TransactionsController extends AppController
parent::initialize();
$this->loadComponent('GradidoNumber');
$this->loadComponent('JsonRpcRequestClient');
- $this->Auth->allow(['decode']);
+ $this->Auth->allow(['decode', 'manualTransaction']);
}
/**
@@ -170,6 +171,78 @@ class TransactionsController extends AppController
$this->set('transaction', $transaction);
}
+ public function manualTransaction()
+ {
+ if ($this->request->is('post')) {
+ $data = $this->request->getData();
+ $type = $data['type'];
+
+ $transaction = new \Proto\Gradido\GradidoTransaction();
+ $transactionBody = new \Proto\Gradido\TransactionBody();
+ $transactionBody->setMemo($data['memo']);
+ $created = new \Proto\Gradido\TimestampSeconds();
+ $now = new Time();
+ $created->setSeconds($now->getTimestamp());
+ $transactionBody->setCreated($created);
+ if($type == "creation") {
+ $creation = new \Proto\Gradido\GradidoCreation();
+ $target_date = new \Proto\Gradido\TimestampSeconds();
+ $target_time = new Time($data['target_date']);
+ $target_date->setSeconds($target_time->getTimestamp());
+ $creation->setTargetDate($target_date);
+ $receiver = new \Proto\Gradido\TransferAmount();
+ $receiver->setAmount(intval($data['amount']));
+ $receiver->setPubkey(hex2bin($data['target_public_key']));
+ $creation->setReceiver($receiver);
+ $transactionBody->setCreation($creation);
+ } else if($type == "transfer") {
+ $transfer = new \Proto\Gradido\GradidoTransfer();
+ $local_transfer = new \Proto\Gradido\LocalTransfer();
+ $sender = new \Proto\Gradido\TransferAmount();
+ $sender->setAmount(intval($data['amount']));
+ $sender->setPubkey(hex2bin($data['sender_public_key']));
+ $local_transfer->setSender($sender);
+ $local_transfer->setReceiver(hex2bin($data['receiver_public_key']));
+ $transfer->setLocal($local_transfer);
+ $transactionBody->setTransfer($transfer);
+ }
+ $body_bytes = $transactionBody->serializeToString();
+ $transaction->setBodyBytes($body_bytes);
+
+ $protoSigMap = new \Proto\Gradido\SignatureMap();
+ $sigPairs = $protoSigMap->getSigPair();
+ //echo "sigPairs: "; var_dump($sigPairs); echo "
";
+ //return null;
+
+ // sign with keys
+ //foreach($keys as $key) {
+ $sigPair = new \Proto\Gradido\SignaturePair();
+ $sigPair->setPubKey(hex2bin($data['signer_public_key']));
+
+ $signature = sodium_crypto_sign_detached($body_bytes, hex2bin($data['signer_private_key']));
+ echo "signature: " . bin2hex($signature). "
";
+ $sigPair->setEd25519($signature);
+
+ $sigPairs[] = $sigPair;
+ // SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING
+ // SODIUM_BASE64_VARIANT_ORIGINAL
+ $transaction->setSigMap($protoSigMap);
+ //var_dump($protoSigMap);
+ $transaction_bin = $transaction->serializeToString();
+// $url_safe = sodium_bin2base64($transaction_bin, sodium_base64_VARIANT_ORIGINAL);
+ $base64 = [
+ //'original' => sodium_bin2base64($transaction_bin, sodium_base64_VARIANT_ORIGINAL),
+ //'original_nopadding' => sodium_bin2base64($transaction_bin, sodium_base64_VARIANT_ORIGINAL_NO_PADDING),
+ //'urlsafe' => sodium_bin2base64($transaction_bin, sodium_base64_VARIANT_URLSAFE),
+ 'urlsafe_nopadding' => sodium_bin2base64($transaction_bin, SODIUM_BASE64_VARIANT_URLSAFE_NO_PADDING),
+ 'php' => base64_encode($transaction_bin)
+
+ ];
+
+ $this->set('base64', $base64);
+ }
+ }
+
public function decode()
{
$this->viewBuilder()->setLayout('frontend');
diff --git a/community_server/src/Model/Messages/Gradido/Key.php b/community_server/src/Model/Messages/Gradido/Key.php
deleted file mode 100644
index b6190304c..000000000
--- a/community_server/src/Model/Messages/Gradido/Key.php
+++ /dev/null
@@ -1,96 +0,0 @@
-model.messages.gradido.Key
- */
-class Key extends \Google\Protobuf\Internal\Message
-{
- protected $key;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type string $ed25519
- * ed25519 signature (libsodium default)
- * @type string $ed25519_ref10
- * ed25519 ref10 signature
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\BasicTypes::initOnce();
- parent::__construct($data);
- }
-
- /**
- * ed25519 signature (libsodium default)
- *
- * Generated from protobuf field bytes ed25519 = 2;
- * @return string
- */
- public function getEd25519()
- {
- return $this->readOneof(2);
- }
-
- /**
- * ed25519 signature (libsodium default)
- *
- * Generated from protobuf field bytes ed25519 = 2;
- * @param string $var
- * @return $this
- */
- public function setEd25519($var)
- {
- GPBUtil::checkString($var, False);
- $this->writeOneof(2, $var);
-
- return $this;
- }
-
- /**
- * ed25519 ref10 signature
- *
- * Generated from protobuf field bytes ed25519_ref10 = 3;
- * @return string
- */
- public function getEd25519Ref10()
- {
- return $this->readOneof(3);
- }
-
- /**
- * ed25519 ref10 signature
- *
- * Generated from protobuf field bytes ed25519_ref10 = 3;
- * @param string $var
- * @return $this
- */
- public function setEd25519Ref10($var)
- {
- GPBUtil::checkString($var, False);
- $this->writeOneof(3, $var);
-
- return $this;
- }
-
- /**
- * @return string
- */
- public function getKey()
- {
- return $this->whichOneof("key");
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/ReceiverAmount.php b/community_server/src/Model/Messages/Gradido/ReceiverAmount.php
deleted file mode 100644
index 240c5a6fe..000000000
--- a/community_server/src/Model/Messages/Gradido/ReceiverAmount.php
+++ /dev/null
@@ -1,85 +0,0 @@
-model.messages.gradido.ReceiverAmount
- */
-class ReceiverAmount extends \Google\Protobuf\Internal\Message
-{
- /**
- * Generated from protobuf field bytes ed25519_receiver_pubkey = 1;
- */
- private $ed25519_receiver_pubkey = '';
- /**
- * Generated from protobuf field sint64 amount = 2;
- */
- private $amount = 0;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type string $ed25519_receiver_pubkey
- * @type int|string $amount
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\BasicTypes::initOnce();
- parent::__construct($data);
- }
-
- /**
- * Generated from protobuf field bytes ed25519_receiver_pubkey = 1;
- * @return string
- */
- public function getEd25519ReceiverPubkey()
- {
- return $this->ed25519_receiver_pubkey;
- }
-
- /**
- * Generated from protobuf field bytes ed25519_receiver_pubkey = 1;
- * @param string $var
- * @return $this
- */
- public function setEd25519ReceiverPubkey($var)
- {
- GPBUtil::checkString($var, False);
- $this->ed25519_receiver_pubkey = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field sint64 amount = 2;
- * @return int|string
- */
- public function getAmount()
- {
- return $this->amount;
- }
-
- /**
- * Generated from protobuf field sint64 amount = 2;
- * @param int|string $var
- * @return $this
- */
- public function setAmount($var)
- {
- GPBUtil::checkInt64($var);
- $this->amount = $var;
-
- return $this;
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/SenderAmount.php b/community_server/src/Model/Messages/Gradido/SenderAmount.php
deleted file mode 100644
index 52a41f71f..000000000
--- a/community_server/src/Model/Messages/Gradido/SenderAmount.php
+++ /dev/null
@@ -1,119 +0,0 @@
-model.messages.gradido.SenderAmount
- */
-class SenderAmount extends \Google\Protobuf\Internal\Message
-{
- /**
- * Generated from protobuf field bytes ed25519_sender_pubkey = 1;
- */
- private $ed25519_sender_pubkey = '';
- /**
- * Generated from protobuf field sint64 amount = 2;
- */
- private $amount = 0;
- /**
- * sender balance after transaction, including perishability
- *
- * Generated from protobuf field sint64 senderFinalBalance = 3;
- */
- private $senderFinalBalance = 0;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type string $ed25519_sender_pubkey
- * @type int|string $amount
- * @type int|string $senderFinalBalance
- * sender balance after transaction, including perishability
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\BasicTypes::initOnce();
- parent::__construct($data);
- }
-
- /**
- * Generated from protobuf field bytes ed25519_sender_pubkey = 1;
- * @return string
- */
- public function getEd25519SenderPubkey()
- {
- return $this->ed25519_sender_pubkey;
- }
-
- /**
- * Generated from protobuf field bytes ed25519_sender_pubkey = 1;
- * @param string $var
- * @return $this
- */
- public function setEd25519SenderPubkey($var)
- {
- GPBUtil::checkString($var, False);
- $this->ed25519_sender_pubkey = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field sint64 amount = 2;
- * @return int|string
- */
- public function getAmount()
- {
- return $this->amount;
- }
-
- /**
- * Generated from protobuf field sint64 amount = 2;
- * @param int|string $var
- * @return $this
- */
- public function setAmount($var)
- {
- GPBUtil::checkInt64($var);
- $this->amount = $var;
-
- return $this;
- }
-
- /**
- * sender balance after transaction, including perishability
- *
- * Generated from protobuf field sint64 senderFinalBalance = 3;
- * @return int|string
- */
- public function getSenderFinalBalance()
- {
- return $this->senderFinalBalance;
- }
-
- /**
- * sender balance after transaction, including perishability
- *
- * Generated from protobuf field sint64 senderFinalBalance = 3;
- * @param int|string $var
- * @return $this
- */
- public function setSenderFinalBalance($var)
- {
- GPBUtil::checkInt64($var);
- $this->senderFinalBalance = $var;
-
- return $this;
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/SignatureMap.php b/community_server/src/Model/Messages/Gradido/SignatureMap.php
deleted file mode 100644
index 228282747..000000000
--- a/community_server/src/Model/Messages/Gradido/SignatureMap.php
+++ /dev/null
@@ -1,65 +0,0 @@
-model.messages.gradido.SignatureMap
- */
-class SignatureMap extends \Google\Protobuf\Internal\Message
-{
- /**
- * Each signature pair corresponds to a unique Key required to sign the transaction.
- *
- * Generated from protobuf field repeated .model.messages.gradido.SignaturePair sigPair = 1;
- */
- private $sigPair;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type \Model\Messages\Gradido\SignaturePair[]|\Google\Protobuf\Internal\RepeatedField $sigPair
- * Each signature pair corresponds to a unique Key required to sign the transaction.
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\BasicTypes::initOnce();
- parent::__construct($data);
- }
-
- /**
- * Each signature pair corresponds to a unique Key required to sign the transaction.
- *
- * Generated from protobuf field repeated .model.messages.gradido.SignaturePair sigPair = 1;
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getSigPair()
- {
- return $this->sigPair;
- }
-
- /**
- * Each signature pair corresponds to a unique Key required to sign the transaction.
- *
- * Generated from protobuf field repeated .model.messages.gradido.SignaturePair sigPair = 1;
- * @param \Model\Messages\Gradido\SignaturePair[]|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setSigPair($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Model\Messages\Gradido\SignaturePair::class);
- $this->sigPair = $arr;
-
- return $this;
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/SignaturePair.php b/community_server/src/Model/Messages/Gradido/SignaturePair.php
deleted file mode 100644
index 203eb5677..000000000
--- a/community_server/src/Model/Messages/Gradido/SignaturePair.php
+++ /dev/null
@@ -1,123 +0,0 @@
-model.messages.gradido.SignaturePair
- */
-class SignaturePair extends \Google\Protobuf\Internal\Message
-{
- /**
- * Generated from protobuf field bytes pubKey = 1;
- */
- private $pubKey = '';
- protected $signature;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type string $pubKey
- * @type string $ed25519
- * ed25519 signature (libsodium default)
- * @type string $ed25519_ref10
- * ed25519 ref10 signature
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\BasicTypes::initOnce();
- parent::__construct($data);
- }
-
- /**
- * Generated from protobuf field bytes pubKey = 1;
- * @return string
- */
- public function getPubKey()
- {
- return $this->pubKey;
- }
-
- /**
- * Generated from protobuf field bytes pubKey = 1;
- * @param string $var
- * @return $this
- */
- public function setPubKey($var)
- {
- GPBUtil::checkString($var, False);
- $this->pubKey = $var;
-
- return $this;
- }
-
- /**
- * ed25519 signature (libsodium default)
- *
- * Generated from protobuf field bytes ed25519 = 2;
- * @return string
- */
- public function getEd25519()
- {
- return $this->readOneof(2);
- }
-
- /**
- * ed25519 signature (libsodium default)
- *
- * Generated from protobuf field bytes ed25519 = 2;
- * @param string $var
- * @return $this
- */
- public function setEd25519($var)
- {
- GPBUtil::checkString($var, False);
- $this->writeOneof(2, $var);
-
- return $this;
- }
-
- /**
- * ed25519 ref10 signature
- *
- * Generated from protobuf field bytes ed25519_ref10 = 3;
- * @return string
- */
- public function getEd25519Ref10()
- {
- return $this->readOneof(3);
- }
-
- /**
- * ed25519 ref10 signature
- *
- * Generated from protobuf field bytes ed25519_ref10 = 3;
- * @param string $var
- * @return $this
- */
- public function setEd25519Ref10($var)
- {
- GPBUtil::checkString($var, False);
- $this->writeOneof(3, $var);
-
- return $this;
- }
-
- /**
- * @return string
- */
- public function getSignature()
- {
- return $this->whichOneof("signature");
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/StateCreateGroup.php b/community_server/src/Model/Messages/Gradido/StateCreateGroup.php
deleted file mode 100644
index 4273ef93d..000000000
--- a/community_server/src/Model/Messages/Gradido/StateCreateGroup.php
+++ /dev/null
@@ -1,114 +0,0 @@
-model.messages.gradido.StateCreateGroup
- */
-class StateCreateGroup extends \Google\Protobuf\Internal\Message
-{
- /**
- * Generated from protobuf field string name = 1;
- */
- private $name = '';
- /**
- * Generated from protobuf field .model.messages.gradido.Key groupPublicKey = 2;
- */
- private $groupPublicKey = null;
- /**
- * Generated from protobuf field .model.messages.gradido.Key parentGroupPublicKey = 3;
- */
- private $parentGroupPublicKey = null;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type string $name
- * @type \Model\Messages\Gradido\Key $groupPublicKey
- * @type \Model\Messages\Gradido\Key $parentGroupPublicKey
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\StateCreateGroup::initOnce();
- parent::__construct($data);
- }
-
- /**
- * Generated from protobuf field string name = 1;
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
-
- /**
- * Generated from protobuf field string name = 1;
- * @param string $var
- * @return $this
- */
- public function setName($var)
- {
- GPBUtil::checkString($var, True);
- $this->name = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Key groupPublicKey = 2;
- * @return \Model\Messages\Gradido\Key
- */
- public function getGroupPublicKey()
- {
- return $this->groupPublicKey;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Key groupPublicKey = 2;
- * @param \Model\Messages\Gradido\Key $var
- * @return $this
- */
- public function setGroupPublicKey($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\Key::class);
- $this->groupPublicKey = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Key parentGroupPublicKey = 3;
- * @return \Model\Messages\Gradido\Key
- */
- public function getParentGroupPublicKey()
- {
- return $this->parentGroupPublicKey;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Key parentGroupPublicKey = 3;
- * @param \Model\Messages\Gradido\Key $var
- * @return $this
- */
- public function setParentGroupPublicKey($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\Key::class);
- $this->parentGroupPublicKey = $var;
-
- return $this;
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/StateGroupChangeParent.php b/community_server/src/Model/Messages/Gradido/StateGroupChangeParent.php
deleted file mode 100644
index c5371d76c..000000000
--- a/community_server/src/Model/Messages/Gradido/StateGroupChangeParent.php
+++ /dev/null
@@ -1,114 +0,0 @@
-model.messages.gradido.StateGroupChangeParent
- */
-class StateGroupChangeParent extends \Google\Protobuf\Internal\Message
-{
- /**
- * Generated from protobuf field .model.messages.gradido.Key groupPublicKey = 1;
- */
- private $groupPublicKey = null;
- /**
- * Generated from protobuf field .model.messages.gradido.Key newParentGroupPublicKey = 2;
- */
- private $newParentGroupPublicKey = null;
- /**
- * Generated from protobuf field .model.messages.gradido.Key oldParentGroupPublicKey = 3;
- */
- private $oldParentGroupPublicKey = null;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type \Model\Messages\Gradido\Key $groupPublicKey
- * @type \Model\Messages\Gradido\Key $newParentGroupPublicKey
- * @type \Model\Messages\Gradido\Key $oldParentGroupPublicKey
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\StateGroupChangeParent::initOnce();
- parent::__construct($data);
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Key groupPublicKey = 1;
- * @return \Model\Messages\Gradido\Key
- */
- public function getGroupPublicKey()
- {
- return $this->groupPublicKey;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Key groupPublicKey = 1;
- * @param \Model\Messages\Gradido\Key $var
- * @return $this
- */
- public function setGroupPublicKey($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\Key::class);
- $this->groupPublicKey = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Key newParentGroupPublicKey = 2;
- * @return \Model\Messages\Gradido\Key
- */
- public function getNewParentGroupPublicKey()
- {
- return $this->newParentGroupPublicKey;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Key newParentGroupPublicKey = 2;
- * @param \Model\Messages\Gradido\Key $var
- * @return $this
- */
- public function setNewParentGroupPublicKey($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\Key::class);
- $this->newParentGroupPublicKey = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Key oldParentGroupPublicKey = 3;
- * @return \Model\Messages\Gradido\Key
- */
- public function getOldParentGroupPublicKey()
- {
- return $this->oldParentGroupPublicKey;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Key oldParentGroupPublicKey = 3;
- * @param \Model\Messages\Gradido\Key $var
- * @return $this
- */
- public function setOldParentGroupPublicKey($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\Key::class);
- $this->oldParentGroupPublicKey = $var;
-
- return $this;
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/Timestamp.php b/community_server/src/Model/Messages/Gradido/Timestamp.php
deleted file mode 100644
index 19721729b..000000000
--- a/community_server/src/Model/Messages/Gradido/Timestamp.php
+++ /dev/null
@@ -1,101 +0,0 @@
-model.messages.gradido.Timestamp
- */
-class Timestamp extends \Google\Protobuf\Internal\Message
-{
- /**
- * Number of complete seconds since the start of the epoch
- *
- * Generated from protobuf field int64 seconds = 1;
- */
- private $seconds = 0;
- /**
- * Number of nanoseconds since the start of the last second
- *
- * Generated from protobuf field int32 nanos = 2;
- */
- private $nanos = 0;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type int|string $seconds
- * Number of complete seconds since the start of the epoch
- * @type int $nanos
- * Number of nanoseconds since the start of the last second
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\BasicTypes::initOnce();
- parent::__construct($data);
- }
-
- /**
- * Number of complete seconds since the start of the epoch
- *
- * Generated from protobuf field int64 seconds = 1;
- * @return int|string
- */
- public function getSeconds()
- {
- return $this->seconds;
- }
-
- /**
- * Number of complete seconds since the start of the epoch
- *
- * Generated from protobuf field int64 seconds = 1;
- * @param int|string $var
- * @return $this
- */
- public function setSeconds($var)
- {
- GPBUtil::checkInt64($var);
- $this->seconds = $var;
-
- return $this;
- }
-
- /**
- * Number of nanoseconds since the start of the last second
- *
- * Generated from protobuf field int32 nanos = 2;
- * @return int
- */
- public function getNanos()
- {
- return $this->nanos;
- }
-
- /**
- * Number of nanoseconds since the start of the last second
- *
- * Generated from protobuf field int32 nanos = 2;
- * @param int $var
- * @return $this
- */
- public function setNanos($var)
- {
- GPBUtil::checkInt32($var);
- $this->nanos = $var;
-
- return $this;
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/TimestampSeconds.php b/community_server/src/Model/Messages/Gradido/TimestampSeconds.php
deleted file mode 100644
index 2a588a312..000000000
--- a/community_server/src/Model/Messages/Gradido/TimestampSeconds.php
+++ /dev/null
@@ -1,67 +0,0 @@
-model.messages.gradido.TimestampSeconds
- */
-class TimestampSeconds extends \Google\Protobuf\Internal\Message
-{
- /**
- * Number of complete seconds since the start of the epoch
- *
- * Generated from protobuf field int64 seconds = 1;
- */
- private $seconds = 0;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type int|string $seconds
- * Number of complete seconds since the start of the epoch
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\BasicTypes::initOnce();
- parent::__construct($data);
- }
-
- /**
- * Number of complete seconds since the start of the epoch
- *
- * Generated from protobuf field int64 seconds = 1;
- * @return int|string
- */
- public function getSeconds()
- {
- return $this->seconds;
- }
-
- /**
- * Number of complete seconds since the start of the epoch
- *
- * Generated from protobuf field int64 seconds = 1;
- * @param int|string $var
- * @return $this
- */
- public function setSeconds($var)
- {
- GPBUtil::checkInt64($var);
- $this->seconds = $var;
-
- return $this;
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/Transaction.php b/community_server/src/Model/Messages/Gradido/Transaction.php
deleted file mode 100644
index 065cd80bb..000000000
--- a/community_server/src/Model/Messages/Gradido/Transaction.php
+++ /dev/null
@@ -1,166 +0,0 @@
-model.messages.gradido.Transaction
- */
-class Transaction extends \Google\Protobuf\Internal\Message
-{
- /**
- * Generated from protobuf field uint64 id = 1;
- */
- private $id = 0;
- /**
- * Generated from protobuf field .model.messages.gradido.TimestampSeconds received = 2;
- */
- private $received = null;
- /**
- * Generated from protobuf field .model.messages.gradido.SignatureMap sigMap = 3;
- */
- private $sigMap = null;
- /**
- * Generated from protobuf field bytes txHash = 4;
- */
- private $txHash = '';
- /**
- * Generated from protobuf field bytes bodyBytes = 5;
- */
- private $bodyBytes = '';
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type int|string $id
- * @type \Model\Messages\Gradido\TimestampSeconds $received
- * @type \Model\Messages\Gradido\SignatureMap $sigMap
- * @type string $txHash
- * @type string $bodyBytes
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\Transaction::initOnce();
- parent::__construct($data);
- }
-
- /**
- * Generated from protobuf field uint64 id = 1;
- * @return int|string
- */
- public function getId()
- {
- return $this->id;
- }
-
- /**
- * Generated from protobuf field uint64 id = 1;
- * @param int|string $var
- * @return $this
- */
- public function setId($var)
- {
- GPBUtil::checkUint64($var);
- $this->id = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.TimestampSeconds received = 2;
- * @return \Model\Messages\Gradido\TimestampSeconds
- */
- public function getReceived()
- {
- return $this->received;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.TimestampSeconds received = 2;
- * @param \Model\Messages\Gradido\TimestampSeconds $var
- * @return $this
- */
- public function setReceived($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\TimestampSeconds::class);
- $this->received = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.SignatureMap sigMap = 3;
- * @return \Model\Messages\Gradido\SignatureMap
- */
- public function getSigMap()
- {
- return $this->sigMap;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.SignatureMap sigMap = 3;
- * @param \Model\Messages\Gradido\SignatureMap $var
- * @return $this
- */
- public function setSigMap($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\SignatureMap::class);
- $this->sigMap = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field bytes txHash = 4;
- * @return string
- */
- public function getTxHash()
- {
- return $this->txHash;
- }
-
- /**
- * Generated from protobuf field bytes txHash = 4;
- * @param string $var
- * @return $this
- */
- public function setTxHash($var)
- {
- GPBUtil::checkString($var, False);
- $this->txHash = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field bytes bodyBytes = 5;
- * @return string
- */
- public function getBodyBytes()
- {
- return $this->bodyBytes;
- }
-
- /**
- * Generated from protobuf field bytes bodyBytes = 5;
- * @param string $var
- * @return $this
- */
- public function setBodyBytes($var)
- {
- GPBUtil::checkString($var, False);
- $this->bodyBytes = $var;
-
- return $this;
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/TransactionBody.php b/community_server/src/Model/Messages/Gradido/TransactionBody.php
deleted file mode 100644
index 3452d4251..000000000
--- a/community_server/src/Model/Messages/Gradido/TransactionBody.php
+++ /dev/null
@@ -1,193 +0,0 @@
-model.messages.gradido.TransactionBody
- */
-class TransactionBody extends \Google\Protobuf\Internal\Message
-{
- /**
- * max 150 chars
- *
- * Generated from protobuf field string memo = 1;
- */
- private $memo = '';
- /**
- * Generated from protobuf field .model.messages.gradido.TimestampSeconds created = 2;
- */
- private $created = null;
- protected $data;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type string $memo
- * max 150 chars
- * @type \Model\Messages\Gradido\TimestampSeconds $created
- * @type \Model\Messages\Gradido\StateCreateGroup $createGroup
- * @type \Model\Messages\Gradido\StateGroupChangeParent $groupChangeParent
- * @type \Model\Messages\Gradido\Transfer $transfer
- * @type \Model\Messages\Gradido\TransactionCreation $creation
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\TransactionBody::initOnce();
- parent::__construct($data);
- }
-
- /**
- * max 150 chars
- *
- * Generated from protobuf field string memo = 1;
- * @return string
- */
- public function getMemo()
- {
- return $this->memo;
- }
-
- /**
- * max 150 chars
- *
- * Generated from protobuf field string memo = 1;
- * @param string $var
- * @return $this
- */
- public function setMemo($var)
- {
- GPBUtil::checkString($var, True);
- $this->memo = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.TimestampSeconds created = 2;
- * @return \Model\Messages\Gradido\TimestampSeconds
- */
- public function getCreated()
- {
- return $this->created;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.TimestampSeconds created = 2;
- * @param \Model\Messages\Gradido\TimestampSeconds $var
- * @return $this
- */
- public function setCreated($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\TimestampSeconds::class);
- $this->created = $var;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.StateCreateGroup createGroup = 6;
- * @return \Model\Messages\Gradido\StateCreateGroup
- */
- public function getCreateGroup()
- {
- return $this->readOneof(6);
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.StateCreateGroup createGroup = 6;
- * @param \Model\Messages\Gradido\StateCreateGroup $var
- * @return $this
- */
- public function setCreateGroup($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\StateCreateGroup::class);
- $this->writeOneof(6, $var);
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.StateGroupChangeParent groupChangeParent = 7;
- * @return \Model\Messages\Gradido\StateGroupChangeParent
- */
- public function getGroupChangeParent()
- {
- return $this->readOneof(7);
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.StateGroupChangeParent groupChangeParent = 7;
- * @param \Model\Messages\Gradido\StateGroupChangeParent $var
- * @return $this
- */
- public function setGroupChangeParent($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\StateGroupChangeParent::class);
- $this->writeOneof(7, $var);
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Transfer transfer = 8;
- * @return \Model\Messages\Gradido\Transfer
- */
- public function getTransfer()
- {
- return $this->readOneof(8);
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.Transfer transfer = 8;
- * @param \Model\Messages\Gradido\Transfer $var
- * @return $this
- */
- public function setTransfer($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\Transfer::class);
- $this->writeOneof(8, $var);
-
- return $this;
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.TransactionCreation creation = 9;
- * @return \Model\Messages\Gradido\TransactionCreation
- */
- public function getCreation()
- {
- return $this->readOneof(9);
- }
-
- /**
- * Generated from protobuf field .model.messages.gradido.TransactionCreation creation = 9;
- * @param \Model\Messages\Gradido\TransactionCreation $var
- * @return $this
- */
- public function setCreation($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\TransactionCreation::class);
- $this->writeOneof(9, $var);
-
- return $this;
- }
-
- /**
- * @return string
- */
- public function getData()
- {
- return $this->whichOneof("data");
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/TransactionCreation.php b/community_server/src/Model/Messages/Gradido/TransactionCreation.php
deleted file mode 100644
index ae5f86e07..000000000
--- a/community_server/src/Model/Messages/Gradido/TransactionCreation.php
+++ /dev/null
@@ -1,136 +0,0 @@
-model.messages.gradido.TransactionCreation
- */
-class TransactionCreation extends \Google\Protobuf\Internal\Message
-{
- /**
- * 40 Byte
- *
- * Generated from protobuf field .model.messages.gradido.ReceiverAmount receiverAmount = 1;
- */
- private $receiverAmount = null;
- /**
- * 4 Byte
- *
- * Generated from protobuf field sint32 ident_hash = 2;
- */
- private $ident_hash = 0;
- /**
- * 8 Byte
- *
- * Generated from protobuf field .model.messages.gradido.TimestampSeconds target_date = 3;
- */
- private $target_date = null;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type \Model\Messages\Gradido\ReceiverAmount $receiverAmount
- * 40 Byte
- * @type int $ident_hash
- * 4 Byte
- * @type \Model\Messages\Gradido\TimestampSeconds $target_date
- * 8 Byte
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\TransactionCreation::initOnce();
- parent::__construct($data);
- }
-
- /**
- * 40 Byte
- *
- * Generated from protobuf field .model.messages.gradido.ReceiverAmount receiverAmount = 1;
- * @return \Model\Messages\Gradido\ReceiverAmount
- */
- public function getReceiverAmount()
- {
- return $this->receiverAmount;
- }
-
- /**
- * 40 Byte
- *
- * Generated from protobuf field .model.messages.gradido.ReceiverAmount receiverAmount = 1;
- * @param \Model\Messages\Gradido\ReceiverAmount $var
- * @return $this
- */
- public function setReceiverAmount($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\ReceiverAmount::class);
- $this->receiverAmount = $var;
-
- return $this;
- }
-
- /**
- * 4 Byte
- *
- * Generated from protobuf field sint32 ident_hash = 2;
- * @return int
- */
- public function getIdentHash()
- {
- return $this->ident_hash;
- }
-
- /**
- * 4 Byte
- *
- * Generated from protobuf field sint32 ident_hash = 2;
- * @param int $var
- * @return $this
- */
- public function setIdentHash($var)
- {
- GPBUtil::checkInt32($var);
- $this->ident_hash = $var;
-
- return $this;
- }
-
- /**
- * 8 Byte
- *
- * Generated from protobuf field .model.messages.gradido.TimestampSeconds target_date = 3;
- * @return \Model\Messages\Gradido\TimestampSeconds
- */
- public function getTargetDate()
- {
- return $this->target_date;
- }
-
- /**
- * 8 Byte
- *
- * Generated from protobuf field .model.messages.gradido.TimestampSeconds target_date = 3;
- * @param \Model\Messages\Gradido\TimestampSeconds $var
- * @return $this
- */
- public function setTargetDate($var)
- {
- GPBUtil::checkMessage($var, \Model\Messages\Gradido\TimestampSeconds::class);
- $this->target_date = $var;
-
- return $this;
- }
-
-}
-
diff --git a/community_server/src/Model/Messages/Gradido/Transfer.php b/community_server/src/Model/Messages/Gradido/Transfer.php
deleted file mode 100644
index 2c031d02b..000000000
--- a/community_server/src/Model/Messages/Gradido/Transfer.php
+++ /dev/null
@@ -1,85 +0,0 @@
-model.messages.gradido.Transfer
- */
-class Transfer extends \Google\Protobuf\Internal\Message
-{
- /**
- * Generated from protobuf field repeated .model.messages.gradido.SenderAmount senderAmounts = 1;
- */
- private $senderAmounts;
- /**
- * Generated from protobuf field repeated .model.messages.gradido.ReceiverAmount receiverAmounts = 2;
- */
- private $receiverAmounts;
-
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type \Model\Messages\Gradido\SenderAmount[]|\Google\Protobuf\Internal\RepeatedField $senderAmounts
- * @type \Model\Messages\Gradido\ReceiverAmount[]|\Google\Protobuf\Internal\RepeatedField $receiverAmounts
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\Transfer::initOnce();
- parent::__construct($data);
- }
-
- /**
- * Generated from protobuf field repeated .model.messages.gradido.SenderAmount senderAmounts = 1;
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getSenderAmounts()
- {
- return $this->senderAmounts;
- }
-
- /**
- * Generated from protobuf field repeated .model.messages.gradido.SenderAmount senderAmounts = 1;
- * @param \Model\Messages\Gradido\SenderAmount[]|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setSenderAmounts($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Model\Messages\Gradido\SenderAmount::class);
- $this->senderAmounts = $arr;
-
- return $this;
- }
-
- /**
- * Generated from protobuf field repeated .model.messages.gradido.ReceiverAmount receiverAmounts = 2;
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getReceiverAmounts()
- {
- return $this->receiverAmounts;
- }
-
- /**
- * Generated from protobuf field repeated .model.messages.gradido.ReceiverAmount receiverAmounts = 2;
- * @param \Model\Messages\Gradido\ReceiverAmount[]|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setReceiverAmounts($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Model\Messages\Gradido\ReceiverAmount::class);
- $this->receiverAmounts = $arr;
-
- return $this;
- }
-
-}
-
diff --git a/community_server/src/Model/Transactions/Transaction.php b/community_server/src/Model/Transactions/Transaction.php
index 40be13cd3..810f20c9d 100644
--- a/community_server/src/Model/Transactions/Transaction.php
+++ b/community_server/src/Model/Transactions/Transaction.php
@@ -25,7 +25,7 @@ class Transaction extends TransactionBase {
//$transactionBin = base64_decode($base64Data, true);
//if($transactionBin == false) {
//sodium_base64_VARIANT_URLSAFE_NO_PADDING
- if(is_a($base64Data, '\Proto\Gradido\Transaction')) {
+ if(is_a($base64Data, '\Proto\Gradido\GradidoTransaction')) {
$this->mProtoTransaction = $base64Data;
$this->mTransactionBody = new TransactionBody($this->mProtoTransaction->getBodyBytes());
return;
@@ -93,7 +93,11 @@ class Transaction extends TransactionBase {
return $this->mTransactionBody;
}
- public function getFirstPublic() {
+ public function getFirstPublic()
+ {
+ if(!$this->mProtoTransaction || !$this->mProtoTransaction->getSigMap()) {
+ return '';
+ }
$sigPairs = $this->mProtoTransaction->getSigMap()->getSigPair();
return $sigPairs[0]->getPubKey();
}
@@ -111,6 +115,7 @@ class Transaction extends TransactionBase {
$sigMap = $this->mProtoTransaction->getSigMap();
if(!$sigMap) {
$this->addError('Transaction', 'signature map is zero');
+ //var_dump($this->mProtoTransaction);
return false;
}
//var_dump($sigMap);
@@ -193,8 +198,10 @@ class Transaction extends TransactionBase {
$connection->commit();
- $this->mTransactionBody->getSpecificTransaction()->sendNotificationEmail($this->mTransactionBody->getMemo());
+ $specificTransaction = $this->mTransactionBody->getSpecificTransaction();
+ $specificTransaction->sendNotificationEmail($this->mTransactionBody->getMemo());
+ $this->addWarnings($specificTransaction->getWarnings());
return true;
}
diff --git a/community_server/src/Model/Transactions/TransactionBase.php b/community_server/src/Model/Transactions/TransactionBase.php
index 607903d8d..6b3817201 100644
--- a/community_server/src/Model/Transactions/TransactionBase.php
+++ b/community_server/src/Model/Transactions/TransactionBase.php
@@ -6,29 +6,43 @@ use Cake\ORM\TableRegistry;
class TransactionBase {
private $errors = [];
+ private $warnings = [];
static $tables = [];
public function getErrors() {
- return $this->errors;
+ return $this->errors;
+ }
+
+ public function getWarnings() {
+ return $this->warnings;
}
-
public function addError($functionName, $errorName) {
- array_push($this->errors, [$functionName => $errorName]);
+ array_push($this->errors, [$functionName => $errorName]);
+ }
+ public function addWarning($functionName, $warningName) {
+ array_push($this->warnings, [$functionName => $warningName]);
}
public function addErrors($errors) {
- $this->errors = array_merge($this->errors, $errors);
+ $this->errors = array_merge($this->errors, $errors);
+ }
+
+ public function addWarnings($warnings) {
+ $this->warnings = array_merge($this->warnings, $warnings);
}
public function hasErrors() {
- return count($this->errors) > 0;
+ return count($this->errors) > 0;
}
+ public function hasWarnings() {
+ return count($this->warnings) > 0;
+ }
public static function getTable($tableName) {
- if(!isset(self::$tables[$tableName])) {
- self::$tables[$tableName] = TableRegistry::getTableLocator()->get($tableName);
- }
- return self::$tables[$tableName];
+ if(!isset(self::$tables[$tableName])) {
+ self::$tables[$tableName] = TableRegistry::getTableLocator()->get($tableName);
+ }
+ return self::$tables[$tableName];
}
diff --git a/community_server/src/Model/Transactions/TransactionCreation.php b/community_server/src/Model/Transactions/TransactionCreation.php
index f9b3c7657..9150d24eb 100644
--- a/community_server/src/Model/Transactions/TransactionCreation.php
+++ b/community_server/src/Model/Transactions/TransactionCreation.php
@@ -209,6 +209,7 @@ class TransactionCreation extends TransactionBase {
->send();
} catch(Exception $e) {
// $this->addError('TransactionCreation::sendNotificationEmail', 'error sending notification email: ' . $e->getMessage());
+ $this->addWarning('TransactionCreation::sendNotificationEmail', 'error sending notification email: ' . $e->getMessage());
return false;
}
return true;
diff --git a/community_server/src/Model/Transactions/TransactionTransfer.php b/community_server/src/Model/Transactions/TransactionTransfer.php
index 4f3f4e88c..dc1606f55 100644
--- a/community_server/src/Model/Transactions/TransactionTransfer.php
+++ b/community_server/src/Model/Transactions/TransactionTransfer.php
@@ -58,7 +58,7 @@ class TransactionTransfer extends TransactionBase {
//$this->addError('TransactionTransfer::validate', 'not implemented yet');
//return false;
//$time = microtime(true);
- static $functionName = 'TransactionCreation::validate';
+ static $functionName = 'TransactionTransfer::validate';
$sigPubHexs = [];
foreach($sigPairs as $sigPair)
@@ -204,13 +204,14 @@ class TransactionTransfer extends TransactionBase {
$this->addError('TransactionCreation::sendNotificationEmail', 'to email is empty for user: ' . $receiverUser->id);
return false;
}
- $email->setFrom([$serverAdminEmail => $senderUser->getNames() . ' via Gradido Community'])
+ $noReplyEmail = Configure::read('noReplyEmail');
+ $email->setFrom([$noReplyEmail => 'Gradido (nicht antworten)'])
->setTo([$receiverUser->email => $receiverUser->getNames()])
- ->setReplyTo($senderUser->email)
->setSubject(__('Gradidos erhalten'))
->send();
} catch(Exception $e) {
//$this->addError('TransactionTransfer::sendNotificationEmail', 'error sending notification email: ' . $e->getMessage());
+ $this->addWarning('TransactionTransfer::sendNotificationEmail', 'error sending notification email: ' . $e->getMessage());
return false;
}
return true;
diff --git a/community_server/src/Template/Email/text/notification_transfer.ctp b/community_server/src/Template/Email/text/notification_transfer.ctp
index 2cc692e02..155304c2c 100644
--- a/community_server/src/Template/Email/text/notification_transfer.ctp
+++ b/community_server/src/Template/Email/text/notification_transfer.ctp
@@ -15,7 +15,7 @@ $senderNames = $senderUser->first_name . ' ' . $senderUser->last_name;
= $memo ?>
-= __('Du kannst {0} eine Nachricht schreiben, indem du auf diese E-Mail antwortest', $senderNames); ?>
+= __('Bitte antworte nicht auf diese E-Mail!'); ?>
= __('Mit freundlichen Grüßen'); ?>
Gradido Community Server
\ No newline at end of file
diff --git a/community_server/src/Template/Transactions/manual_transaction.ctp b/community_server/src/Template/Transactions/manual_transaction.ctp
new file mode 100644
index 000000000..30bda1175
--- /dev/null
+++ b/community_server/src/Template/Transactions/manual_transaction.ctp
@@ -0,0 +1,63 @@
+loadHelper('Form', [
+ 'templates' => 'horizontal_form',
+]);
+$now = new \DateTime;
+?>
+ 0) : ?>
+
= __('Creation Transaction') ?>
+= __('Transfer Transaction') ?>
+GDD
-Explorer
-