Esempio n. 1
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());
Esempio n. 2
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();
Esempio n. 3
0
            if ($mailAuth) {
                SP\Config::setCacheConfigValue('mail_authenabled', $mailAuth);
                SP\Config::setCacheConfigValue('mail_user', $mailUser);
                SP\Config::setCacheConfigValue('mail_pass', $mailPass);
            }
            $Log->addDescription(_('Correo habiltado'));
        } else {
            SP\Config::setCacheConfigValue('mail_enabled', false);
            SP\Config::setCacheConfigValue('mail_requestsenabled', false);
            SP\Config::setCacheConfigValue('mail_authenabled', false);
            $Log->addDescription(_('Correo deshabilitado'));
        }
        $Log->addDescription(sprintf('%s: %s', _('Sección'), _('Correo')));
    }
    try {
        SP\Config::writeConfig();
    } catch (\SP\SPException $e) {
        $Log->addDescription($e->getMessage());
        $Log->addDescription($e->getHint());
        $Log->writeLog();
        SP\Response::printJSON($e->getMessage());
    }
    $Log->writeLog();
    SP\Email::sendEmail($Log);
    if ($actionId === SP\Controller\ActionsInterface::ACTION_CFG_GENERAL) {
        // Recargar la aplicación completa para establecer nuevos valores
        SP\Util::reload();
    }
    SP\Response::printJSON(_('Configuración actualizada'), 0, $doActionOnClose);
} elseif ($actionId === SP\Controller\ActionsInterface::ACTION_CFG_ENCRYPTION) {
    $currentMasterPass = SP\Request::analyzeEncrypted('curMasterPwd');