Esempio n. 1
0
 * 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, see <http://www.gnu.org/licenses/>.
 */
error_reporting(0);
chdir(__DIR__);
foreach ([__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../cerberus/vendor/autoload.php'] as $file) {
    if (file_exists($file)) {
        require_once $file;
        break;
    }
}
use Hades\Hades;
$hades = new Hades();
if ($hades->isLoggedin() === false) {
    echo json_encode(['loggedin' => false]);
} elseif (isset($_POST['action']) && $_POST['action'] === 'getoutput') {
    echo $hades->getOutput();
} elseif (isset($_POST['action']) && $_POST['action'] === 'setinput') {
    echo $hades->useInput($_POST['text']);
} elseif (isset($_POST['action']) && $_POST['action'] === 'setchannel') {
    $hades->setChannel($_POST['channel']);
} elseif (isset($_POST['action']) && $_POST['action'] === 'gettopic' && isset($_POST['channel'])) {
    echo $hades->getChannel($_POST['channel']);
} elseif (isset($_POST['action']) && $_POST['action'] === 'getchannel') {
    echo $hades->getChannel();
} elseif (isset($_POST['action']) && $_POST['action'] === 'getwhisper') {
    echo $hades->getWhisper();
} elseif (isset($_POST['action']) && $_POST['action'] === 'getuser') {
Esempio n. 2
0
<?php

/*
 * Cerberus IRCBot
 * Copyright (C) 2008 - 2016 Stefan Hüsges
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the Free
 * Software Foundation; either version 3 of the License, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful, 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, see <http://www.gnu.org/licenses/>.
 */
chdir(__DIR__);
foreach ([__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../cerberus/vendor/autoload.php'] as $file) {
    if (file_exists($file)) {
        require_once $file;
        break;
    }
}
use Hades\Hades;
$hades = new Hades();
$hades->setHost($_SERVER['REMOTE_ADDR']);
Esempio n. 3
0
 * 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, see <http://www.gnu.org/licenses/>.
 */
chdir(__DIR__);
foreach ([__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../cerberus/vendor/autoload.php'] as $file) {
    if (file_exists($file)) {
        require_once $file;
        break;
    }
}
use Hades\Hades;
$hades = new Hades();
if ($hades->isLoggedin() === false) {
    header('Location: login.php');
    exit;
}
$_SESSION['bot'] = $hades->getBotId();
$_SESSION['last'] = 0;
?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title><?php 
echo isset($_SESSION['channel']) ? $_SESSION['channel'] . ' - Hades' : 'Chat - Hades';
?>
Esempio n. 4
0
 * 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, see <http://www.gnu.org/licenses/>.
 */
chdir(__DIR__);
foreach ([__DIR__ . '/../vendor/autoload.php', __DIR__ . '/../cerberus/vendor/autoload.php'] as $file) {
    if (file_exists($file)) {
        require_once $file;
        break;
    }
}
use Hades\Hades;
$hades = new Hades();
if ($hades->isLoggedin() === true) {
    header('Location: index.php');
    exit;
}
if (isset($_POST['username']) && isset($_POST['password'])) {
    $hades->login($_POST['username'], $_POST['password']);
}
?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Login - Hades</title>
    <meta name="description" content="Hades, master of Cerberus">