Afficher la pageAnciennes révisionsLiens de retourHaut de page Cette page est en lecture seule. Vous pouvez afficher le texte source, mais ne pourrez pas le modifier. Contactez votre administrateur si vous pensez qu'il s'agit d'une erreur. <php> if ($_SERVER['PHP_AUTH_USER'] != 'jeff' && $_SERVER['PHP_AUTH_USER'] != 'marina' ) { die('no rights to read this page'); } </php> ==== NAS : rsync Logs ==== <phpwikify> // if(!defined('DOKU_INC')) define('DOKU_INC', dirname(__FILE__).'/'); require_once (DOKU_INC.'dev/tools.php'); $br = " \\\\ \n"; $d = "../save_log"; if ( array_key_exists('excl', $_GET) ) { echo "write excl file \n\n"; writePagesFile('dev/data.txt', $_GET['excl']); } $excl = readPagesFile('dev/data.txt'); // if ( array_key_exists('excl', $_GET) && ($_GET['excl']!='') ) { $excl = '&excl='.urlencode($_GET['excl']); } // urlencode($v) function createDirTab($d) { $br = " \\\\ \n"; echo "Dir = ".$d.$br; $dir = scandir($d); echo "| date | ext | view | load |\n"; foreach ($dir as $key => $v) { $totpath = $d."/".$v; if (is_dir($totpath)) continue; $ext = strtolower(strrchr($v, '.')); $stat = stat($totpath); echo '| '. date('Y-m-d H:i:s', $stat['mtime']) .' '; echo '| '.$ext.' '; echo '| [['.getUrl().getDokuScript().'?id='.getDokuID().'&file='.urlencode($v).'|'.htmlspecialchars($v).']] '; echo '| [['.getUrl().'/'.$totpath.'|'.htmlspecialchars($v).']] '; echo "|\n"; } echo "\n\n"; } $excl_arr = array(); if ($excl != '') { $excl_arr = explode("\n", $excl); foreach ($excl_arr as $k => & $v) { $v = rtrim($v); // echo " * ".$k." ---> [".$v."]\n"; } } function isExcluded( $s, $excl_arr ) { foreach ($excl_arr as $k => $v) { if ($v[0]== '/') { if (substr_compare('/'.$s, $v, 0, strlen($v)) === 0) return true; } elseif ($v[0]== '@') { // '@^("/\*,/)(.+)(/\*,/)(.+)(/\*,/)(.*)(/\*,/")@' if (preg_match($v, '/'.$s, $matches) === 1) { return true; } } } return false; } if ( !array_key_exists('file', $_GET) ) { createDirTab($d); } else { // echo '[['.getUrl().getDokuScript().'?id='.getDokuID().'|retour à la liste]]'.$br."\n\n"; echo '[['.getDokuID().'|retour à la liste]]'.$br."\n\n"; $totpath = $d."/".$_GET['file']; echo "file path = ".$totpath.$br; $h = @fopen($totpath, 'r'); $intab = false; while ( ($line = fgets($h, 4096)) !== false ) { if (preg_match('@^("/\*,/)(.+)(/\*,/)(.+)(/\*,/)(.*)(/\*,/")@', $line, $matches) === 1) { if (!$intab) { echo "\n"; $intab=true; } if (!isExcluded($matches[4], $excl_arr)) { echo "| [".$matches[2]."] | ".$matches[4]." | ".$matches[6]." |\n"; } } else { if ($intab) { echo "\n"; $intab=false; } echo " " . $line; } } @fclose($h); echo "\n\n"; } </phpwikify> <PHP> $br = " \\\\ \n"; $excl = readPagesFile('dev/data.txt'); echo "<div class='form-group'>\n"; echo "<label for='comment'>Exclusions:</label>\n"; echo "<textarea class='form-control' rows='5' form='usrform' name='excl'>".htmlspecialchars($excl)."</textarea>\n"; echo "<form action='".getDokuScript()."' method='get' id='usrform'>\n"; echo "<input type='hidden' name='id' value='".getDokuID()."'>\n"; echo "<input type='submit' value='Valider'>\n"; // style="position:relative;left:10" echo "</form>\n"; echo "</div>\n"; </PHP> ~~NOCACHE~~ syst/rs_log.txt Dernière modification : 2018/11/01 00:14de 127.0.0.1