mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Forward User with not activated account back to login
This commit is contained in:
parent
7a389c6862
commit
4465f3ad6f
@ -161,7 +161,6 @@ class AppController extends Controller
|
||||
|
||||
$response = $http->get($url . '/login', ['session_id' => $session_id]);
|
||||
$json = $response->getJson();
|
||||
|
||||
if(isset($json) && count($json) > 0) {
|
||||
|
||||
if($json['state'] === 'success' && intval($json['user']['email_checked']) === 1) {
|
||||
@ -227,8 +226,10 @@ class AppController extends Controller
|
||||
} else {
|
||||
if($json['state'] === 'not found' ) {
|
||||
$this->Flash->error(__('invalid session'));
|
||||
return $this->redirect(Router::url('/', true) . 'account/', 303);
|
||||
} else {
|
||||
$this->Flash->error(__('Konto ist nicht aktiviert!'));
|
||||
}
|
||||
return $this->redirect(Router::url('/', true) . 'account/', 303);
|
||||
}
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
@ -276,12 +277,14 @@ class AppController extends Controller
|
||||
$adminErrorEntity->details = $returnTable['details'];
|
||||
}
|
||||
if(!$adminErrorTable->save($adminErrorEntity)) {
|
||||
$this->Flash->error(__('Serious error, couldn\'t save to db, please write the admin: ' . $this->getAdminEmailLink()));
|
||||
$this->Flash->error(
|
||||
__('Serious error, couldn\'t save to db, please write the admin: ' . $this->getAdminEmailLink()),
|
||||
['escape' => false]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getAdminEmailLink($text) {
|
||||
public function getAdminEmailLink($text = '') {
|
||||
$serverAdminEmail = Configure::read('ServerAdminEmail');
|
||||
return '<a href="mailto:' . $serverAdminEmail . '">'. $serverAdminEmail . '</a>';
|
||||
}
|
||||
|
||||
@ -44,7 +44,6 @@ class DashboardController extends AppController
|
||||
return $result;
|
||||
}
|
||||
$user = $session->read('StateUser');
|
||||
|
||||
$serverUser = $this->Auth->user('id');
|
||||
if($serverUser) {
|
||||
$adminErrorsTable = TableRegistry::getTableLocator()->get('AdminErrors');
|
||||
|
||||
@ -59,6 +59,7 @@ class StateBalancesController extends AppController
|
||||
// listPerEmailApi
|
||||
|
||||
//var_dump($user);
|
||||
|
||||
$gdtSum = 0;
|
||||
//if('admin' === $user['role']) {
|
||||
$gdtEntries = $this->JsonRequestClient->sendRequestGDT(['email' => $user['email']], 'GdtEntries' . DS . 'sumPerEmailApi');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user