Exemple #1
0
        $controller = new SP\Controller\ConfigC($tpl);
        $controller->getGeneralTab();
        $controller->getWikiTab();
        $controller->getLdapTab();
        $controller->getMailTab();
        $controller->getEncryptionTab();
        $controller->getBackupTab();
        $controller->getImportTab();
        $controller->getInfoTab();
        $tpl->addTemplate('tabs-end');
        break;
    case \SP\Controller\ActionsInterface::ACTION_EVL:
        $controller = new SP\Controller\EventlogC($tpl);
        $controller->getEventlog();
        break;
    case \SP\Controller\ActionsInterface::ACTION_USR_PREFERENCES:
    case \SP\Controller\ActionsInterface::ACTION_USR_PREFERENCES_GENERAL:
    case \SP\Controller\ActionsInterface::ACTION_USR_PREFERENCES_SECURITY:
        $tpl->addTemplate('tabs-start');
        $controller = new \SP\Controller\UsersPrefsC($tpl);
        $controller->getPreferencesTab();
        $controller->getSecurityTab();
        $tpl->addTemplate('tabs-end');
        break;
}
// Se comprueba si se debe de mostrar la vista de depuración
if (\SP\Session::getUserIsAdminApp() && SP\Config::getValue('debug')) {
    $controller->getDebug();
}
$tpl->addTemplate('js-common');
$controller->view();
Exemple #2
0
    die(_('CONSULTA INVÁLIDA'));
}
if (!SP\Util::fileIsEnabled()) {
    exit(_('Gestión de archivos deshabilitada'));
}
$action = SP\Request::analyze('action');
$accountId = SP\Request::analyze('accountId', 0);
$fileId = SP\Request::analyze('fileId', 0);
$log = new \SP\Log();
if ($action == 'upload') {
    if (!is_array($_FILES["inFile"]) || $accountId === 0) {
        \SP\Response::printJSON(_('CONSULTA INVÁLIDA'));
    }
    $log->setAction(_('Subir Archivo'));
    $allowedExts = strtoupper(SP\Config::getValue('files_allowed_exts'));
    $allowedSize = SP\Config::getValue('files_allowed_size');
    if ($allowedExts) {
        // Extensiones aceptadas
        $extsOk = explode(",", $allowedExts);
    } else {
        $log->addDescription(_('No hay extensiones permitidas'));
        $log->writeLog();
        \SP\Response::printJSON($log->getDescription());
    }
    if (is_array($_FILES) && $_FILES['inFile']['name']) {
        // Comprobamos la extensión del archivo
        $fileData['extension'] = strtoupper(pathinfo($_FILES['inFile']['name'], PATHINFO_EXTENSION));
        if (!in_array($fileData['extension'], $extsOk)) {
            $log->addDescription(_('Tipo de archivo no soportado') . " '" . $fileData['extension'] . "' ");
            $log->writeLog();
            \SP\Response::printJSON($log->getDescription());