Hacked By AnonymousFox

Current Path : /home/missmand/public_html/learning/old/main/formation/
Upload File :
Current File : /home/missmand/public_html/learning/old/main/formation/upload.php

<?php
/* For licensing terms, see /license.txt */

/**
* @author Batiste Roger <batiste.roger@live.fr>
* @package chamilo.formation
*/

// Requires
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'userportal.lib.php';
require_once 'utils.php';
require_once 'turbomedia.php';

define ('TURBO_PATH', api_get_path(SYS_PATH) . 'main/formation/turbomedia');

// Protect script
api_block_anonymous_users();

// Test user type
require_once(api_get_path(SYS_PATH) . 'main/subrole/subrole.php');
$role = get_subrole(api_get_user_id());

try {
    if (isset($_FILES['turbo']) && isset($_POST['turboname'])) {
        $upload_attempt = true;
        turbo_create();
    } elseif (isset($_POST['c_id']) && isset($_POST['lp_id']) && isset($_POST['item_id'])) {
        $res = turbo_view($_POST['c_id'], $_POST['lp_id'], $_POST['item_id']);
        echo $res;
        exit;
    } elseif (isset($_POST['videoname']) && isset($_POST['videoid'])) {
        $upload_attempt = true;
        // echo $_POST['videoname'] . " " . $_POST['videoid']; exit;
        video_create($_POST['videoname'], $_POST['videoid']);
    } elseif (isset($_POST['c_id']) && isset($_POST['video_id'])) {
        video_view($_POST['c_id'], $_POST['video_id']);
        exit;
    }
} catch (Exception $e) {
    $error_message = $e->getMessage();
    $error = $error_message;
    error_log($error_message);
}

// Display errors without displaying screen if no upload was attempted
if (!isset($upload_attempt) && isset($error)) {
    echo $error; exit;
}

// Create the index controller
$header_title = "Upload";
$controller = new IndexManager($header_title);

$controller->tpl->assign('part', 'formation');
$controller->tpl->assign('my_user_id', api_get_user_id());
$controller->tpl->assign('my_subrole', $role);
$controller->tpl->assign('is_admin', $role == ADMIN);
$controller->tpl->assign('web_path', api_get_path(WEB_PATH));
$controller->tpl->assign('type', $_GET['type']);

// Info about uploaded ones
if (isset($error))          $controller->tpl->assign('error', $error);
if (isset($upload_attempt)) $controller->tpl->assign('upload_attempt', $upload_attempt);

// Call to formation's template
$tpl = $controller->tpl->get_template('layout/mm_course_upload.tpl');
$controller->tpl->display($tpl);

Hacked By AnonymousFox1.0, Coded By AnonymousFox