Proyectos de Subversion LeadersLinked - Services

Rev

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

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