Ejemplo n.º 1
0
function proccessAdminMessage($phone, $message, $name = "Not Registered", $media = null)
{
    global $SYSTEM_ADMIN_PHONES;
    $message = trim(substr($message, strpos($message, ':') + 1));
    $media = mediaURLForPhone($phone);
    foreach ($SYSTEM_ADMIN_PHONES as $adminPhone) {
        singleSMS($adminPhone, $phone . ' (' . $name . ')' . ":\n\n" . $message, $media);
    }
}
Ejemplo n.º 2
0
<?php

require_once '/home/mhsa/includes/admin_include.php';
if (isset($_GET['userID'])) {
    $userID = $_GET['userID'];
    $message = $_POST['text'];
    if ($user = DB::queryFirstRow('SELECT * FROM users WHERE user_id = %d', $userID)) {
        singleSMS(strlen($user['phone']) > 0 ? $user['phone'] : $user['unconfirmed_phone'], $message);
    }
    header('Location: /admin/players');
}
Ejemplo n.º 3
0
<?php

require_once '/home/mhsa/includes/admin_include.php';
if (isset($_GET['userID'])) {
    $userID = $_GET['userID'];
    $user = DB::queryFirstRow('SELECT * FROM users WHERE user_id = %d', $userID);
    DB::update('users', array('waiting_name' => true), "user_id=%d", $user['user_id']);
    $message = "Hello " . $user['name'] . "! It seems you haven't entered your full name. For you to play Assassins, and for us to verify if your a senior, it is imperative that we have this.\n\nPlease respond with your first and last name. Otherwise respond with 'withdraw' to remove yourself from the game.";
    singleSMS($user['phone'], $message);
    header('Location: /admin/users');
}
Ejemplo n.º 4
0
function massSMS($toArray, $message)
{
    foreach ($toArray as $to) {
        singleSMS($to, $message);
    }
}
Ejemplo n.º 5
0
<?php

require_once '/home/mhsa/includes/admin_include.php';
if (isset($_GET['userID'])) {
    $userID = $_GET['userID'];
    $user = DB::queryFirstRow('SELECT * FROM users WHERE user_id = %d', $userID);
    DB::update('users', array('is_blocked' => true), 'user_id=%d', $user['user_id']);
    $response = "You have been blocked for providing false information, not being a senior, or attempting to contaminate the game. If you think this has been done in error use 'MSG: ' to contact an admin";
    singleSMS(strlen($user['phone']) > 0 ? $user['phone'] : $user['unconfirmed_phone'], $response);
    header('Location: /admin/users');
}
Ejemplo n.º 6
0
Archivo: weekly.php Proyecto: k3zi/mhsa
<?php

require_once substr(getcwd(), 0, strpos(getcwd(), 'public_html')) . 'includes/include.php';
//**************************************
//* Begin Cron
//**************************************
$users = getUnblockedUsers();
foreach ($users as $user) {
    $fullName = trim($user['name']);
    $names = explode(" ", $fullName);
    $isValidUser = strlen($user['phone']) > 0;
    if ($isValidUser) {
        if (count($names) < 2) {
            DB::update('users', array('waiting_name' => true), "user_id=%d", $user['user_id']);
            $message = "Hello " . $user['name'] . "! It seems you haven't entered your full name. This is your last chance. Respond within the next hour. For you to play Assassins, and for us to verify if your a senior, it is imperative that we have this.\n\nPlease respond with your first and last name. Otherwise respond with 'withdraw' to remove yourself from the game.";
            try {
                singleSMS($user['phone'], $message);
            } catch (Exception $e) {
            }
        }
    } else {
        $message = "Hello " . $user['name'] . "! It seems you haven't verrified your phone number. This is your last chance. Respond within the next hour. For you to play Assassins it is imperative that you confirm you phone number.\n\nPlease respond with CONFIRM to verify your phone number. Otherwise respond with 'withdraw' to remove yourself from the game.";
        try {
            singleSMS($user['unconfirmed_phone'], $message);
        } catch (Exception $e) {
        }
    }
}
Ejemplo n.º 7
0
<?php

header('Location: /');
die;
require_once substr(getcwd(), 0, strpos(getcwd(), 'public_html')) . 'includes/include.php';
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$phone = (string) preg_replace('/\\D/', '', $_POST['phone']);
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
    die('1');
}
if (strlen($phone) != 10) {
    die('2');
}
if (strlen($name) == 0) {
    die('3');
}
$users = DB::query("SELECT * FROM users WHERE phone = %s", $phone);
if (count($users) > 0) {
    die('4');
}
$users = DB::query("SELECT * FROM users WHERE email = %s", $email);
if (count($users) > 0) {
    die('5');
}
DB::insert('users', array('name' => $name, 'unconfirmed_phone' => $phone, 'email' => $email));
if (DB::insertId() > 0) {
    singleSMS($phone, SYSTEM_CONFIRM_MESSAGE);
    die('0');
}
die('-1');