Esempio n. 1
0
            JavaScript::sendMinified();
            break;
        default:
            return false;
    }
} elseif ($path === 'svg/chart.php') {
    if (!array_key_exists('data', $_GET)) {
        return false;
    }
    include __DIR__ . '/EmbeddedWeb.php';
    EmbeddedWeb::start();
    header('Content-Type: image/svg+xml');
    $pie = new PieChart();
    $pie->initFromRequest();
    echo $pie->render();
} elseif ($path === 'png/chart.php') {
    if (!array_key_exists('data', $_GET)) {
        return false;
    }
    include __DIR__ . '/EmbeddedWeb.php';
    EmbeddedWeb::start();
    header('Content-Type: image/png');
    $pie = new PieChart();
    $pie->initFromRequest();
    $pie->toPng();
} elseif (file_exists($baseDir . '/' . $path) && is_file($baseDir . '/' . $path)) {
    return false;
} else {
    include __DIR__ . '/Web.php';
    Web::start()->dispatch();
}
Esempio n. 2
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 ******************************************************************************/
/*
Icinga Web 2 integration
*/
use Icinga\Application\EmbeddedWeb;
set_include_path('/usr/share/icingaweb2/library/vendor:/usr/share/icingaweb2/library:' . get_include_path());
require_once 'Icinga/Application/EmbeddedWeb.php';
require_once EmbeddedWeb::start(null, '/etc/icingaweb2')->getModuleManager()->getModule('nagvis')->getLibDir() . '/nagvis-includes/init.inc.php';
/*
* Url: Parse the url to know later what module and
*      action is called. The requested uri is splitted
*      into elements for later usage.
*/
$UHANDLER = new CoreUriHandler();
/*
* Session: Handle the user session
*/
$SHANDLER = new CoreSessionHandler();
/*
 * Authentication: Try to authenticate the user
 */
$AUTH = new CoreAuthHandler();
// Session: Logged in?