Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 254 Rev 257
Línea 23... Línea 23...
23
use LeadersLinked\Mapper\FeedMapper;
23
use LeadersLinked\Mapper\FeedMapper;
24
use LeadersLinked\Model\Feed;
24
use LeadersLinked\Model\Feed;
25
use LeadersLinked\Model\User;
25
use LeadersLinked\Model\User;
26
use LeadersLinked\Model\Connection;
26
use LeadersLinked\Model\Connection;
27
use LeadersLinked\Mapper\NetworkMapper;
27
use LeadersLinked\Mapper\NetworkMapper;
28
use Laminas\Authentication\AuthenticationService;
-
 
29
use LeadersLinked\Authentication\AuthEmailAdapter;
-
 
30
use LeadersLinked\Cache\CacheInterface;
-
 
31
use LeadersLinked\Cache\CacheImpl;
-
 
32
use LeadersLinked\Library\Functions;
28
use LeadersLinked\Library\Functions;
33
use LeadersLinked\Model\Network;
29
use LeadersLinked\Model\Network;
-
 
30
 
34
use Laminas\Http\Response;
31
use LeadersLinked\Library\ExternalCredentials;
Línea 35... Línea 32...
35
 
32
 
36
class HomeController extends AbstractActionController
33
class HomeController extends AbstractActionController
37
{
34
{
38
    /**
35
    /**
Línea 101... Línea 98...
101
                $adapter->setData('santiago.olivera@leaderslinked.com',  $currentNetwork->id);
98
                $adapter->setData('santiago.olivera@leaderslinked.com',  $currentNetwork->id);
Línea 102... Línea 99...
102
                
99
                
103
                $authService->authenticate($adapter);
100
                $authService->authenticate($adapter);
104
            }
101
            }
105
        }
102
        }
106
        
103
        /*
107
        $currentUserPlugin = $this->plugin('currentUserPlugin');
104
        $currentUserPlugin = $this->plugin('currentUserPlugin');
108
        if ($currentUserPlugin->hasIdentity()) {
105
        if ($currentUserPlugin->hasIdentity()) {
109
            return $this->redirect()->toRoute('dashboard');
106
            return $this->redirect()->toRoute('dashboard');
110
        } else {
107
        } else {
Línea 137... Línea 134...
137
            if ($sandbox) {
134
            if ($sandbox) {
138
                $google_map_key  = $this->config['leaderslinked.google_map.sandbox_api_key'];
135
                $google_map_key  = $this->config['leaderslinked.google_map.sandbox_api_key'];
139
            } else {
136
            } else {
140
                $google_map_key  = $this->config['leaderslinked.google_map.production_api_key'];
137
                $google_map_key  = $this->config['leaderslinked.google_map.production_api_key'];
141
            }
138
            }
-
 
139
            
-
 
140
            
-
 
141
 
Línea 142... Línea 142...
142
    
142
    
143
            return  new JsonModel([
143
            $data = [
144
                'site_key'  => $site_key,
144
                'site_key'  => $site_key,
145
                'google_map_key' => $google_map_key,
145
                'google_map_key' => $google_map_key,
146
                'aes'       => $_SESSION['aes'],
146
                'aes'       => $_SESSION['aes'],
147
                'defaultNetwork' => $currentNetwork->default,
147
                'defaultNetwork' => $currentNetwork->default,
148
                'is_logged_in' =>  $currentUserPlugin->hasIdentity() ? true : false,
148
                'is_logged_in' =>  $currentUserPlugin->hasIdentity() ? true : false,
149
                'access_usign_social_networks' => $access_usign_social_networks &&  $currentNetwork && $currentNetwork->default == Network::DEFAULT_YES ? 'y' : 'n',
149
                'access_usign_social_networks' => $access_usign_social_networks &&  $currentNetwork && $currentNetwork->default == Network::DEFAULT_YES ? 'y' : 'n',
-
 
150
            ];
-
 
151
            
-
 
152
            if($currentNetwork->default == Network::DEFAULT_YES) {
-
 
153
                $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
154
                if ($currentUserPlugin->hasIdentity()) {
-
 
155
                  $externalCredentials = ExternalCredentials::getInstancia($this->config, $this->adapter);
-
 
156
                  $externalCredentials->getUserBy($currentUserPlugin->getUserId());
-
 
157
                  
-
 
158
                  if($currentNetwork->xmpp_active) {
-
 
159
                      $data['xmpp_domain']      = $currentNetwork->xmpp_domain;
-
 
160
                      $data['xmpp_hostname']    = $currentNetwork->xmpp_hostname;
-
 
161
                      $data['xmpp_port']        = $currentNetwork->xmpp_port;
-
 
162
                      $data['xmpp_username']    = $externalCredentials->getUsernameXmpp();
-
 
163
                      $data['xmpp_password']    = $externalCredentials->getPasswordXmpp();
-
 
164
                  }
-
 
165
                } 
-
 
166
            }
-
 
167
            
Línea 150... Línea 168...
150
            ]);
168
            return  new JsonModel($data);
151
            
169
            
152
 
170
 
Línea 739... Línea 757...
739
                        
757
                        
Línea 740... Línea 758...
740
                        if ($image_name) {
758
                        if ($image_name) {
Línea -... Línea 759...
-
 
759
                            
-
 
760
                            $source = $this->config['leaderslinked.fullpath.feed'] . $feed->uuid . DIRECTORY_SEPARATOR . $image_name;
-
 
761
                            
Línea 741... Línea 762...
741
                            
762
                            $target_path = $this->config['leaderslinked.frontend.frontend']. DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'feed' . DIRECTORY_SEPARATOR . $feed->uuid;
Línea 742... Línea 763...
742
                            $source = $this->config['leaderslinked.fullpath.feed'] . $feed->uuid . DIRECTORY_SEPARATOR . $image_name;
763
                        
743
                            
764
                            
744
                            
765
                            
Línea 781... Línea 802...
781
                    
802
                    
782
                    if ($post->image) {
803
                    if ($post->image) {
Línea 783... Línea 804...
783
                        $source = $this->config['leaderslinked.fullpath.post'] . $post->uuid . DIRECTORY_SEPARATOR . $post->image;
804
                        $source = $this->config['leaderslinked.fullpath.post'] . $post->uuid . DIRECTORY_SEPARATOR . $post->image;
-
 
805
                        
-
 
806
                        
Línea 784... Línea 807...
784
                        
807
                       // $target_path = 'public' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'post' . DIRECTORY_SEPARATOR . $post->uuid;
785
                        
808
                        
786
                        $target_path = 'public' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'post' . DIRECTORY_SEPARATOR . $post->uuid;
809
                        $target_path = $this->config['leaderslinked.frontend.frontend'] . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'post' . DIRECTORY_SEPARATOR . $post->uuid;