Beispiel #1
0
$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);
foreach ($list as $value) {
    // Get the lockup data
    $data = $auth->getDomainData($value['do_name'], true);
    $table->addCalcValue('do_name', $data['names'][0]);
    /** The 1st element is the name, the others are alias) */
    // Alias
    $alias = array();
    for ($i = 1; $i < count($data['names']); $i++) {
        $alias[] = $data['names'][$i];
    }
    $s = implode(', ', $alias);
    $table->addCalcValue('do_alais', $s, $s);
    // Applications
    $apps = array();
Beispiel #2
0
    $acTypeList = null;
}
$smarty->assign('ac_type_list', $acTypeList);
/** List table */
$table = new pSimpleTable("100%", 'grid');
$table->checkImage(false);
$table->addSimpleField(!isset($hdr['Applicatione']) ? _('Applicativo') : $hdr['Applicatione'], 'app_name', 'STRING', 150, array('visible' => true, 'sortable' => true, 'order_fields' => 'app_name, ac_verb, ac_name'));
$table->addSimpleField(!isset($hdr['Verbo']) ? _('Verbo') : $hdr['Verbo'], 'ac_verb', 'STRING', 150, array('visible' => true, 'sortable' => true, 'order_fields' => 'ac_verb, ac_name, app_name'));
$table->addSimpleField(!isset($hdr['Oggetto']) ? _('Oggetto') : $hdr['Oggetto'], 'ac_name', 'STRING', 150, array('visible' => true, 'sortable' => true, 'order_fields' => 'ac_name, app_name, ac_verb'));
$table->addSimpleField(!isset($hdr['Descrizione']) ? _('Descrizione') : $hdr['Descrizione'], 'ac_descr', 'STRING', null, array('visible' => true, 'sortable' => true, 'order_fields' => 'ac_descr, app_name, ac_verb, ac_name'));
$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;
//SS: Prende campi di altre tabelle
$sql2 = "SELECT user_manager.*, COUNT(gat.ac_id) AS gr_tot, COUNT(uat.ac_id) AS us_tot \n" . "FROM <SQL> \n" . "LEFT JOIN " . $auth_options['groups_acl_table'] . " gat ON user_manager.ac_id=gat.ac_id \n" . "LEFT JOIN " . $auth_options['users_acl_table'] . " uat ON user_manager.ac_id=uat.ac_id \n" . "GROUP BY user_manager.ac_id, app_name, app_code, ac_verb, ac_name, ac_type, ac_active, ac_descr \n" . "ORDER BY " . $table->getSQLOrder();
$list = $auth->getACNamesList($fltapp_code, array('fields' => 'ac_id, app_name, app_code, ac_verb, ac_name, ac_type, ac_active, ac_descr', 'offset' => $st, 'limit' => $limit, 'sql' => $sql2, 'where' => $filter_where), $tot);
$table_html = $table->CreateTableHeader($order);
foreach ($list as $value) {
    $links = array();
    $canMod = $auth->hasPerm('MOD', 'ACNAME') || $auth->hasPerm('MOD', 'ALL_ACNAME');
    $canDel = $auth->hasPerm('DEL', 'ACNAME') || $auth->hasPerm('DEL', 'ALL_ACNAME');
    $params = "app_code={$value['app_code']}&ac_verb={$value['ac_verb']}&ac_name={$value['ac_name']}&";
    $defAct = "acnames_edit.php?act=show&{$params}";
    $links[] = $table->AddLinkCell(!isset($hdr['visualizza']) ? _('Visualizza') : $hdr['visualizza'], $defAct, '', R3_ICONS_URL . 'ico_view.gif');
    if ($canMod) {
        $defAct = "acnames_edit.php?act=mod&{$params}";
        $links[] = $table->AddLinkCell(!isset($hnt['edit']) ? _('Modifica') : $hnt['edit'], $defAct, '', R3_ICONS_URL . 'ico_edit.gif');
    } else {
        $links[] = $table->AddLinkCell('', '', '', R3_ICONS_URL . 'ico_spacer.gif');
    }
Beispiel #3
0
    //SS: verificare permission
    $table->addSimpleField(!isset($hdr['Applications']) ? _('Applicazioni') : $hdr['Applications'], 'applications', 'CALCULATED', 200, array('visible' => true, 'align' => 'left', 'sortable' => true, 'order_fields' => 'us_name, us_login, us_id asc'));
}
if ($auth->getConfigValue('USER_MANAGER', 'SHOW_AUTH_SETTINGS') == 'T' || count($authSettings['auth_settings']) > 0 && $auth->getConfigValue('USER_MANAGER', 'SHOW_AUTH_SETTINGS') != 'F') {
    $table->addSimpleField(_('Autenticazione'), 'as_name', 'STRING', 90, array('visible' => true, 'align' => 'center', 'sortable' => true, 'order_fields' => 'as_name, us_id asc'));
    $group_join = " LEFT JOIN {$auth_options['auth_settings_table']} ON {$auth_options['users_table']}.as_id={$auth_options['auth_settings_table']}.as_id ";
    $extraFields .= ", COALESCE(as_name, 'Standard') AS as_name";
    $extraGroupFields .= ", as_name";
}
if ($auth->getConfigValue('USER_MANAGER', 'SHOW_STATUS') != 'F') {
    $table->addSimpleField(!isset($hdr['Stato']) ? _('Stato') : $hdr['Stato'], 'status', 'CALCULATED', 90, array('visible' => true, 'align' => 'center', 'sortable' => true, 'order_fields' => 'us_login, us_id asc'));
}
$table->addSimpleField(!isset($hdr['action']) ? _('Azione') : $hdr['action'], '', 'LINK', 70);
/** Get the users list */
//SS: Prende campi di altre tabelle
$sql2 = "SELECT user_manager.us_id, us_login, us_name, us_status, dn_name {$extraFields} \n" . "FROM <SQL> \n" . "INNER JOIN " . $auth_options['users_table'] . " ON user_manager.us_id=" . $auth_options['users_table'] . ".us_id \n" . "INNER JOIN " . $auth_options['domains_name_table'] . " ON " . $auth_options['users_table'] . ".do_id=" . $auth_options['domains_name_table'] . ".do_id \n" . "{$group_join} \n" . "WHERE \n" . "  dn_type = 'N' AND \n" . "  {$group_where} \n" . "GROUP BY user_manager.us_id, us_login, us_name, us_status, dn_name {$extraGroupFields} \n " . "ORDER BY " . $table->getSQLOrder();
$performance_time[] = array('text' => 'Before getUsersList time: ', 'time' => microtime(true));
$list = $auth->getUsersList($fltdn_name, $fltapp_code, array('fields' => 'us_id', 'where' => $filter_where, 'offset' => $st, 'limit' => $limit, 'sql' => $sql2), $tot);
$performance_time[] = array('text' => 'After getUsersList time: ', 'time' => microtime(true));
$table_html = $table->CreateTableHeader($order);
$domain_applications = array();
/** cache the applications available for all the domains */
foreach ($list as $value) {
    if ($value['us_status'] == 'E') {
        $table->AddCalcValue('status', !isset($hdr['ENABLED']) ? _('ATTIVO') : $hdr['ENABLED']);
    } else {
        if ($value['us_status'] == 'D') {
            $table->AddCalcValue('status', !isset($hdr['DISABLED']) ? _('NON ATTIVO') : $hdr['DISABLED']);
        } else {
            $table->AddCalcValue('status', _('ELIMINATO'));
        }
Beispiel #4
0
} catch (Exception $e) {
    echo "Generic error: " . $e->getMessage() . "\n";
}
/** List table */
$table = new pSimpleTable("100%", 'grid');
$table->checkImage(false);
$table->addSimpleField(!isset($hdr['CODE']) ? _('Codice') : $hdr['CODE'], 'app_name', 'STRING', 150, array('visible' => true, 'sortable' => true));
$table->addSimpleField(!isset($hdr['Name']) ? _('Nome') : $hdr['Name'], 'gr_name', 'STRING', 150, array('visible' => true, 'sortable' => true, 'sort_field' => 'app_name, gr_name'));
$table->addSimpleField(!isset($hdr['Privato']) ? _('Privato') : $hdr['Privato'], 'private', 'CALCULATED', 50, array('visible' => true, 'sortable' => true));
$table->addSimpleField(!isset($hdr['Description']) ? _('Descrizione') : $hdr['Description'], 'gr_descr', 'STRING', null, array('visible' => true, 'sortable' => 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;
//SS: Prende campi di altre tabelle
$sql2 = "SELECT user_manager.*, COUNT(ugt.gr_id) AS us_tot \n" . "FROM <SQL> \n" . "LEFT JOIN " . $auth_options['users_groups_table'] . " ugt ON user_manager.gr_id=ugt.gr_id \n" . "GROUP BY user_manager.gr_id, gr_name, gr_descr, do_id, app_code, app_name, dn_name  \n" . "ORDER BY " . $table->getSQLOrder();
/** Get the groups list */
$list = $auth->getGroupsList($fltapp_code, array('fields' => 'gr_id, gr_name, gr_descr, ' . $auth_options['groups_table'] . '.do_id, ' . 'app_code, app_name, dn_name', 'offset' => $st, 'limit' => $limit, 'sql' => $sql2), $tot);
$table_html = $table->CreateTableHeader($order);
foreach ($list as $value) {
    $table->addCalcValue('private', $value['do_id'] == '' ? '' : (!isset($hdr['Si']) ? _('Si') : $hdr['Si']));
    $links = array();
    $canMod = $auth->hasPerm('MOD', 'GROUP') || $auth->hasPerm('MOD', 'ALL_GROUP');
    $canDel = $auth->hasPerm('DEL', 'GROUP') || $auth->hasPerm('DEL', 'ALL_GROUP');
    $param = "code={$value['app_code']}&name={$value['gr_name']}&";
    $defAct = "groups_edit.php?act=show&{$param}";
    $links[] = $table->AddLinkCell(!isset($hdr['visualizza']) ? _('Visualizza') : $hdr['visualizza'], $defAct, '', R3_ICONS_URL . 'ico_view.gif');
    if ($canMod) {
        $defAct = "groups_edit.php?act=mod&{$param}";
        $links[] = $table->AddLinkCell(!isset($hnt['edit']) ? _('Modifica') : $hnt['edit'], $defAct, '', R3_ICONS_URL . 'ico_edit.gif');
    } else {
Beispiel #5
0
//$table->addSimpleField('log_id',                      'log_id',     'INTEGER',   60,   array('visible'=>true,'align'=>'right', 'sortable'=>true));//
$table->addSimpleField(!isset($hdr['logs_date']) ? _('Data/ora') : $hdr['logs_date'], 'log_time', 'DATETIME', 140, array('align' => 'center', 'sortable' => true, 'order_fields' => 'log_time, log_id'));
$table->addSimpleField(_('Tipo'), 'log_type', 'TEXT', 40, array('align' => 'center', 'sortable' => true, 'order_fields' => 'log_type, log_id'));
$table->addSimpleField(!isset($hdr["logs_login"]) ? _('Login') : $hdr["logs_login"], 'us_login', 'STRING', 100, array('visible' => true, 'align' => 'left', 'sortable' => true, 'order_fields' => 'us_login, log_id'));
//$table->addSimpleField('Nome',                        'us_name',    'STRING',    null, array('visible'=>true,'align'=>'left', 'sortable'=>true, 'order_fields'=>'us_name, us_login, log_id'));//
if ($fltdn_name == '' && $canShowDomains && $auth->getConfigValue('USER_MANAGER', 'SHOW_DOMAIN') != 'F') {
    $table->addSimpleField(!isset($hdr["logs_domain"]) ? _('Dominio') : $hdr["logs_domain"], 'dn_name', 'STRING', 150, array('visible' => true, 'align' => 'left', 'sortable' => true, 'order_fields' => 'dn_name, log_time, log_id'));
}
if ($fltapp_code == '' && $canShowApplications && $auth->getConfigValue('USER_MANAGER', 'SHOW_APPLICATION') != 'F') {
    $table->addSimpleField(!isset($hdr["logs_application"]) ? _('Applicazione') : $hdr["logs_application"], 'app_name', 'STRING', 150, array('visible' => true, 'align' => 'left', 'sortable' => true, 'order_fields' => 'app_name, log_time, log_id'));
}
$table->addSimpleField(!isset($hdr["logs_ip"]) ? _('IP') : $hdr["logs_ip"], 'log_ip', 'STRING', 100, array('visible' => true, 'align' => 'center', 'sortable' => true, 'order_fields' => 'log_ip, us_name, us_login, log_ip'));
$table->addSimpleField(!isset($hdr["logs_page"]) ? _('Pagina') : $hdr["logs_page"], 'log_page', 'STRING', null, array('visible' => true, 'align' => 'left', 'sortable' => true, 'order_fields' => 'log_page, us_name, us_login, log_ip'));
$table->addSimpleField(!isset($hdr["logs_note"]) ? _('Note') : $hdr["logs_note"], 'log_text', 'STRING');
$table_html = $table->CreateTableHeader($order);
$list = $auth->getLogList($fltdn_name, $fltapp_code, array('order' => $table->getSQLOrder($order), 'offset' => $st, 'where' => $filter_where, 'limit' => $fltlimit), $tot);
foreach ($list as $value) {
    $style = array();
    switch ($value['log_type']) {
        case 'C':
        case 'E':
            $style['normal'] = 'grid_error';
            $style['over'] = 'grid_error_over';
            break;
        case 'W':
            $style['normal'] = 'grid_warning';
            $style['over'] = 'grid_warning_over';
            break;
        case 'D':
            $style['normal'] = 'grid_debug';
            $style['over'] = 'grid_debug_over';
Beispiel #6
0
    $table->addSimpleField('UID', 'us_id', 'INTEGER', 60, array('visible' => true, 'align' => 'right', 'sortable' => true));
}
$table->addSimpleField(!isset($hdr['Login']) ? _('Login') : $hdr['Login'], 'us_login', 'STRING', 150, array('visible' => true, 'align' => 'left', 'sortable' => true));
$table->addSimpleField(!isset($hdr['Nome']) ? _('Nome') : $hdr['Nome'], 'us_name', 'STRING', null, array('visible' => true, 'align' => 'left', 'sortable' => true, 'order_fields' => 'us_name, us_login, us_id asc'));
if ($canShowDomains && $auth->getConfigValue('USER_MANAGER', 'SHOW_DOMAIN') != 'F') {
    //SS: verificare permission
    $table->addSimpleField(!isset($hdr['Domain']) ? _('Dominio') : $hdr['Domain'], 'dn_name', 'STRING', 100, array('visible' => true, 'align' => 'left', 'sortable' => true, 'order_fields' => 'us_name, us_login, us_id asc'));
}
$table->addSimpleField('IP', 'us_last_ip', 'STRING', 100, array('visible' => true, 'align' => 'center', 'sortable' => true, 'order_fields' => 'us_last_ip, us_name, us_login, us_id asc'));
$table->addSimpleField(!isset($hdr['login_time']) ? _('Ora login') : $hdr['login_time'], 'us_last_login', 'DATETIME', 150, array('visible' => true, 'align' => 'center', 'sortable' => true, 'order_fields' => 'us_last_login, us_name, us_login, us_id asc'));
$table->addSimpleField(!isset($hdr['last_login_time']) ? _('Ora ultima azione') : $hdr['last_login_time'], 'us_last_action', 'DATETIME', 150, array('visible' => true, 'align' => 'center', 'sortable' => true, 'order_fields' => 'us_last_action, us_last_login, us_name, us_login, us_id asc'));
if ($auth->hasPerm('DISCONNECT', 'USER')) {
    $table->addSimpleField(!isset($hdr['action']) ? _('Azione') : $hdr['action'], '', 'LINK', 20);
}
/** Get the users list */
$list = $auth->getConnectedUsersList(null, null, array('order' => $table->getSQLOrder(), 'offset' => $st, 'limit' => $limit), $tot);
$table_html = $table->CreateTableHeader($order);
foreach ($list as $value) {
    $links = array();
    $canDel = $auth->hasPerm('DISCONNECT', 'USER') && $value['us_id'] != $auth->getUID();
    if ($canDel) {
        $links[] = $table->AddLinkCell(!isset($hdr['Disconnetti']) ? _('Disconnetti') : $hdr['Disconnetti'], "JavaScript:askDisconnect('" . $value['dn_name'] . "', '" . $value['us_login'] . "')", '', R3_ICONS_URL . 'ico_disconnect.gif');
    } else {
        $links[] = $table->AddLinkCell('', '', '', R3_ICONS_URL . 'ico_spacer.gif');
    }
    $table_html .= $table->createTableRow($value, $links);
}
$table_html .= $table->MkTableFooter();
$navigationBar_html = $table->mkNavigationBar($pg, $tot, $limit);
$smarty->assign('tot', $tot);
$smarty->assign('table_html', $table_html);