include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php"; if (!admin::isSession()) { header("Location: /admin/login.php"); } if (!empty($_POST)) { $authToken = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : ''; $message = isset($_POST['message']) ? $_POST['message'] : ''; $type = isset($_POST['type']) ? $_POST['type'] : 1; $message = helper::clearText($message); $message = helper::escapeText($message); $type = helper::clearInt($type); if ($authToken === helper::getAuthenticityToken() && !APP_DEMO) { if (strlen($message) != 0) { $gcm = new gcm($dbo, 0); $gcm->setData($type, $message, 0); $gcm->forAll(); $gcm->send(); } } header("Location: /admin/gcm.php"); } $stats = new stats($dbo); $page_id = "gcm"; $error = false; $error_message = ''; helper::newAuthenticityToken(); $css_files = array("admin.css"); $page_title = "Google Cloud Messages"; include_once $_SERVER['DOCUMENT_ROOT'] . "/common/header.inc.php"; ?>