Exemplo n.º 1
0
            } else {
                // Delete software entry
                $query = "DELETE FROM `web_software` WHERE `software_id` = ?";
                exec_query($query, $sw_id);
                set_page_message(tr('Could not upload file.'), 'error');
                $upload = 0;
            }
        }
        if ($upload == 1) {
            $tpl->assign(array('VAL_WGET' => '', 'SW_INSTALLED' => ''));
            send_request();
            set_page_message(tr('File successfully uploaded.'), 'success');
        } else {
            $tpl->assign('VAL_WGET', $sw_wget);
        }
    } else {
        $tpl->assign('VAL_WGET', $_POST['sw_wget']);
    }
} else {
    unset($_SESSION['software_upload_token']);
    $tpl->assign('VAL_WGET', '');
}
$tpl->assign('TR_PAGE_TITLE', tr('Reseller / General / Software Upload'));
$sw_cnt = get_avail_software_reseller($tpl, $_SESSION['user_id']);
$tpl->assign(array('TR_SOFTWARE_UPLOAD' => tr('Software upload'), 'GENERAL_INFO' => tr('General information'), 'TR_UPLOADED_SOFTWARE' => tr('Software available'), 'TR_SOFTWARE_NAME' => tr('Software-Synonym'), 'TR_SOFTWARE_VERSION' => tr('Software-Version'), 'TR_SOFTWARE_LANGUAGE' => tr('Language'), 'TR_SOFTWARE_STATUS' => tr('Software status'), 'TR_SOFTWARE_TYPE' => tr('Type'), 'TR_SOFTWARE_DELETE' => tr('Action'), 'TR_SOFTWARE_COUNT' => tr('Software total'), 'TR_SOFTWARE_NUM' => $sw_cnt, 'TR_UPLOAD_SOFTWARE' => tr('Software upload'), 'TR_SOFTWARE_DB' => tr('Requires Database?'), 'TR_SOFTWARE_DB_PREFIX' => tr('Database prefix'), 'TR_SOFTWARE_HOME' => tr('Link to authors homepage'), 'TR_SOFTWARE_DESC' => tr('Description'), 'SOFTWARE_UPLOAD_TOKEN' => generate_software_upload_token(), 'TR_SOFTWARE_FILE' => tr('Choose file (Max: %1$d MiB)', ini_get('upload_max_filesize')), 'TR_SOFTWARE_URL' => tr('or remote file (Max: %s)', bytesHuman($cfg->APS_MAX_REMOTE_FILESIZE)), 'TR_UPLOAD_SOFTWARE_BUTTON' => tr('Upload now'), 'TR_UPLOAD_SOFTWARE_PAGE_TITLE' => tr('i-MSCP - Sofware Management'), 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete this package?'), 'TR_MESSAGE_INSTALL' => tr('Are you sure to install this package from the webdepot?')));
generateNavigation($tpl);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();
Exemplo n.º 2
0
                $query = "DELETE FROM `web_software` WHERE `software_id` = ?";
                exec_query($query, $sw_id);
                set_page_message(tr('Could not upload file. File not found.'), 'error');
                $upload = 0;
            }
        }
        if ($upload == 1) {
            $tpl->assign(array('VAL_WGET' => ''));
            send_request();
            set_page_message(tr('File has been successfully uploaded.'), 'success');
        } else {
            $tpl->assign(array('VAL_WGET' => $sw_wget));
        }
    } else {
        $tpl->assign(array('VAL_WGET' => $_POST['sw_wget']));
    }
} else {
    unset($_SESSION['software_upload_token']);
    $tpl->assign(array('VAL_WGET' => ''));
}
$tpl->assign('TR_PAGE_TITLE', tr('Admin / Settings / Software Management'));
$sw_cnt = get_avail_software($tpl);
$swdepot_cnt = get_avail_softwaredepot($tpl);
$res_cnt = get_reseller_software($tpl);
$tpl->assign(array('TR_SOFTWARE_DEPOT' => tr('Software in repository'), 'SOFTWARE_UPLOAD_TOKEN' => generate_software_upload_token(), 'TR_SOFTWARE_ADMIN' => tr('Admin'), 'TR_SOFTWARE_RIGHTS' => tr('Permissions'), 'TR_SOFTWAREDEPOT_COUNT' => tr('Total Web software repositories'), 'TR_SOFTWAREDEPOT_NUM' => $swdepot_cnt, 'TR_UPLOAD_SOFTWARE' => tr('Software depot upload'), 'TR_SOFTWARE_FILE' => tr('Choose file (Max: %1$d MiB)', ini_get('upload_max_filesize')), 'TR_SOFTWARE_URL' => tr('or remote file (Max: %s)', bytesHuman($cfg->APS_MAX_REMOTE_FILESIZE)), 'TR_UPLOAD_SOFTWARE_BUTTON' => tr('Upload now'), 'TR_AWAITING_ACTIVATION' => tr('Awaiting activation'), 'TR_RESELLER_SOFTWARES_LIST' => tr('Reseller software list'), 'TR_SOFTWARE_NAME' => tr('Software name'), 'TR_SOFTWARE_VERSION' => tr('Version'), 'TR_SOFTWARE_LANGUAGE' => tr('Language'), 'TR_SOFTWARE_TYPE' => tr('Type'), 'TR_SOFTWARE_RESELLER' => tr('Reseller'), 'TR_SOFTWARE_IMPORT' => tr('Import in local repository'), 'TR_SOFTWARE_DOWNLOAD' => tr('Download'), 'TR_SOFTWARE_ACTIVATION' => tr('Activate'), 'TR_SOFTWARE_DELETE' => tr('Delete'), 'TR_SOFTWARE_ACT_COUNT' => tr('Total software'), 'TR_SOFTWARE_ACT_NUM' => $sw_cnt, 'TR_RESELLER_NAME' => tr('Reseller'), 'TR_RESELLER_ACT_COUNT' => tr('Total reseller'), 'TR_RESELLER_ACT_NUM' => $res_cnt, 'TR_RESELLER_COUNT_SWDEPOT' => tr('Software in repository'), 'TR_RESELLER_COUNT_WAITING' => tr('Awaiting activation'), 'TR_RESELLER_COUNT_ACTIVATED' => tr('Activated software'), 'TR_RESELLER_SOFTWARE_IN_USE' => tr('Total installations'), 'TR_MESSAGE_ACTIVATE' => tr('Are you sure you want to activate this package?'), 'TR_MESSAGE_IMPORT' => tr('Are you sure you want to import this package into the local software repository?'), 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete this package?'), 'TR_MESSAGE_INSTALL' => tr('Are you sure you want to install this package from the Web software repository?'), 'TR_ADMIN_SOFTWARE_PAGE_TITLE' => tr('i-MSCP / Software Installer / Management'), 'TR_SOFTWARE_UPDLOAD' => tr('Software upload')));
generateNavigation($tpl);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onAdminScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();
unsetMessages();