CUSTOM URL SHORT
This commit is contained in:
parent
850d09db8f
commit
24db2beab4
@ -50,6 +50,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
| my-controller/my-method -> my_controller/my_method
|
||||
*/
|
||||
$route['default_controller'] = 'welcome';
|
||||
$route['(short/:any)'] = 'welcome/short';
|
||||
$route['autenticadors'] = 'autenticador/index';
|
||||
$route['404_override'] = '';
|
||||
$route['translate_uri_dashes'] = FALSE;
|
||||
|
||||
@ -22,6 +22,29 @@ class Welcome extends CI_Controller {
|
||||
{
|
||||
$this->load->view('welcome_message');
|
||||
}
|
||||
|
||||
public function short()
|
||||
{
|
||||
$uri = $this->uri->segment(2);
|
||||
//echo $uri;
|
||||
$this->load->model('PD_Model');
|
||||
$this->load->library('AWS_S3');
|
||||
$room_info = $this->PD_Model->selectCustomRecords(array('*'),array('composition_id' => $uri),VIDEO_ROOM_INFO);
|
||||
if(count($room_info))
|
||||
{
|
||||
$pd_master_details = $this->PD_Model->getPDMasterDetails($room_info[0]['fk_pd_id']);
|
||||
$bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id'];
|
||||
$final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$uri.'.mp4';
|
||||
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+1 hour');
|
||||
// echo 'sdj';
|
||||
// die();
|
||||
header("Location: $singed_uri");
|
||||
}
|
||||
else
|
||||
{
|
||||
header('Location: https://google.com');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user