Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 1320 | Rev 16768 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1320 Rev 16766
Línea 2... Línea 2...
2
declare(strict_types=1);
2
declare(strict_types=1);
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
namespace LeadersLinked\Controller;
4
namespace LeadersLinked\Controller;
5
 
5
 
6
use Laminas\Db\Adapter\AdapterInterface;
6
use Laminas\Db\Adapter\AdapterInterface;
7
use Laminas\Cache\Storage\Adapter\AbstractAdapter;
7
use LeadersLinked\Cache\CacheInterface;
8
use Laminas\Mvc\Controller\AbstractActionController;
8
use Laminas\Mvc\Controller\AbstractActionController;
9
use Laminas\Log\LoggerInterface;
9
use Laminas\Log\LoggerInterface;
10
use Laminas\View\Model\ViewModel;
10
use Laminas\View\Model\ViewModel;
Línea 52... Línea 52...
52
use LeadersLinked\Model\CompanyMicrolearningExtendUserPartner;
52
use LeadersLinked\Model\CompanyMicrolearningExtendUserPartner;
53
use LeadersLinked\Model\CompanyMicrolearningExtendUserSector;
53
use LeadersLinked\Model\CompanyMicrolearningExtendUserSector;
54
use LeadersLinked\Model\CompanyMicrolearningExtendUserStudentType;
54
use LeadersLinked\Model\CompanyMicrolearningExtendUserStudentType;
55
use LeadersLinked\Model\CompanyMicrolearningUser;
55
use LeadersLinked\Model\CompanyMicrolearningUser;
56
use LeadersLinked\Mapper\CompanyMicrolearningCapsuleCommentMapper;
56
use LeadersLinked\Mapper\CompanyMicrolearningCapsuleCommentMapper;
-
 
57
use LeadersLinked\Library\Functions;
Línea 57... Línea 58...
57
 
58
 
58
 
59
 
59
class MicrolearningAccessForStudentsController extends AbstractActionController
60
class MicrolearningAccessForStudentsController extends AbstractActionController
Línea 65... Línea 66...
65
    private $adapter;
66
    private $adapter;
Línea 66... Línea 67...
66
    
67
    
67
    
68
    
68
    /**
69
    /**
69
     *
70
     *
70
     * @var AbstractAdapter
71
     * @var CacheInterface
Línea 71... Línea 72...
71
     */
72
     */
72
    private $cache;
73
    private $cache;
Línea 85... Línea 86...
85
    private $config;
86
    private $config;
Línea 86... Línea 87...
86
    
87
    
87
    /**
88
    /**
88
     *
89
     *
89
     * @param AdapterInterface $adapter
90
     * @param AdapterInterface $adapter
90
     * @param AbstractAdapter $cache
91
     * @param CacheInterface $cache
91
     * @param LoggerInterface $logger
92
     * @param LoggerInterface $logger
92
     * @param array $config
93
     * @param array $config
93
     */
94
     */
94
    public function __construct($adapter, $cache , $logger,  $config)
95
    public function __construct($adapter, $cache , $logger,  $config)
Línea 395... Línea 396...
395
        
396
        
Línea 396... Línea 397...
396
        
397
        
397
        
398
        
