Esempio n. 1
0
                }
            }
        }
        if ($firstrun == 0) {
            echo '</table></li>';
        }
        ?>
<!-- END QUEST PROGRESSION -->
				<!-- CHARACTER LIST -->
				<?php 
        if (user_character_hide($profile_data['name']) != 1 && user_character_list_count(user_character_account_id($name)) > 1) {
            ?>
					<li>
						<b>Other visible characters on this account:</b><br>
						<?php 
            $characters = user_character_list(user_character_account_id($profile_data['name']));
            // characters: [0] = name, [1] = level, [2] = vocation, [3] = town_id, [4] = lastlogin, [5] = online
            if ($characters && count($characters) > 1) {
                ?>
							<table id="characterprofileTable" class="table table-striped table-hover">
								<tr class="yellow">
									<th>
										Name:
									</th>
									<th>
										Level:
									</th>
									<th>
										Vocation:
									</th>
									<th>
Esempio n. 2
0
     }
 }
 // delete character:
 if (empty($_POST['del_name']) === false) {
     if (user_character_exist($_POST['del_name'])) {
         user_delete_character(user_character_id($_POST['del_name']));
         $errors[] = 'Character ' . $_POST['del_name'] . ' permanently deleted.';
     } else {
         $errors[] = 'Character ' . $_POST['del_name'] . ' does not exist.';
     }
 }
 // Reset password for char name
 if (empty($_POST['reset_pass']) === false && empty($_POST['new_pass']) === false) {
     // reset_pass = character name
     if (user_character_exist($_POST['reset_pass'])) {
         $acc_id = user_character_account_id($_POST['reset_pass']);
         if ($acc_id != $session_user_id) {
             if ($config['TFSVersion'] == 'TFS_02') {
                 user_change_password($acc_id, $_POST['new_pass']);
             } else {
                 if ($config['TFSVersion'] == 'TFS_03') {
                     user_change_password03($acc_id, $_POST['new_pass']);
                 }
             }
             $errors[] = 'The password to the account of character name: ' . $_POST['reset_pass'] . ' has been set to: ' . $_POST['new_pass'] . '.';
         } else {
             header('Location: changepassword.php');
             exit;
         }
     }
 }
Esempio n. 3
0
function user_recover($mode, $edom, $email, $character, $ip)
{
    /* -- Lost account function - user_recovery --
    
    	$mode = username/password recovery definition
    	$edom = The remembered value. (if mode is username, edom is players password and vice versa)
    	$email = email address
    	$character = character name
    	$ip = character IP
    */
    // Structure verify array data correctly
    if ($mode === 'username') {
        $verify_data = array('password' => sha1($edom), 'email' => $email);
    } else {
        $verify_data = array('name' => $edom, 'email' => $email);
    }
    // Determine if the submitted information is correct and herit from same account
    if (user_account_fields_verify_value($verify_data)) {
        // Structure account id fetch method correctly
        if ($mode == 'username') {
            $account_id = user_account_id_from_password($verify_data['password']);
        } else {
            $account_id = user_id($verify_data['name']);
        }
        // get account id from character name
        $player_account_id = user_character_account_id($character);
        //Verify that players.account_id matches account.id
        if ($player_account_id == $account_id) {
            // verify IP match (IP = accounts.email_new) \\
            // Fetch IP data
            $ip_data = user_znote_account_data($account_id, 'ip');
            if ($ip == $ip_data['ip']) {
                // IP Match, time to stop verifying SHIT and get on
                // With giving the visitor his goddamn username/password!
                if ($mode == 'username') {
                    $name_data = user_data($account_id, 'name');
                    echo '<br><p>Your username is:</p> <h3>' . $name_data['name'] . '</h3>';
                } else {
                    $newpass = substr(sha1(rand(1000000, 99999999)), 8);
                    echo '<br><p>Your new password is:</p> <h3>' . $newpass . '</h3><p>Remember to login and change it!</p>';
                    user_change_password($account_id, $newpass);
                }
                // END?! no, but almost. :)
            } else {
                echo 'IP does not match.';
            }
        } else {
            echo 'Account data does not match.';
        }
    } else {
        echo 'Account data does not match.';
    }
}
Esempio n. 4
0
                        } else {
                            echo 'You don\'t have any character gender tickets, buy them in the <a href="shop.php">SHOP</a>!';
                        }
                    } else {
                        echo 'Your character must be offline.';
                    }
                }
                break;
                // end
                // Change character comment PAGE1:
            // end
            // Change character comment PAGE1:
            case 'change_comment':
                $render_page = false;
                // Regular "myaccount" page should not render
                if (user_character_account_id($char_name) === $session_user_id) {
                    $comment_data = user_znote_character_data(user_character_id($char_name), 'comment');
                    ?>
					<!-- Changing comment MARKUP -->
					<h1>Change comment on:</h1>
					<form action="" method="post">
						<ul>
							<li>
								<input name="action" type="hidden" value="update_comment">
								<input name ="selected_character" type="text" value="<?php 
                    echo $char_name;
                    ?>
" readonly="readonly">
							</li>
							<li>
								<font class="profile_font" name="profile_font_comment">Comment:</font> <br>
Esempio n. 5
0
            }
        }
        ?>
</table>
<?php 
    } else {
        echo '<p>Guild list is empty.</p>';
    }
    ?>
<!-- user stuff -->
<?php 
    if (user_logged_in() === true) {
        // post verifications
        // CREATE GUILD
        if (!empty($_POST['selected_char']) && !empty($_POST['guild_name'])) {
            if (user_character_account_id($_POST['selected_char']) === $session_user_id) {
                //code here
                $name = sanitize($_POST['selected_char']);
                $user_id = user_character_id($name);
                if ($config['TFSVersion'] !== 'TFS_10') {
                    $char_data = user_character_data($user_id, 'level', 'online');
                } else {
                    $char_data = user_character_data($user_id, 'level');
                    $char_data['online'] = user_is_online_10($user_id) ? 1 : 0;
                }
                // If character level is high enough
                if ($char_data['level'] >= $config['create_guild_level']) {
                    // If character is offline
                    if ($char_data['online'] == 0) {
                        $acc_data = user_data($user_data['id'], 'premdays');
                        // If character is premium