コード例 #1
0
 public static function getRequestFilePath()
 {
     if (isset($_GET['page']) && isset($_GET['ajax'])) {
         return 'components/pages/' . $_GET['page'] . '/_ajax/' . $_GET['ajax'] . '.php';
     } elseif (isset($_GET['page']) && isset($_GET['action'])) {
         return 'components/pages/' . $_GET['page'] . '/_actions/' . $_GET['action'] . '.php';
     } elseif (isset($_GET['page'])) {
         return 'components/pages/' . $_GET['page'] . '/template.php';
     } elseif (isset($_GET['section']) && isset($_GET['ajax'])) {
         if ($_GET['section'] == 'pages') {
             \PFC\WebApp\App::connectDatabase();
         }
         return 'components/sections/' . $_GET['section'] . '/_ajax/' . $_GET['ajax'] . '.php';
     } elseif (isset($_GET['section']) && isset($_GET['action'])) {
         if ($_GET['section'] == 'pages') {
             \PFC\WebApp\App::connectDatabase();
         }
         return 'components/sections/' . $_GET['section'] . '/_actions/' . $_GET['action'] . '.php';
     } elseif (isset($_GET['tools']) && isset($_GET['ajax'])) {
         return 'components/tools/' . $_GET['tools'] . '/_ajax/' . $_GET['ajax'] . '.php';
     } elseif (isset($_GET['tools']) && isset($_GET['action'])) {
         return 'components/tools/' . $_GET['tools'] . '/_actions/' . $_GET['action'] . '.php';
     } elseif (isset($_GET['editor']) && isset($_GET['ajax'])) {
         return 'components/editor/_ajax/' . $_GET['ajax'] . '.php';
     } elseif (isset($_GET['editor']) && isset($_GET['action'])) {
         return 'components/editor/_actions/' . $_GET['action'] . '.php';
     } elseif (isset($_GET['_app']) && isset($_GET['ajax'])) {
         return 'components/app/_ajax/' . $_GET['ajax'] . '.php';
     } elseif (isset($_GET['_app']) && isset($_GET['action'])) {
         return 'components/app/_actions/' . $_GET['action'] . '.php';
     } elseif (isset($_GET['sandbox'])) {
         set_include_path(implode(PATH_SEPARATOR, array(get_include_path(), \PFC\Editor\SANDBOX_PATH)));
         return \PFC\Editor\SANDBOX_PATH . '/' . $_GET['sandbox'];
     } else {
         $uri = explode('?', $_SERVER['REQUEST_URI']);
         $req = $uri[0];
         $pub = \PFC\Editor\PUBLIC_PATH . '/';
         $pos = strrpos($pub, $req);
         if ($pos === false || strlen($pub) !== strlen(substr($pub, 0, $pos) . $req)) {
             // not found...
             \PFC\Editor\AppFile::send404NotFoundHeaders();
             return 'layout/404.php';
         } else {
             return 'layout/layout.php';
         }
     }
 }
コード例 #2
0
<?php

\PFC\Editor\AppLogin::logout();
\PFC\Editor\AppFile::sendRedirectHeaders('./');