398
        if($request->isPost()) {
399
        if($request->isPost()) {
399
            
400
            
Línea 400... Línea 401...
400
            $step = filter_var( $this->params()->fromPost('step'), FILTER_SANITIZE_STRING); 
401
            $step = Functions::sanitizeFilterString($this->params()->fromPost('step')); 
Línea 433... Línea 434...
433
                    {
434
                    {
434
                        //A = Nombre 	B = Apellidos	C = Email 	D = contraseña
435
                        //A = Nombre 	B = Apellidos	C = Email 	D = contraseña
Línea 435... Línea 436...
435
                        
436
                        
436
                        
437
                        
437
                        $email = trim(filter_var($record['C'], FILTER_SANITIZE_EMAIL));
438
                        $email = trim(filter_var($record['C'], FILTER_SANITIZE_EMAIL));
438
                        $first_name = trim(filter_var($record['A'], FILTER_SANITIZE_STRING));
439
                        $first_name = Functions::sanitizeFilterString($record['A']);
439
                        $last_name = trim(filter_var($record['B'], FILTER_SANITIZE_STRING));
440
                        $last_name = Functions::sanitizeFilterString($record['B']);
440
                        $password = trim(filter_var($record['D'], FILTER_SANITIZE_STRING));
441
                        $password = Functions::sanitizeFilterString($record['D']);
441
                        
442
                        
442
                        $filterCompany =  isset($record['E']) ? trim(filter_var($record['E'], FILTER_SANITIZE_STRING)) : '';
443
                        $filterCompany =  isset($record['E']) ? Functions::sanitizeFilterString($record['E']) : '';
443
                        $filterFunction = isset($record['F']) ? trim(filter_var($record['F'], FILTER_SANITIZE_STRING)) : '';
444
                        $filterFunction = isset($record['F']) ? Functions::sanitizeFilterString($record['F']) : '';
444
                        $filterGroup = isset($record['G']) ? trim(filter_var($record['G'], FILTER_SANITIZE_STRING)) : '';
445
                        $filterGroup = isset($record['G']) ? Functions::sanitizeFilterString($record['G']) : '';
445
                        $filterInstitution = isset($record['H']) ? trim(filter_var($record['H'], FILTER_SANITIZE_STRING)) : '';
446
                        $filterInstitution = isset($record['H']) ? Functions::sanitizeFilterString($record['H']) : '';
446
                        $filterProgram = isset($record['I']) ? trim(filter_var($record['I'], FILTER_SANITIZE_STRING)) : '';
447
                        $filterProgram = isset($record['I']) ? Functions::sanitizeFilterString($record['I']) : '';
447
                        $filterPartner = isset($record['J']) ? trim(filter_var($record['J'], FILTER_SANITIZE_STRING)) : '';
448
                        $filterPartner = isset($record['J']) ? Functions::sanitizeFilterString($record['J']) : '';
Línea 448... Línea 449...
448
                        $filterSector = isset($record['K']) ? trim(filter_var($record['K'], FILTER_SANITIZE_STRING)) : '';
449
                        $filterSector = isset($record['K']) ? Functions::sanitizeFilterString($record['K']) : '';
449
                        $filterStudentType = isset($record['L']) ? trim(filter_var($record['L'], FILTER_SANITIZE_STRING)) : '';
450
                        $filterStudentType = isset($record['L']) ? Functions::sanitizeFilterString($record['L']) : '';
450
 
451
 
Línea 516... Línea 517...
516
                        'data'   => $messages
517
                        'data'   => $messages
517
                    ]);
518
                    ]);
518
                }
519
                }
519
            } else if($step == 'process') {
520
            } else if($step == 'process') {
Línea 520... Línea 521...
520
            
521
            
521
                $key = filter_var( $this->params()->fromPost('key'), FILTER_SANITIZE_STRING); 
522
                $key = Functions::sanitizeFilterString($this->params()->fromPost('key')); 
522
                if(!$key) {
523
                if(!$key) {
523
                    return new JsonModel([
524
                    return new JsonModel([
524
                        'success' => false,
525
                        'success' => false,
525
                        'data' => 'ERROR_CACHE_KEY_EMPTY'
526
                        'data' => 'ERROR_CACHE_KEY_EMPTY'
Línea 921... Línea 922...
921
                        'data' => 'ERROR_NOT_SELECTED_CUSTOMERS'
922
                        'data' => 'ERROR_NOT_SELECTED_CUSTOMERS'
922
                    ]);
923
                    ]);
Línea 923... Línea 924...
923
                    
924
                    
Línea 924... Línea 925...
924
                }
925
                }
925
                
926
                
926
                $push_template_uuid = filter_var($form->get('push_template_id')->getValue(), FILTER_SANITIZE_STRING);
927
                $push_template_uuid = Functions::sanitizeFilterString($form->get('push_template_id')->getValue());
927
                $pushMapper = PushMapper::getInstance($this->adapter);
928
                $pushMapper = PushMapper::getInstance($this->adapter);
Línea 928... Línea 929...
928
                $pushTemplateMapper = PushTemplateMapper::getInstance($this->adapter);
929
                $pushTemplateMapper = PushTemplateMapper::getInstance($this->adapter);