/* * MarkDoc * PHP MarkDown document manager * Hordé Nicolas * https://github.com/dahut87/MarkDoc * Release under GPLv3.0 license * Base on Pheditor "PHP file editor" By Hamid Samak Release under MIT license */ Mot de passe incorrect.'; $log = file_exists(LOG_FILE) ? unserialize(file_get_contents(LOG_FILE)) : array(); if (isset($log[$_SERVER['REMOTE_ADDR']]) === false) { $log[$_SERVER['REMOTE_ADDR']] = array('num' => 0, 'time' => 0); } $log[$_SERVER['REMOTE_ADDR']]['num'] += 1; $log[$_SERVER['REMOTE_ADDR']]['time'] = time(); file_put_contents(LOG_FILE, serialize($log)); } } else $content='

Aucun mot de passe renseigné !

'; } else $content='

Vous êtes déjà logué !

'; break; case 'children': print(json_encode(filesJSON(CONTENT_DIR,false))); exit; case 'allchildren': print(json_encode(filesJSON(CONTENT_DIR,true))); exit; case 'open': $file=urldecode($_POST['file']); if (substr($file,0,1)==":") print(specialurl($file)); else print(getcontent($file)); exit; case 'realopen': $file=urldecode($_POST['file']); print(getcontent($file,false)); exit; case 'save': $file=urldecode($_POST['file']); print(setcontent($file,$_POST['data'])); exit; case 'search': $results=searchstr(CONTENT_DIR,$_POST['search']); //print_r($results); $content="

Résultats de recherche

Il y a ".$results['totalFiles']." occurence(s) trouvée(s):

"; foreach($results['files'] as $key => $value) $content.='

'.$key.'

'.$value.'

'; if ($_POST['type']=="js") { print($content); exit; } } } else if (substr($file,0,1)==":") { $content=specialurl($file); } else if ($filedetail['extension']=="md") { $content=getcontent($file); } else if ($filedetail['extension']!="" && strpos(ALLOWED_EXT, $filedetail['extension']) !== false) { if (file_exists(CONTENT_DIR . $file)) { if ($filedetail['extension']=="css") header("Content-type: text/css"); print file_get_contents(CONTENT_DIR . $file); } else { http_response_code(404); $content=getcontent("/special/404.md"); } exit; } else { $content=getcontent("/special/404.md"); } ?> <?php echo TITLE; ?> ':''); ?> ':''); ?>
Documentations