示例#1
0
文件: import.php 项目: r3-gis/EcoGIS
if (!$auth->hasPerm('IMPORT', 'CONFIG') && !$auth->hasPerm('IMPORT', 'ACNAME')) {
    die("PERMISSION DENIED\n");
}
if (file_exists(R3_APP_ROOT . 'lib/custom.um.php')) {
    require_once R3_APP_ROOT . 'lib/custom.um.php';
    $umDependenciesObj = getUmDependenciesObject();
} else {
    $umDependenciesObj = new R3UmDependenciesDefault();
}
$smarty->assign('umDependencies', $umDependenciesObj->get());
if (!isset($includeSmartyAssign) || $includeSmartyAssign === true) {
    require_once R3_WEB_ADMIN_DIR . 'smarty_assign.php';
}
$act = isset($_REQUEST['act']) ? $_REQUEST['act'] : null;
$fltdn_name = pageVar('fltdn_name', null, isset($_REQUEST['reset']), false, 'general');
$fltapp_code = pageVar('fltapp_code', null, isset($_REQUEST['reset']), false, 'general');
$vlu = array('fltdn_name' => $fltdn_name, 'fltapp_code' => $fltapp_code);
if ($act == 'import') {
    if ($auth->hasPerm('SHOW', 'ALL_DOMAINS') || $auth->hasPerm('SHOW', 'DOMAIN')) {
        $dn_name = $fltdn_name;
    } else {
        $dn_name = $auth->domain;
    }
    if ($auth->hasPerm('SHOW', 'ALL_APPLICATIONS') || $auth->hasPerm('SHOW', 'APPLICATION')) {
        $app_code = $fltapp_code;
    } else {
        $app_code = $auth->application;
    }
    $res = $auth->import($dn_name, $app_code, file_get_contents($_FILES['file']['tmp_name']));
    $smarty->assign('import_result', $res);
    //print_r($res);
示例#2
0
/** Ajax request */
if (defined('R3_USERMANAGER_RELATIVE_LINKS') && R3_USERMANAGER_RELATIVE_LINKS) {
    $url = basename(__FILE__);
    $p = strpos($_SERVER['REQUEST_URI'], '?');
    if ($p > 0) {
        $url .= substr($_SERVER['REQUEST_URI'], $p);
    }
} else {
    $url = R3_DOMAIN_URL . $_SERVER['REQUEST_URI'];
}
$url .= (strpos($url, '?') === false ? '?' : '&') . 'proxytime=' . md5(time());
$objAjax = new xajax($url);
$objAjax->registerExternalFunction('submitForm', 'domains_edit_ajax.php');
$objAjax->processRequests();
$smarty->assign('xajax_js_include', $objAjax->getJavascript(R3_JS_URL));
$order = pageVar('order', '1A', isset($_REQUEST['reset']));
/** filters */
$filter_where = '';
/** List table */
$table = new pSimpleTable("100%", 'grid');
$table->checkImage(false);
$table->addSimpleField(!isset($hdr['Name']) ? _('Nome') : $hdr['Name'], 'do_name', 'CALCULATED', null, array('visible' => true, 'sortable' => true, 'order_fields' => 'do_name, do_auth_type'));
$table->addSimpleField(!isset($hdr['Alias']) ? _('Alias') : $hdr['Alias'], 'do_alais', 'CALCULATED', null, array('visible' => true));
$table->addSimpleField(!isset($hdr['Applications']) ? _('Applicativi') : $hdr['Applications'], 'do_applications', 'CALCULATED', null, array('visible' => true));
$table->addSimpleField(!isset($hdr['action']) ? _('Azione') : $hdr['action'], '', 'LINK', 100);
$limit = max(10, $auth->getConfigValue('SETTINGS', 'ROW_COUNT', 10));
$pg = max(1, PageVar('pg', 1, isset($_REQUEST['reset'])));
$st = ($pg - 1) * $limit;
/** Get the users list */
$list = $auth->getDomainsList(array('fields' => 'dn_name as do_name, do_auth_type', 'order' => $table->getSQLOrder($order), 'offset' => $st, 'limit' => $limit), $tot);
$table_html = $table->CreateTableHeader($order);
示例#3
0
    die;
}
if (!$auth->hasPerm('SHOW', 'CONFIG')) {
    die("PERMISSION DENIED [SHOW/CONFIG]\n");
}
if (file_exists(R3_APP_ROOT . 'lib/custom.um.php')) {
    require_once R3_APP_ROOT . 'lib/custom.um.php';
    $umDependenciesObj = getUmDependenciesObject();
} else {
    $umDependenciesObj = new R3UmDependenciesDefault();
}
$smarty->assign('umDependencies', $umDependenciesObj->get());
$fltdn_name = pageVar('fltdn_name', null, isset($_REQUEST['reset']), false, 'general');
$fltapp_code = pageVar('fltapp_code', null, isset($_REQUEST['reset']), false, 'general');
$fltus_login = pageVar('fltus_login', null, isset($_REQUEST['reset']), false, 'general');
$fltsection = pageVar('fltsection', null, isset($_REQUEST['reset']), false, 'general');
/** Domains list */
$smarty->assign('dn_name_list', $auth->mkAssociativeArray($auth->getDomainsList(), 'DOMAIN'));
if (!$auth->hasPerm('SHOW', 'ALL_DOMAINS') && !$auth->hasPerm('SHOW', 'DOMAIN')) {
    $dn_name = $auth->domain;
} else {
    $dn_name = $fltdn_name;
}
/** Applications list */
$smarty->assign('app_code_list', $auth->mkAssociativeArray($auth->getApplicationsList(array('order' => 'app_name')), 'APPLICATION'));
if (!$auth->hasPerm('SHOW', 'ALL_APPLICATIONS') && !$auth->hasPerm('SHOW', 'APPLICATION')) {
    $app_code = $auth->application;
} else {
    $app_code = $fltapp_code;
}
/** Users list */
示例#4
0
文件: export.php 项目: r3-gis/EcoGIS
        }
        if ($ac_verb != '') {
            $fileName .= '_' . $ac_verb;
        }
        if ($ac_name != '') {
            $fileName .= '_' . $ac_name;
        }
        if ($ac_type != '') {
            $fileName .= '_' . $ac_type;
        }
    } else {
        if ($what == 'GROUP') {
            if (!$auth->hasPerm('EXPORT', 'GROUP')) {
                die("PERMISSION DENIED\n");
            }
            $app_code = pageVar('fltapp_code', null, false, false, 'general');
            $expgroup = initVar('expgroup');
            if ($expgroup != '') {
                list($app_code, $expgroup) = explode('|', $expgroup);
            }
            $data = $auth->exportGroup($app_code == '' ? null : $app_code, $expgroup == '' ? null : $expgroup, $auth->hasPerm('EXPORT', 'ACNAME'));
            $fileName = 'GROUP';
            if ($app_code != '') {
                $fileName .= '_' . $app_code;
            }
            if ($expgroup != '') {
                $fileName .= '_' . $expgroup;
            }
        }
    }
}