PRESIGNED URL FOR USR_MGMT

This commit is contained in:
velz 2018-09-20 18:10:22 +05:30
parent c647c77f50
commit 2090086975
2 changed files with 23 additions and 20 deletions

View File

@ -67,7 +67,7 @@ class Entity_Management_Controller extends REST_Controller {
if($entity_id != '' || $entity_id != null) if($entity_id != '' || $entity_id != null)
{ {
if($entity['fk_entity_type_id'] == 2)// If New Entity is Lender(2) type then create a S3 bucket. if($entity['fk_entity_type_id'] == 2)// If New Entity is Lender(2) type, then create a S3 bucket for corresponding lender.
{ {
$bucket_name = 'lender'.$entity_id; $bucket_name = 'lender'.$entity_id;
$bucket_status = $this->aws_s3->createNewBucket($bucket_name); $bucket_status = $this->aws_s3->createNewBucket($bucket_name);

View File

@ -33,26 +33,29 @@ class User_Management_Model extends SPARQ_Model {
$result = $this->db->get()->result_array(); $result = $this->db->get()->result_array();
if($result['profilepic'] != '' || $result['profilepic'] != null) foreach($result as $key => $pics)
{
if($pics['profilepic'] != '' || $pics['profilepic'] != null)
{ {
$profilepics3path = ''; $profilepics3path = '';
if($result['fk_entity_id'] == 1) //1 means sine_edge Profile if($pics['fk_entity_id'] == 1) //1 means sine_edge Profile
{ {
$profilepics3path = 'sineedge/'.$result['profilepic']; $profilepics3path = 'sineedge/'.$pics['profilepic'];
} }
else if($result['fk_entity_id'] == 2)//1 means lender Profile else if($pics['fk_entity_id'] == 2)//1 means lender Profile
{ {
$profilepics3path = 'lender/'.$result['profilepic']; $profilepics3path = 'lender/'.$pics['profilepic'];
} }
else // else or 3 means vendor Profile else // else or 3 means vendor Profile
{ {
$profilepics3path = 'vendor/'.$result['profilepic']; $profilepics3path = 'vendor/'.$pics['profilepic'];
} }
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI(PROFILE_PICTURE_BUCKET_NAME, $profilepics3path,'+5 mintues'); $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI(PROFILE_PICTURE_BUCKET_NAME, $profilepics3path,'+5 minutes');
$result['profilepic_singed_url'] = $singed_uri; $result[$key]['profilepic_singed_url'] = $singed_uri;
} }
}
if($result != '' ){ if($result != '' ){