Beispiel #1
0
    }
    $s = implode(', ', $alias);
    $table->addCalcValue('do_alais', $s, $s);
    // Applications
    $apps = array();
    foreach ($data['applications'] as $val) {
        $apps[] = $val;
    }
    $s = implode(', ', $apps);
    $table->addCalcValue('do_applications', $s, $s);
    $links = array();
    $canMod = $auth->hasPerm('MOD', 'DOMAIN') || $auth->hasPerm('MOD', 'ALL_DOMAINS');
    $canDel = $auth->hasPerm('DEL', 'ALL_DOMAINS');
    //SS: DEL DOMAIN DOESN'T EXISTS
    $defAct = "domains_edit.php?act=show&name={$value['do_name']}";
    $links[] = $table->AddLinkCell('visualizza', $defAct, '', R3_ICONS_URL . 'ico_view.gif');
    if ($canMod) {
        $defAct = "domains_edit.php?act=mod&name={$value['do_name']}";
        $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');
    }
    if ($canDel) {
        $links[] = $table->AddLinkCell(!isset($hnt['delete']) ? _('Cancella') : $hnt['delete'], "JavaScript:askDel('" . $value['do_name'] . "')", '', R3_ICONS_URL . 'ico_del.gif');
    } else {
        $links[] = $table->AddLinkCell('', '', '', R3_ICONS_URL . 'ico_spacer.gif');
    }
    $table_html .= $table->createTableRow($value, $links, null, array('ondblclick' => "document.location='{$defAct}'"));
}
$table_html .= $table->MkTableFooter();
$navigationBar_html = $table->mkNavigationBar($pg, $tot, $limit);
Beispiel #2
0
$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);
$smarty->assign('navigationBar_html', $navigationBar_html);
$smarty->display('users/connected_users.tpl');