✏️ 正在编辑: AuthenticationController.php
路径:
/srv/systems_dir/koruspay/application/controllers/AuthenticationController.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class AuthenticationController extends Zend_Controller_Action { public function authAction() { $request = $this->getRequest(); $secret = $request->getPost('secret'); $token = $request->getPost('token'); $splitId = $request->getPost('split_id'); $itens = $request->getPost('itens'); try { if ($token) { if (Model_Auth::autenticate($token)) { if ($splitId && empty($itens)) { $this->_helper->json([ 'redirect' => '/split/send-split?split_id=' . $splitId ]); } if ($itens && empty($splitId)) { $id = hash('sha256', uniqid(rand(), true)); $ns = new Zend_Session_Namespace('reprocess_split_' . $id); $ns->unsetAll(); $ns->reprocess_split = $itens; $this->_helper->json([ 'redirect' => '/split/send-reprocess?id=' . $id ]); } } $this->_helper->json([ 'token_error' => true, 'message' => 'Token inválido, tente novamente!' ]); } if ($secret) { Model_Auth::recordSecret($secret); } if (Model_Auth::displaySecret()) { $this->_helper->json([ 'secret' => true, 'input_token' => $this->view->render('authentication/token.phtml') ]); } $qrCode = Model_Auth::generateQrcode(); $this->view->qrcode = $qrCode['qrcode']; $this->_helper->json([ 'qrcode' => true, 'secret' => $qrCode['secret'], 'qrCode_image' => $this->view->render('authentication/qrcode.phtml') ]); } catch (Throwable $tr) { $this->_helper->json([ 'error' => true, 'message' => 'Não foi possível gerar autentição. ' . $tr->getMessage() ]); } } }
💾 保存文件
← 返回文件管理器