* 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') { echo $hades->getUser();
* 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"> <meta name="viewport" content="width=device-width, initial-scale=1">