Beruflich Dokumente
Kultur Dokumente
php
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 5.0.5 - Licence Number VBFZ48KZZQ
|| # ---------------------------------------------------------------- # ||
|| # Copyright 2000-2013 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 32878 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
global $phrasegroups, $specialtemplates, $vbphrase, $vbulletin;
$phrasegroups = array('logging');
$specialtemplates = array();
// ########################## REQUIRE BACK-END ############################
require_once(dirname(__FILE__) . '/global.php');
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
$vb5_config =& vB::getConfig();
// #############################################################################
print_cp_header($vbphrase['api_log']);
// #############################################################################
if (empty($_REQUEST['do']))
{
$_REQUEST['do'] = 'choose';
}
// ###################### Start view #######################
if ($_REQUEST['do'] == 'view' AND can_access_logs($vb5_config['SpecialUsers']['c
anviewadminlog'], 1, '<p>' . $vbphrase['control_panel_log_viewing_restricted'] .
'</p>'))
{
$vbulletin->input->clean_array_gpc('r', array(
'apiclientname'
=> vB_Cleaner::TYPE_NOHTML,
'userid'
=> vB_Cleaner::TYPE_INT,
'apiclientid'
=> vB_Cleaner::TYPE_INT,
'apiclientuniqueid' => vB_Cleaner::TYPE_STR,
'pagenumber'
=> vB_Cleaner::TYPE_INT,
'orderby'
=> vB_Cleaner::TYPE_STR,
'startdate'
=> vB_Cleaner::TYPE_UNIXTIME,
'enddate'
=> vB_Cleaner::TYPE_UNIXTIME
));
if ($vbulletin->GPC['perpage'] < 1)
{
$vbulletin->GPC['perpage'] = 15;
}
if ($vbulletin->GPC['pagenumber'] < 1)
{
$vbulletin->GPC['pagenumber'] = 1;
}
$startat = ($vbulletin->GPC['pagenumber'] - 1) * $vbulletin->GPC['perpag
e'];
$counter = vB::getDbAssertor()->getRow('fetchApiLogsCount', array(
'userid' => $vbulletin->GPC['userid'],
'apiclientid' => $vbulletin->GPC['apiclientid'],
'apiclientuniqueid' => $vbulletin->GPC['apiclientuniqueid'],
'apiclientname' => $vbulletin->GPC['apiclientname'],
'startdate' => $vbulletin->GPC['startdate'],
'enddate' => $vbulletin->GPC['enddate'],
));
$totalpages = ceil($counter['total'] / $vbulletin->GPC['perpage']);
if (!in_array($vbulletin->GPC['orderby'], array('user', 'clientname')))
{
$vbulletin->GPC['orderby'] = 'date';
}
$logs = vB::getDbAssertor()->getRows('fetchApiLogs', array(
'userid' => $vbulletin->GPC['userid'],
'apiclientid' => $vbulletin->GPC['apiclientid'],
'apiclientuniqueid' => $vbulletin->GPC['apiclientuniqueid'],
'apiclientname' => $vbulletin->GPC['apiclientname'],
'startdate' => $vbulletin->GPC['startdate'],
'enddate' => $vbulletin->GPC['enddate'],
'orderby' => $vbulletin->GPC['orderby'],
'startat' => $startat,
'perpage' => $vbulletin->GPC['perpage'],
));
if (count($logs))
{
if ($vbulletin->GPC['pagenumber'] != 1)
{
$prv = $vbulletin->GPC['pagenumber'] - 1;
$firstpage = "<input type=\"button\" class=\"button\" va
lue=\"« " . $vbphrase['first_page'] .
"\" tabindex=\"1\" oncli
ck=\"window.location='apilog.php?" . vB::getCurrentSession()->get('sessionurl')
.
"do=view&apiclientna
me=" . $vbulletin->GPC['apiclientname'] .
"&apiclientid=" . $v
bulletin->GPC['apiclientid'] .
"&u=" . $vbulletin->
GPC['userid'] .
"&pp=" . $vbulletin>GPC['perpage'] .
"&orderby=" . $vbull
etin->GPC['orderby'] .
"&page=1" .
"&startdate=" . $vbu
lletin->GPC['startdate'] .
"&enddate=" . $vbull
etin->GPC['enddate'] .
"'\"/>";
$prevpage = "<input type=\"button\" class=\"button\" val
ue=\"< " . $vbphrase['prev_page'] .
"\" tabindex=\"1\" onclick=\"win
dow.location='apilog.php?" . vB::getCurrentSession()->get('sessionurl') .
"do=view&apiclientname=" . $
vbulletin->GPC['apiclientname'] .
"&apiclientid=" . $vbulletin
->GPC['apiclientid'] .
"&u=" . $vbulletin->GPC['use
rid'] .
"&pp=" . $vbulletin->GPC['pe
rpage'] .
"&orderby=" . $vbulletin->GP
C['orderby'] .
"&page=$prv" .
"&startdate=" . $vbulletin->
GPC['startdate'] .
"&enddate=" . $vbulletin->GP
C['enddate'] .
"'\"/>";
}
if ($vbulletin->GPC['pagenumber'] != $totalpages)
{
$nxt = $vbulletin->GPC['pagenumber'] + 1;
$nextpage = "<input type=\"button\" class=\"button\" val
ue=\"" . $vbphrase['next_page'] .
" >\" tabindex=\"1\" onclick=
\"window.location='apilog.php?" .
vB::getCurrentSession()->get('se
ssionurl') .
"do=view&apiclientname=" . $
vbulletin->GPC['apiclientname'] .
"&apiclientid=" . $vbulletin
->GPC['apiclientid'] .
"&u=" . $vbulletin->GPC['use
rid'] .
"&pp=" . $vbulletin->GPC['pe
rpage'] .
"&orderby=" . $vbulletin->GP
C['orderby'] .
"&page=$nxt" .
"&startdate=" . $vbulletin->
GPC['startdate'] .
"&enddate=" . $vbulletin->GP
C['enddate'] .
"'\"/>";
$lastpage = "<input type=\"button\" class=\"button\" val
ue=\"" . $vbphrase['last_page'] .
" »\" tabindex=\"1\" oncli
ck=\"window.location='apilog.php?" . vB::getCurrentSession()->get('sessionurl')
.
"do=view&apiclientname=" . $
vbulletin->GPC['apiclientname'] .
"&apiclientid=" . $vbulletin
->GPC['apiclientid'] .
"&u=" . $vbulletin->GPC['use
rid'] .
"&pp=" . $vbulletin->GPC['pe
rpage'] .
"&orderby=" . $vbulletin->GP
C['orderby'] .
"&page=$totalpages" .
"&startdate=" . $vbulletin->
GPC['startdate'] .
"&enddate=" . $vbulletin->GP
C['enddate'] .
"'\"/>";
}
print_form_header('apilog', 'remove');
print_description_row(construct_link_code($vbphrase['restart'],
"apilog.php?" . vB::getCurrentSession()->get('sessionurl')), 0, 8, 'thead', vB_T
emplate_Runtime::fetchStyleVar('right'));
print_table_header(construct_phrase($vbphrase['api_log_viewer_pa
ge_x_y_there_are_z_total_log_entries'], vb_number_format($vbulletin->GPC['pagenu
mber']), vb_number_format($totalpages), vb_number_format($counter['total'])), 8)
;
$headings = array();
$headings[] = $vbphrase['id'];
$headings[] = $vbphrase['apiclientid'];
$headings[] = "<a href='apilog.php?" . vB::getCurrentSession()->
get('sessionurl') . "do=view&apiclientname=" . $vbulletin->GPC['apiclientnam
e'] . "&apiclientid=" . $vbulletin->GPC['apiclientid'] . "&u=" . $vbulle
tin->GPC['userid'] . "&pp=" . $vbulletin->GPC['perpage'] . "&orderby=cli
entname&page=" . $vbulletin->GPC['pagenumber'] . "&startdate=" . $vbulle
tin->GPC['startdate'] . "&enddate=" . $vbulletin->GPC['enddate'] . "' title=
'" . $vbphrase['order_by_clientname'] . "'>" . $vbphrase['apiclientname'] . "</a
>";
$headings[] = "<a href='apilog.php?" . vB::getCurrentSession()->
get('sessionurl') . "do=view&apiclientname=" . $vbulletin->GPC['apiclientnam
e'] . "&apiclientid=" . $vbulletin->GPC['apiclientid'] . "&u=" . $vbulle
tin->GPC['userid'] . "&pp=" . $vbulletin->GPC['perpage'] . "&orderby=use
r&page=" . $vbulletin->GPC['pagenumber'] . "&startdate=" . $vbulletin->G
PC['startdate'] . "&enddate=" . $vbulletin->GPC['enddate'] . "' title='" . $
vbphrase['order_by_username'] . "'>" . $vbphrase['username'] . "</a>";
$headings[] = "<a href='apilog.php?" . vB::getCurrentSession()->
get('sessionurl') . "do=view&apiclientname=" . $vbulletin->GPC['apiclientnam
e'] . "&apiclientid=" . $vbulletin->GPC['apiclientid'] . "&u=" . $vbulle
tin->GPC['userid'] . "&pp=" . $vbulletin->GPC['perpage'] . "&orderby=dat
e&page=" . $vbulletin->GPC['pagenumber'] . "&startdate=" . $vbulletin->G
PC['startdate'] . "&enddate=" . $vbulletin->GPC['enddate'] . "' title='" . $
vbphrase['order_by_date'] . "'>" . $vbphrase['date'] . "</a>";
$headings[] = $vbphrase['apimethod'];
$headings[] = $vbphrase['paramget'];
$headings[] = $vbphrase['ip_address'];
print_cells_row($headings, 1);
foreach ($logs as $log)
{
$cell = array();
$cell[] = $log['apilogid'];
$cell[] = "<a href=\"apilog.php?" . vB::getCurrentSessio
n()->get('sessionurl') . "do=viewclient&apiclientid=$log[apiclientid]\"><b>$
log[apiclientid]</b></a>";
}
}
// ###################### Start do prune log #######################
if ($_POST['do'] == 'doprunelog' AND can_access_logs($vb5_config['SpecialUsers']
['canpruneadminlog'], 0, '<p>' . $vbphrase['control_panel_log_pruning_permission
_restricted'] . '</p>'))
{
$vbulletin->input->clean_array_gpc('p', array(
'apiclientid' => vB_Cleaner::TYPE_INT,
'datecut'
=> vB_Cleaner::TYPE_INT
));
$conditions = array(
array('field' => 'dateline', 'value' => $vbulletin->GPC['datecut
'], 'operator' => 'LT'),
);
if ($vbulletin->GPC['apiclientid'])
{
$conditions[] = array('field' => 'apiclientid', 'value' => $vbul
letin->GPC['apiclientid'], 'operator' => 'EQ');
}
vB::getDbAssertor()->delete('apilog', $conditions);
print_stop_message2('pruned_control_panel_log_successfully', 'apilog', a
rray('do'=>'choose'));
}
// ###################### Start modify #######################
if ($_REQUEST['do'] == 'choose')
{
if (can_access_logs($vb5_config['SpecialUsers']['canviewadminlog'], 1))
{
$show_admin_log = true;
}
else
{
echo '<p>' . $vbphrase['control_panel_log_viewing_restricted'] .
'</p>';
}
if ($show_admin_log)
{
log_admin_action();
$clientnames = vB::getDbAssertor()->getRows('api_fetchclientname
s');
$clientnamelist = array('no_value' => $vbphrase['all_api_clients
']);
foreach ($clientnames as $clientname)
{
$clientnamelist["$clientname[clientname]"] = $clientname
['clientname'];
}
$users = vB::getDbAssertor()->getRows('api_fetchclientusers');
$userlist = array('-1' => $vbphrase['all_users']);
foreach ($users as $user)
{
sion_restricted'] . '</p>';
}
}
}
// ###################### Start view client #######################
if ($_REQUEST['do'] == 'viewclient')
{
$vbulletin->input->clean_array_gpc('r', array(
'apiclientid' => vB_Cleaner::TYPE_UINT
));
if (!$vbulletin->GPC['apiclientid']
OR
!($client = vB::getDbAssertor()->getRow('api_fetchclientbyid', a
rray('apiclientid' => $vbulletin->GPC['apiclientid']))))
{
print_stop_message2(array('invalidid', 'apiclientid'));
}
print_form_header('api', 'viewclient');
print_table_header($vbphrase['apiclient']);
print_label_row($vbphrase['apiclientid'], $client['apiclientid']);
print_label_row($vbphrase['apiclientname'], $client['clientname']);
print_label_row($vbphrase['apiclientversion'], $client['clientversion'])
;
print_label_row($vbphrase['apiclient_platformname'], $client['platformna
me']);
print_label_row($vbphrase['apiclient_platformversion'], $client['platfor
mversion']);
print_label_row($vbphrase['apiclient_uniqueid'], $client['uniqueid']);
print_label_row($vbphrase['apiclient_initialipaddress'], iif(!empty($cli
ent['initialipaddress']), "<a href=\"usertools.php?" . vB::getCurrentSession()->
get('sessionurl') . "do=doips&depth=2&ipaddress=$client[initialipaddress
]&hash=" . CP_SESSIONHASH . "\">$client[initialipaddress]</a>", " "));
print_label_row($vbphrase['apiclient_initialtime'], vbdate($vbulletin->o
ptions['dateformat'] . ' ' .$vbulletin->options['timeformat'], $client['dateline
']));
print_label_row($vbphrase['apiclient_lastactivity'], vbdate($vbulletin->
options['dateformat'] . ' ' .$vbulletin->options['timeformat'], $client['lastact
ivity']));
print_label_row($vbphrase['apiclient_clienthash'], $client['clienthash']
);
print_label_row($vbphrase['apiclient_secret'], $client['secret']);
print_label_row($vbphrase['apiclient_apiaccesstoken'], $client['apiacces
stoken']);
print_label_row($vbphrase['apiclient_remembereduser'], iif(!empty($clien
t['username']), "<a href=\"user.php?" . vB::getCurrentSession()->get('sessionurl
') . "do=edit&u=$client[userid]\"><b>$client[username]</b></a>", $vbphrase['
guest']));
print_table_footer();
}
echo '<p class="smallfont" align="center"><a href="#" onclick="js_open_help(\'ad
minlog\', \'restrict\', \'\');">' . $vbphrase['want_to_access_grant_access_to_th
is_script'] . '</a></p>';
print_cp_footer();
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 12:34, Sat Sep 28th 2013
|| # CVS: $RCSfile$ - $Revision: 32878 $
|| ####################################################################
\*======================================================================*/
?>