Пример #1
0
    return;
}
// 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