Exemple #1
0
 function get_plugin_data()
 {
     $query = "SELECT * FROM `" . $this->db->table('plugin') . "` ORDER BY `basename`;";
     $result = $this->db->query($query);
     $this->plugin_data = array();
     while ($row = $this->db->fetch($result, SQL_ASSOC)) {
         $this->plugin_data[$row['basename']] = $row;
     }
 }
Exemple #2
0
function process_step4()
{
    global $DEFAULTS;
    $tpl = new Template_Wrap();
    $tpl->set_handle('body', 'install_step4.html');
    /**
     * Get our posted data
     */
    $user_password1 = post_or_db('user_password1');
    $user_password2 = post_or_db('user_password2');
    /**
     * Update admin account
     */
    include ROSTER_BASE . 'conf.php';
    define('ROSTER_DB_DIR', ROSTER_LIB . 'dbal' . DIR_SEP);
    switch ($db_config['dbtype']) {
        case 'mysql':
            include_once ROSTER_DB_DIR . 'mysql.php';
            break;
        case 'PDO':
            include_once ROSTER_DB_DIR . 'pdo.php';
            break;
        default:
            include_once ROSTER_DB_DIR . 'mysql.php';
            break;
    }
    $db = new roster_db($db_config['host'], $db_config['database'], $db_config['username'], $db_config['password'], $db_config['table_prefix']);
    $db->log_level();
    $db->error_die();
    if (!is_resource($db->link_id)) {
        $tpl->message_die('Failed to connect to database <strong>' . $db_config['database'] . '</strong> as <strong>' . $db_config['username'] . '@' . $db_config['host'] . '</strong><br /><br /><a href="index.php">Restart Installation</a>');
    }
    /**
     * Insert account data. This isn't in the data sql file because we don't
     * want to include it in a settings reset
     */
    if ($user_password1 == '' || $user_password2 == '') {
        $pass_word = md5('admin');
    } elseif ($user_password1 == $user_password2) {
        $pass_word = md5($user_password1);
    } else {
        $pass_word = md5('admin');
    }
    $db->query("INSERT INTO `" . $db->table('user_members') . "` (`usr`) VALUES\t('Admin');");
    $db->query("UPDATE `" . $db->table('user_members') . "` SET `pass` = '" . $pass_word . "',`access` = '11:0',`active`='1',`user_permissions` = '{\"id\":\"1\",\"roster_cp\":\"1\",\"gp_update\":\"1\",\"cp_update\":\"1\",\"lua_update\":\"1\"}' WHERE `usr` = 'Admin';");
    $tpl->message_append('The WoWRoster Admin account has created<br />Please do not forget your password');
    /**
     * Rewrite the config file to its final form
     */
    $config_file = file(ROSTER_BASE . 'conf.php');
    $config_file[] = "\ndefine('ROSTER_INSTALLED', true);";
    $config_file = implode('', $config_file);
    // Set our permissions to execute-only
    @umask(0111);
    if (!($fp = @fopen('conf.php', 'w'))) {
        $error_message = 'The <strong>conf.php</strong> file couldn\'t be opened for writing.<br />Paste the following in to conf.php and save the file to continue:<br /><pre>' . htmlspecialchars($config_file) . '</pre>';
        $tpl->error_append($error_message);
    } else {
        @fwrite($fp, $config_file, strlen($config_file));
        @fclose($fp);
    }
    /**
     * Print out the login form
     */
    if ($user_password1 != $user_password2 || $user_password1 == '' || $user_password2 == '') {
        $tpl->message_append('<span style="font-weight:bold;font-size:14px;" class="negative">NOTICE</span><br /><br />Your passwords did not match, so it has been reset to <strong>admin</strong><br />You can change it by logging in and going to your account settings.');
    }
    $tpl->message_append('Your administrator account has been created, log in to be taken to the WoWRoster configuration page.');
    $tpl->sql_output($db);
    $tpl->page_header();
    $tpl->page_tail();
}
Exemple #3
0
 function char_status_role($character_data)
 {
     if ($this->user['SiteRank'] >= 4) {
         $charData = @roster_db::role_status($character_data['character'], $character_data['server']);
         json::resp(array('success' => 'true', 'data' => $charData));
     }
 }
Exemple #4
0
function claimCharacter()
{
    global $usrInfo;
    $char = $_GET['Char'];
    $serv = $_GET['Server'];
    $dbLookup = roster_db::lookup($char, $serv);
    // Result
    $claim = roster_db::claim($char, $serv, $usrInfo['Username'], json_decode($dbLookup->lookupData['Data'], true));
    if ($claim == true) {
        echo '
		<div id="claimCharCompleteWindow" class="wbox" data-height="110px" data-width="320px" data-max-width="100%">
			<div class="wbox-title">Character Claim</div>
			<div class="wbox-content">
				Character Claimed!
			</div>
			<div class="WBoxBtns">
				<input type="button" class="WBox-btn btn-blue aniObj" value="Cool!" onclick="wbox.close();">
			</div>
		</div>
		<script>
			wbox.show(\'claimCharCompleteWindow\');
		</script>';
    } else {
        echo '
		<div id="claimCharStepsWindow" class="wbox" data-height="110px" data-width="320px" data-max-width="100%">
			<div class="wbox-title">Steps to claim character</div>
			<div class="wbox-content">
				To claim this character you must unequip the following: Helm, Shoulders, & Main Hand.  After that, reload your character and click Claim again!
			</div>
			<div class="WBoxBtns">
				<input type="button" class="WBox-btn btn-blue aniObj" value="Got it!" onclick="wbox.close();">
			</div>
		</div>
		<script>
			wbox.show(\'claimCharStepsWindow\');
		</script>';
    }
    checkUserDat();
}