when not admin, only show logs of the current user

This commit is contained in:
Robin 2010-05-22 23:26:40 +02:00
parent 7b08854f70
commit f83b387385
2 changed files with 7 additions and 3 deletions

View File

@ -1 +0,0 @@

View File

@ -60,8 +60,13 @@ class OC_LOG {
public static function show(){
global $CONFIG_DATEFORMAT;
echo('<div class="center"><table cellpadding="6" cellspacing="0" border="0" class="log">');
$result = OC_DB::select('select timestamp,user,type,message from log order by timestamp desc limit 20');
if(OC_USER::ingroup($_SESSION['username_clean'],'admin')){
$result = OC_DB::select('select timestamp,user,type,message from log order by timestamp desc limit 20');
}else{
$user=$_SESSION['username_clean'];
$result = OC_DB::select('select timestamp,user,type,message from log where user=\''.$user.'\' order by timestamp desc limit 20');
}
foreach($result as $entry){
echo('<tr class="browserline">');
echo('<td class="sizetext">'.date($CONFIG_DATEFORMAT,$entry['timestamp']).'</td>');