72 lines
1.9 KiB
PHP
72 lines
1.9 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class Welcome extends CI_Controller {
|
|
|
|
/**
|
|
* Index Page for this controller.
|
|
*
|
|
* Maps to the following URL
|
|
* http://example.com/index.php/welcome
|
|
* - or -
|
|
* http://example.com/index.php/welcome/index
|
|
* - or -
|
|
* Since this controller is set as the default controller in
|
|
* config/routes.php, it's displayed at http://example.com/
|
|
*
|
|
* So any other public methods not prefixed with an underscore will
|
|
* map to /index.php/welcome/<method_name>
|
|
* @see https://codeigniter.com/user_guide/general/urls.html
|
|
*/
|
|
public function index()
|
|
{
|
|
$this->load->view('welcome_message');
|
|
}
|
|
|
|
public function short()
|
|
{
|
|
$data = $this->input->get('dat');
|
|
//echo $data;
|
|
|
|
$redirect_url = 'https://demo.pdgenie.com/error/404.html';
|
|
if($data)
|
|
{
|
|
|
|
// $uri = custom_encryption::encode($data);die();
|
|
$uri = custom_encryption::decode($data);
|
|
// echo $uri;
|
|
$uri = explode('/',$uri);
|
|
$video_name = $uri[0];
|
|
$date = $uri[1];
|
|
$is_expired = MYUTIL::isDateExpired($date,7);
|
|
if(!$is_expired)
|
|
{
|
|
|
|
$this->load->model('PD_Model');
|
|
$this->load->library('AWS_S3');
|
|
$room_info = $this->PD_Model->selectCustomRecords(array('*'),array('composition_id' => $video_name),VIDEO_ROOM_INFO);
|
|
//print_r($room_info);die();
|
|
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/'.$video_name.'.mp4';
|
|
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+2 hour');
|
|
$redirect_url = $singed_uri;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$redirect_url = 'https://demo.pdgenie.com/error/exp.html';
|
|
}
|
|
|
|
|
|
//echo $redirect_url;
|
|
header("Location: $redirect_url");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|