Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 286 Rev 287
Línea 59... Línea 59...
59
    public function getUserImage($user)
59
    public function getUserImage($user)
60
    {
60
    {
61
        if($user->image) {
61
        if($user->image) {
62
            $remoto = $this->getPathUser() . '/' . $user->uuid . '/' .  $user->image;
62
            $remoto = $this->getPathUser() . '/' . $user->uuid . '/' .  $user->image;
63
            if($this->s3Files->objectExist($remoto)) {
63
            if($this->s3Files->objectExist($remoto)) {
64
                $s = $this->s3Files->getPresignedUrl($remoto);
64
                return $this->s3Files->getPresignedUrl($remoto);
65
                return str_replace('http://', 'https://', $s);
-
 
-
 
65
                
66
            }
66
            }
67
        }
67
        }
Línea 68... Línea 68...
68
        
68
        
69
        $remoto = $this->config['leaderslinked.images_default.user_image'];
69
        $remoto = $this->config['leaderslinked.images_default.user_image'];
Línea 79... Línea 79...
79
    public function getUserImageForCodeAndFilename($code, $filename)
79
    public function getUserImageForCodeAndFilename($code, $filename)
80
    {
80
    {
81
        if($filename) {
81
        if($filename) {
82
            $remoto = $this->getPathUser() . '/' . $code . '/' .  $filename;
82
            $remoto = $this->getPathUser() . '/' . $code . '/' .  $filename;
83
            if($this->s3Files->objectExist($remoto)) {
83
            if($this->s3Files->objectExist($remoto)) {
84
                $s = $this->s3Files->getPresignedUrl($remoto);
84
                return $this->s3Files->getPresignedUrl($remoto);
85
                return str_replace('http://', 'https://', $s);
-
 
-
 
85
                
86
            }
86
            }
87
        }
87
        }
Línea 88... Línea 88...
88
        
88
        
89
        $remoto = $this->config['leaderslinked.images_default.user_image'];
89
        $remoto = $this->config['leaderslinked.images_default.user_image'];
90
        $s = $this->s3Files->getPresignedUrl($remoto);
-
 
-
 
90
        return $this->s3Files->getPresignedUrl($remoto);
91
        return str_replace('http://', 'https://', $s);
91
        
Línea 92... Línea 92...
92
    }
92
    }
93
    
93
    
94
    /**
94
    /**
Línea 100... Línea 100...
100
    public function getUserProfileImage($user, $userProfile)
100
    public function getUserProfileImage($user, $userProfile)
101
    {
101
    {
102
        if($userProfile->image) {
102
        if($userProfile->image) {
103
            $remoto = $this->getPathUser() . '/' . $user->uuid . '/' .  $userProfile->image;
103
            $remoto = $this->getPathUser() . '/' . $user->uuid . '/' .  $userProfile->image;
104
            if($this->s3Files->objectExist($remoto)) {
104
            if($this->s3Files->objectExist($remoto)) {
105
                $s = $this->s3Files->getPresignedUrl($remoto);
105
                return $this->s3Files->getPresignedUrl($remoto);
106
                return str_replace('http://', 'https://', $s);
-
 
-
 
106
                
107
            }
107
            }
108
        }
108
        }
Línea 109... Línea 109...
109
        
109
        
110
        $remoto = $this->config['leaderslinked.images_default.user_profile'];
110
        $remoto = $this->config['leaderslinked.images_default.user_profile'];
111
        $s = $this->s3Files->getPresignedUrl($remoto);
-
 
-
 
111
        return $this->s3Files->getPresignedUrl($remoto);
112
        return str_replace('http://', 'https://', $s);
112
        
Línea 113... Línea 113...
113
    }
113
    }
114
    
114
    
115
    /**
115
    /**
Línea 121... Línea 121...
121
    public function getUserProfileCover($user, $userProfile)
121
    public function getUserProfileCover($user, $userProfile)
122
    {
122
    {
123
        if($userProfile->cover) {
123
        if($userProfile->cover) {
124
            $remoto = $this->getPathUser() . '/' . $user->uuid . '/' .  $userProfile->cover;
124
            $remoto = $this->getPathUser() . '/' . $user->uuid . '/' .  $userProfile->cover;
125
            if($this->s3Files->objectExist($remoto)) {
125
            if($this->s3Files->objectExist($remoto)) {
126
                $s = $this->s3Files->getPresignedUrl($remoto);
126
                return $this->s3Files->getPresignedUrl($remoto);
127
                return str_replace('http://', 'https://', $s);
-
 
-
 
127
                
128
            }
128
            }
129
        }
129
        }
Línea 130... Línea 130...
130
        
130
        
131
        $remoto = $this->config['leaderslinked.images_default.user_cover'];
131
        $remoto = $this->config['leaderslinked.images_default.user_cover'];
132
        $s = $this->s3Files->getPresignedUrl($remoto);
-
 
-
 
132
        return $this->s3Files->getPresignedUrl($remoto);
133
        return str_replace('http://', 'https://', $s);
133
        
Línea 134... Línea 134...
134
    }
134
    }
135
    
135
    
136
    /**
136
    /**
Línea 141... Línea 141...
141
    public function getCompanyImage($company)
141
    public function getCompanyImage($company)
142
    {
142
    {
143
        if($company->image) {
143
        if($company->image) {
144
            $remoto = $this->getPathCompany() . '/' . $company->uuid . '/' .  $company->image;
144
            $remoto = $this->getPathCompany() . '/' . $company->uuid . '/' .  $company->image;
145
            if($this->s3Files->objectExist($remoto)) {
145
            if($this->s3Files->objectExist($remoto)) {
146
                $s =  $this->s3Files->getPresignedUrl($remoto);
146
                return $this->s3Files->getPresignedUrl($remoto);
147
                return str_replace('http://', 'https://', $s);
-
 
-
 
147
                
148
            }
148
            }
149
        }
149
        }
Línea 150... Línea 150...
150
        
150
        
151
        $remoto = $this->config['leaderslinked.images_default.company_profile'];
151
        $remoto = $this->config['leaderslinked.images_default.company_profile'];
152
        $s = $this->s3Files->getPresignedUrl($remoto);
-
 
-
 
152
        return $this->s3Files->getPresignedUrl($remoto);
153
        return str_replace('http://', 'https://', $s);
153
        
Línea 154... Línea 154...
154
    }
154
    }
155
    
155
    
156
    /**
156
    /**
Línea 162... Línea 162...
162
    public function getCompanyImageForCodeAndFilename($code, $filename)
162
    public function getCompanyImageForCodeAndFilename($code, $filename)
163
    {
163
    {
164
        if($filename) {
164
        if($filename) {
165
            $remoto = $this->getPathCompany() . '/' . $code . '/' .  $filename;
165
            $remoto = $this->getPathCompany() . '/' . $code . '/' .  $filename;
166
            if($this->s3Files->objectExist($remoto)) {
166
            if($this->s3Files->objectExist($remoto)) {
167
                $s =  $this->s3Files->getPresignedUrl($remoto);
167
                return $this->s3Files->getPresignedUrl($remoto);
168
                return str_replace('http://', 'https://', $s);
-
 
-
 
168
                
169
            }
169
            }
170
        }
170
        }
Línea 171... Línea 171...
171
        
171
        
172
        $remoto = $this->config['leaderslinked.images_default.company_profile'];
172
        $remoto = $this->config['leaderslinked.images_default.company_profile'];
173
        $s = $this->s3Files->getPresignedUrl($remoto);
-
 
-
 
173
        return $this->s3Files->getPresignedUrl($remoto);
174
        return str_replace('http://', 'https://', $s);
174
        
Línea 175... Línea 175...
175
    }
175
    }
176
    
176
    
177
    /**
177
    /**
Línea 182... Línea 182...
182
    public function getCompanyCover($company)
182
    public function getCompanyCover($company)
183
    {
183
    {
184
        if($company->cover) {
184
        if($company->cover) {
185
            $remoto = $this->getPathCompany() . '/' . $company->uuid . '/' .  $company->cover;
185
            $remoto = $this->getPathCompany() . '/' . $company->uuid . '/' .  $company->cover;
186
            if($this->s3Files->objectExist($remoto)) {
186
            if($this->s3Files->objectExist($remoto)) {
187
                $s = $this->s3Files->getPresignedUrl($remoto);
187
                return $this->s3Files->getPresignedUrl($remoto);
188
                return str_replace('http://', 'https://', $s);
-
 
-
 
188
                
189
            }
189
            }
190
        }
190
        }
Línea 191... Línea 191...
191
        
191
        
192
        $remoto = $this->config['leaderslinked.images_default.company_cover'];
192
        $remoto = $this->config['leaderslinked.images_default.company_cover'];
193
        $s = $this->s3Files->getPresignedUrl($remoto);
-
 
-
 
193
        return $this->s3Files->getPresignedUrl($remoto);
194
        return str_replace('http://', 'https://', $s);
194
        
Línea 195... Línea 195...
195
    }
195
    }
196
    
196
    
197
    /**
197
    /**
Línea 202... Línea 202...
202
    public function getGroupImage($group)
202
    public function getGroupImage($group)
203
    {
203
    {
204
        if($group->image) {
204
        if($group->image) {
205
            $remoto = $this->getPathGroup() . '/' . $group->uuid . '/' .  $group->image;
205
            $remoto = $this->getPathGroup() . '/' . $group->uuid . '/' .  $group->image;
206
            if($this->s3Files->objectExist($remoto)) {
206
            if($this->s3Files->objectExist($remoto)) {
207
                $s = $this->s3Files->getPresignedUrl($remoto);
207
                return $this->s3Files->getPresignedUrl($remoto);
208
                return str_replace('http://', 'https://', $s);
-
 
-
 
208
                
209
            }
209
            }
210
        }
210
        }
Línea 211... Línea 211...
211
        
211
        
212
        $remoto = $this->config['leaderslinked.images_default.group_profile'];
212
        $remoto = $this->config['leaderslinked.images_default.group_profile'];
213
        $s =  $this->s3Files->getPresignedUrl($remoto);
-
 
-
 
213
        return $this->s3Files->getPresignedUrl($remoto);
214
        return str_replace('http://', 'https://', $s);
214
        
Línea 215... Línea 215...
215
    }
215
    }
216
    
216
    
217
    /**
217
    /**
Línea 223... Línea 223...
223
    public function getGroupImageForCodeAndFilename($code, $filename)
223
    public function getGroupImageForCodeAndFilename($code, $filename)
224
    {
224
    {
225
        if($filename) {
225
        if($filename) {
226
            $remoto = $this->getPathGroup() . '/' . $code . '/' .  $filename;
226
            $remoto = $this->getPathGroup() . '/' . $code . '/' .  $filename;
227
            if($this->s3Files->objectExist($remoto)) {
227
            if($this->s3Files->objectExist($remoto)) {
228
                $s = $this->s3Files->getPresignedUrl($remoto);
228
                return $this->s3Files->getPresignedUrl($remoto);
229
                return str_replace('http://', 'https://', $s);
-
 
-
 
229
                
230
            }
230
            }
231
        }
231
        }
Línea 232... Línea 232...
232
        
232
        
233
        $remoto = $this->config['leaderslinked.images_default.group_profile'];
233
        $remoto = $this->config['leaderslinked.images_default.group_profile'];
234
        $s = $this->s3Files->getPresignedUrl($remoto);
-
 
-
 
234
        return $this->s3Files->getPresignedUrl($remoto);
235
        return str_replace('http://', 'https://', $s);
235
        
Línea 236... Línea 236...
236
    }
236
    }
237
    
237
    
238
    /**
238
    /**
Línea 243... Línea 243...
243
    public function getGroupCover($group)
243
    public function getGroupCover($group)
244
    {
244
    {
245
        if($group->cover) {
245
        if($group->cover) {
246
            $remoto = $this->getPathGroup() . '/' . $group->uuid . '/' .  $group->cover;
246
            $remoto = $this->getPathGroup() . '/' . $group->uuid . '/' .  $group->cover;
247
            if($this->s3Files->objectExist($remoto)) {
247
            if($this->s3Files->objectExist($remoto)) {
248
                $s = $this->s3Files->getPresignedUrl($remoto);
248
                return $this->s3Files->getPresignedUrl($remoto);
249
                return str_replace('http://', 'https://', $s);
-
 
-
 
249
                
250
            }
250
            }
251
        }
251
        }
Línea 252... Línea 252...
252
        
252
        
253
        $remoto = $this->config['leaderslinked.images_default.group_cover'];
253
        $remoto = $this->config['leaderslinked.images_default.group_cover'];
254
        $s = $this->s3Files->getPresignedUrl($remoto);
-
 
-
 
254
        return $this->s3Files->getPresignedUrl($remoto);
255
        return str_replace('http://', 'https://', $s);
255
        
Línea 256... Línea 256...
256
    }
256
    }
257
    
257
    
258
    /**
258
    /**
Línea 262... Línea 262...
262
     */
262
     */
263
    public function getGenericImage($path, $code, $filename)
263
    public function getGenericImage($path, $code, $filename)
264
    {
264
    {
265
        $remoto = $path . '/' . $code. '/' .  $filename;
265
        $remoto = $path . '/' . $code. '/' .  $filename;
266
        if($this->s3Files->objectExist($remoto)) {
266
        if($this->s3Files->objectExist($remoto)) {
267
            $s = $this->s3Files->getPresignedUrl($remoto);
267
            return $this->s3Files->getPresignedUrl($remoto);
268
            return str_replace('http://', 'https://', $s);
-
 
-
 
268
            
269
        } else {
269
        } else {
270
            $remoto = $this->config['leaderslinked.images_default.no_image'];
270
            $remoto = $this->config['leaderslinked.images_default.no_image'];
271
            $s = $this->s3Files->getPresignedUrl($remoto);
271
            return $this->s3Files->getPresignedUrl($remoto);
272
            return str_replace('http://', 'https://', $s);
-
 
-
 
272
            
273
        }
273
        }
274
    }
274
    }
Línea 275... Línea 275...
275
    
275
    
276
    /**
276
    /**
Línea 280... Línea 280...
280
     */
280
     */
281
    public function getGenericFile($path, $code, $filename)
281
    public function getGenericFile($path, $code, $filename)
282
    {
282
    {
283
        $remoto = $path . '/' . $code. '/' .  $filename;
283
        $remoto = $path . '/' . $code. '/' .  $filename;
284
        if($this->s3Files->objectExist($remoto)) {
284
        if($this->s3Files->objectExist($remoto)) {
285
            $s = $this->s3Files->getPresignedUrl($remoto);
285
            return $this->s3Files->getPresignedUrl($remoto);
286
            return str_replace('http://', 'https://', $s);
-
 
-
 
286
            
287
        } else {
287
        } else {
288
            return;
288
            return;
289
        }
289
        }
290
    }
290
    }