Example #1
0
// $Id$
// --------------------------------------------------------------
// D-Transport
// Manage files for download in XOOPS
// Author: Eduardo Cortés <*****@*****.**>
// Email: i.bitcero@gmail.com
// License: GPL 2.0
// --------------------------------------------------------------
if (!$mc['send_download']) {
    redirect_header(DT_URL, 2, __('Operation not allowed!', 'dtransport'));
    die;
}
$item = new DTSoftware();
//Verificamos si el usuario pertenece a un grupo con permisos de envío de descargas
if (!$item->isAllowedDowns($xoopsUser ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS, $mc['groups_send'])) {
    redirect_header(DT_URL, 2, __('You have not authorization to create download items', 'dtransport'));
    die;
}
switch ($action) {
    case 'saveedit':
    case 'save':
        $edit = $action == 'saveedit' ? 1 : 0;
        foreach ($_POST as $k => $v) {
            ${$k} = $v;
        }
        $app = 0;
        if ($edit) {
            //Verificamos si el elemento es válido
            if ($id <= 0) {
                redirect_header(DT_URL, 2, __('Item not found. Please try again!', 'dtransport'));