GlisWeb framework
_filesystem.permissions.php
Vai alla documentazione di questo file.
1 <?php
2 
14  // inclusione del framework
15  require '../../../_src/_config.php';
16 
17  // dati
18  $dati = array();
19 
20  // timer
22 
23  // directory da controllare
24  $dr = array_diff( glob( DIRECTORY_BASE . ( ( isset( $_REQUEST['dir'] ) ) ? $_REQUEST['dir'] : NULL ) . '*' ), array( '.', '..' ) );
25 
26  // lettura dati
27  foreach( $dr as &$d ) {
28  $p = posix_getpwuid( fileowner( $d ) );
29  $dati[] = array(
30  'path' => str_replace( DIRECTORY_BASE, NULL, $d ),
31  'owner' => $p['name'],
32  'permessi' => substr( sprintf( '%o', fileperms( $d ) ), -4 )
33  );
34  }
35 
36  // debug
37  // print_r( $dr );
38  // print_r( $dati );
39 
40 /*
41  // lettura dati
42  foreach( $dr as $d ) {
43  $d = str_replace( DIRECTORY_BASE, NULL, $d );
44  $s = getDirSize( $d );
45  $dir[ str_pad( $s, 20, 0, STR_PAD_LEFT ) . $d ] = array( 'dir' => $d, 'size' => writeByte( $s ) );
46  }
47 
48  // ordinamento
49  krsort( $dir );
50 
51  // header
52  buildContentHeader();
53 
54  // intestazione report
55  echo txtHeader( 'report spazio occupato' );
56 
57  // valutazione spazio directory
58  foreach( $dir as $d ) {
59 
60  echo txtData( $d['dir'], $d['size'] );
61 
62  }
63 
64  // totale
65  echo txtFullLine();
66  echo txtData( 'totale', writeByte( getDirSize( 'var' ) + getDirSize( 'tmp' ) ) );
67 
68  // chiusura report
69  echo txtDateTimeLine( '=' );
70 
71  // chiusura report
72  echo 'report generato in ' . timerDiff( $start ) . ' secondi' . PHP_EOL;
73 
74  // debug
75  // timer_debug( $t );
76 */
77 
78  // header
80 
81  // intestazione report
82  echo txtHeader( 'report permessi cartelle' );
83 
84  // corpo del report
85  if( count( $dati ) ) {
86  echo txtTable(
87  array( 'path' => 41, 'owner' => 20, 'permessi' => 20 ),
88  $dati,
89  array( 'path' => 'cartella', 'owner' => 'proprietario', 'permessi' => 'permessi' )
90  );
91  }
92 
93  // chiusura report
94  echo txtDateTimeLine( '=' );
95 
96  // chiusura report
97  echo 'report generato in ' . timerDiff( $start ) . ' secondi' . PHP_EOL;
98 
99 
100 ?>
buildContentHeader( $t=MIME_TEXT_PLAIN, $e=ENCODING_UTF8)
$p['ricerca']
timerDiff( $start=START_TIME, $now=NULL)
if(!empty($_REQUEST['id'])) $d
txtHeader( $t, $c='=', $w=REPORT_WIDTH)
Definition: _txt.tools.php:20
timerNow()
const DIRECTORY_BASE
Definition: _osm.php:3
txtTable( $h, $d, $l=NULL, $w=REPORT_WIDTH)
Definition: _txt.tools.php:74
txtDateTimeLine( $c='-', $d=NULL, $w=REPORT_WIDTH)
Definition: _txt.tools.php:48
$_REQUEST['__view__'][ $ct['view']['id']]['__restrict__']['id_progetto']['EQ']