Exemple #1
0
}
// Include update lib
require_once ROSTER_LIB . 'update.lib.php';
$update = new update();
// See if UU is requesting this page
if (preg_match('/uniuploader/i', $_SERVER['HTTP_USER_AGENT'])) {
    $update->textmode = true;
}
// Set template vars
$roster->tpl->assign_vars(array('S_DATA' => false, 'S_RESPONSE' => false, 'S_RESPONSE_ERROR' => false, 'S_PASS' => true, 'U_UPDATE' => makelink('update'), 'S_UPDATE_INS' => (bool) $roster->config['update_inst'], 'PAGE_INFO' => $roster->locale->act['pagebar_update'], 'L_UPLOAD_APP' => $roster->config['uploadapp'], 'L_PROFILER' => $roster->config['profiler'], 'L_PASSWORD_TIP' => makeOverlib($roster->locale->act['roster_upd_pw_help'], $roster->locale->act['password'], '', 2, '', ',WRAP,RIGHT'), 'MESSAGES' => ''));
// Fetch addon data
$update->fetchAddonData();
// Has data been uploaded?
if (isset($_POST['process']) && $_POST['process'] == 'process' || $update->textmode) {
    $messages = $update->parseFiles();
    $messages .= $update->processFiles();
    $errors = $update->getErrors();
    // Normal upload results
    if (!$update->textmode) {
        $roster->tpl->assign_var('S_RESPONSE', true);
        // print the error messages
        if (!empty($errors)) {
            // We have errors
            $roster->tpl->assign_vars(array('S_RESPONSE_ERROR' => true, 'RESPONSE_ERROR' => $errors, 'RESPONSE_ERROR_LOG' => htmlspecialchars(stripAllHtml($errors))));
        }
        $roster->tpl->assign_vars(array('RESPONSE' => $messages, 'RESPONSE_POST' => htmlspecialchars(stripAllHtml($messages))));
        $roster->tpl->set_handle('body', 'update.html');
        $roster->tpl->display('body');
    } else {
        // No-HTML result page for UU
        echo stripAllHtml($messages);
Exemple #2
0
    /**
     * Adding new guild to roster
     *
     */
    function _startAddGuild()
    {
        global $roster, $update;
        $out = '';
        if (isset($_POST['action']) && $_POST['action'] == 'add') {
            if (isset($_POST['name']) && isset($_POST['server']) && isset($_POST['region'])) {
                $name = urldecode(trim(stripslashes($_POST['name'])));
                $server = urldecode(trim(stripslashes($_POST['server'])));
                $faction = urldecode(trim(stripslashes($_POST['faction'])));
                $region = strtoupper($_POST['region']);
                if ($region == "EU" || $region == "US") {
                    if ($this->_checkGuildExist($name, $server, $region)) {
                        // ok the guild exists now we have functions to do this all in one
                        //move because we have allready set th guild to allow in upload rules
                        include_once ROSTER_LIB . 'update.lib.php';
                        $update = new update();
                        $this->ApiSync->server = $server;
                        $this->ApiSync->region = $region;
                        $this->ApiSync->guild_name = $name;
                        $this->ApiSync->_getGuildInfo();
                        $guild_data = $this->ApiSync->data;
                        $update->uploadData['wowroster']['cpProfile'][$server]['Guild'][$name] = $guild_data;
                        $log = $update->processFiles();
                        echo '
								<div class="tier-1-a">
									<div class="tier-1-b">
										<div class="tier-1-c">
											<div class="tier-1-title"> adding ' . $name . ' @ ' . $region . '-' . $server . '</div>
											
											
											<div class="tier-2-a">
												<div class="tier-2-b">
													<div class="tier-2-title">
														Log
													</div>
											
													<div class="border_color syellowborder"  style="background:black;height:300px;width:100%;overflow:auto;text-align:left;font-size:10px;">
													' . $log . '
													</div>
											
												</div>
											</div>
										</div>
									</div>
								</div>';
                    } else {
                        $html = "&nbsp;&nbsp;" . $roster->locale->act['error_guild_notexist'] . "&nbsp;&nbsp;";
                        $out = messagebox($html, $roster->locale->act['error'], $style = 'sred', '');
                    }
                } else {
                    $html = "&nbsp;&nbsp;" . $roster->locale->act['error_wrong_region'] . "&nbsp;&nbsp;";
                    $out = messagebox($html, $roster->locale->act['error'], $style = 'sred', '');
                }
            } else {
                $html = "&nbsp;&nbsp;" . $roster->locale->act['error_missing_params'] . "&nbsp;&nbsp;";
                $out = messagebox($html, $roster->locale->act['error'], $style = 'sred', '');
            }
        }
        if ($out) {
            $this->_debug(1, $out, 'Added guild', 'Failed');
            print $out;
        }
    }