コード例 #1
0
ファイル: Account.php プロジェクト: reillo/ninjawars
 public function __construct($account_id)
 {
     $this->account_id = $account_id;
     $this->info = account_info($account_id);
     $this->oauth_id = $this->info['oauth_id'];
     $this->oauth_provider = $this->info['oauth_provider'];
     $this->active_email = $this->info['active_email'];
     $this->account_identity = $this->info['account_identity'];
     $this->type = $this->info['type'];
 }
コード例 #2
0
#
#
#
#
#
#
# get settings
require "settings.php";
foreach ($_GET as $key => $value) {
    $_POST[$key] = $value;
}
# decide what to do
if (isset($_POST["key"])) {
    switch ($_POST["key"]) {
        case "account_info":
            $OUTPUT = account_info($_POST);
            break;
        case "archive":
            $OUTPUT = archive();
            break;
        default:
            $OUTPUT = order($_POST);
    }
} elseif (isset($_GET["id"])) {
    # Display default output
    $_POST["id"] = $_GET["id"];
    if (isset($_GET["tripid"])) {
        $_POST["tripid"] = $_GET["tripid"];
    }
    if (isset($_GET["proid"])) {
        $_POST["proid"] = $_GET["proid"];
コード例 #3
0
ファイル: lib_accounts.php プロジェクト: reillo/ninjawars
function self_account_info()
{
    return account_info(account_id());
}
コード例 #4
0
ファイル: account.php プロジェクト: N0ctrnl/peqphpeditor
function update_account()
{
    global $mysql, $acctid;
    $oldstats = account_info();
    extract($oldstats);
    $fields = '';
    //Set fields here
    $fields = rtrim($fields, ", ");
    if ($fields != '') {
        $query = "UPDATE account SET {$fields} WHERE account_id={$acctid}";
        $mysql->query_no_result($query);
    }
}
コード例 #5
0
ファイル: lib_auth.php プロジェクト: reillo/ninjawars
function characters_are_linked($char_id, $char_2_id)
{
    $account_id = get_char_account_id($char_id);
    $account_2_id = get_char_account_id($char_2_id);
    $char_1_info = char_info($char_id);
    $char_1_active = @$char_1_info['active'];
    $char_2_info = char_info($char_2_id);
    $char_21_active = @$char_2_info['active'];
    $server_ip = $_SERVER['SERVER_ADDR'];
    $allowed_ips = array_merge(['127.0.0.1', $server_ip], Constants::$trusted_proxies);
    if (empty($account_id) || empty($account_2_id) || empty($char_1_info) || empty($char_2_info)) {
        return false;
    } elseif (!$char_1_active || !$char_2_active) {
        // Not both of the potential clones are active.
        return false;
    } else {
        if ($account_id == $account_2_id) {
            error_log('Two accounts were linked [' . $account_id . '] and [' . $account_2_id . ']');
            return true;
        }
        $account_ip = account_info($account_id, 'last_ip');
        $account_2_ip = account_info($account_2_id, 'last_ip');
        if (empty($account_ip) || empty($account_2_ip) || in_array($account_ip, $allowed_ips) || in_array($account_2_ip, $allowed_ips)) {
            // When account ips are empty or equal the server ip, then don't clone kill them.
            return false;
        } else {
            error_log('Two accounts were linked [' . $account_id . '] and [' . $account_2_id . '] with ips [' . $account_ip . '] and [' . $account_2_ip . ']');
            return $account_ip == $account_2_ip;
            // If none of the other stuff matched, then the accounts count as not linked.
        }
    }
}
コード例 #6
0
ファイル: account_edit.php プロジェクト: bbogin/sr2s
     $_STATE->msgGreet = "Select the " . $_STATE->accounting . " record to edit";
     $_STATE->status = SELECT_ACCOUNT;
     break 2;
 case SELECT_ACCOUNT:
     account_select();
     $_STATE->status = SELECTED_ACCOUNT;
     $_STATE->replace();
     //	break 1; //re_switch
 //	break 1; //re_switch
 case SELECTED_ACCOUNT:
     state_fields();
     if ($_STATE->record_id == -1) {
         $_STATE->msgGreet = "New " . $_STATE->accounting . " record";
         $_STATE->status = STATE::ADD;
     } else {
         account_info();
         $_STATE->msgGreet = "Edit " . $_STATE->accounting . " record?";
         $_STATE->status = STATE::UPDATE;
     }
     break 2;
 case STATE::ADD:
     $_STATE->msgGreet = "New " . $_STATE->accounting . " record";
     if (isset($_POST["btnReset"])) {
         break 2;
     }
     //	if ($_POST["btnSubmit"] != "add") { //IE < v8 submits name/InnerText NOT name/value
     //		throw_the_bum_out(NULL,"Evicted(".__LINE__."): invalid btnSubmit ".$_POST["btnSubmit"]);
     //	}
     state_fields();
     if (new_audit()) {
         $_STATE->status = STATE::DONE;
コード例 #7
0
 /**
  */
 private function render($parts)
 {
     // default parts
     $account_info = account_info(account_id());
     // Get the existing oauth info, if any.
     $oauth_provider = $account_info['oauth_provider'];
     $oauth = $oauth_provider && $account_info['oauth_id'];
     $player = new Player(self_char_id());
     $self_info = $player->dataWithClan();
     $gravatar_url = $player->avatarUrl();
     $parts = array_merge(['gravatar_url' => $gravatar_url, 'player' => $self_info, 'account_info' => $account_info, 'oauth_provider' => $oauth_provider, 'oauth' => $oauth, 'successMessage' => false, 'error' => false, 'command' => '', 'delete_attempts' => 0], $parts);
     return ['template' => 'account.tpl', 'title' => 'Your Account', 'parts' => $parts, 'options' => ['quickstat' => 'player']];
 }