$update->deleteMembers($member_ids); } elseif (substr($_POST['action'], 0, 4) == 'del_') { $member_id = substr($_POST['action'], 4); $update->setMessage('<li>Deleting member "' . $member_id . '".</li>'); $update->deleteMembers($member_id); } elseif ($_POST['action'] == 'clean') { $update->enforceRules(time()); } $messages = $update->getMessages(); $errors = $update->getErrors(); // 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)))); } /** * Actual list */ $query = "SELECT " . " COUNT( `member_id` )" . " FROM `" . $roster->db->table('members') . "`" . " WHERE `guild_id` = " . (isset($roster->data['guild_id']) ? $roster->data['guild_id'] : 0) . ";"; $num_members = $roster->db->query_first($query); if ($num_members > 0) { $roster->tpl->assign_var('S_DATA', true); // Draw the header line if ($start > 0) { $prev = '<a href="' . makelink('&start=0') . '">|<<</a> <a href="' . makelink('&start=' . ($start - 30)) . '"><</a> '; } else { $prev = ''; } if ($start + 30 < $num_members) {
$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); $roster->output['show_header'] = false; $roster->output['show_menu'] = false; $roster->output['show_footer'] = false; } } else { // No data uploaded, so return upload form $update->makeFileFields(); if ($roster->auth->getAuthorized($roster->config['gp_user_level']) && $roster->auth->getAuthorized($roster->config['cp_user_level']) && $roster->auth->getAuthorized($roster->config['lua_user_level'])) { $roster->tpl->assign_var('S_PASS', false); } $messages = $update->getErrors(); $roster->tpl->assign_var('MESSAGES', $messages); $roster->tpl->set_handle('body', 'update.html'); $roster->tpl->display('body'); }
// Uninstalling is easier than installing in that we don't check anything but just run all queries. foreach ($uninstall_sql as $version => $sql) { $install_queries = explode(';', $sql); foreach ($install_queries as $query) { if (trim($query) != '') { if ($roster_conf['sqldebug']) { echo "<!--{$query}-->\n"; } $result = $wowdb->query($query) or $wowdb->setError('MySQL said: ' . $wowdb->error(), $query); } } } $errorstringout = $wowdb->getErrors(); // print the error messages if (!empty($errorstringout)) { print '<div id="errorCol" style="display:inline;"> ' . border('sred', 'start', "<div style=\"cursor:pointer;width:550px;\" onclick=\"swapShow('errorCol','error')\"><img src=\"" . $roster_conf['img_url'] . "plus.gif\" style=\"float:right;\" /><span class=\"red\">Update Errors</span></div>") . ' ' . border('sred', 'end') . ' </div> <div id="error" style="display:none"> ' . border('sred', 'start', "<div style=\"cursor:pointer;width:550px;\" onclick=\"swapShow('errorCol','error')\"><img src=\"" . $roster_conf['img_url'] . "minus.gif\" style=\"float:right;\" /><span class=\"red\">Update Errors</span></div>") . $errorstringout . border('sred', 'end') . '</div>'; // Print the downloadable errors separately so we can generate a download print "<br />\n"; print '<form method="post" action="update.php" name="post">' . "\n"; print '<input type="hidden" name="data" value="' . htmlspecialchars(stripAllHtml($errorstringout)) . '" />' . "\n"; print '<input type="hidden" name="send_file" value="error" />' . "\n"; print '<input type="submit" name="download" value="Save Error Log" />' . "\n"; print '</form>'; print "<br />\n"; } echo border('sgreen', 'start', $wordings[$roster_conf['roster_lang']]['AltMonitor_install_page']) . $wordings[$roster_conf['roster_lang']]['AltMonitor_uninstalled'] . '<br />' . "<a href='" . ROSTER_URL . "'>" . $wordings[$roster_conf['roster_lang']]['backlink'] . "</a>" . border('sgreen', 'end');
$AltMonitorUpdate->messages .= " - <span style='color:red;'>" . $retval . "</span><br/>\n"; } $messages = $AltMonitorUpdate->messages; $errorstringout = $wowdb->getErrors(); // print the error messages if (!empty($errorstringout)) { print '<div id="errorCol" style="display:inline;"> ' . border('sred', 'start', "<div style=\"cursor:pointer;width:550px;\" onclick=\"swapShow('errorCol','error')\"><img src=\"" . $roster_conf['img_url'] . "plus.gif\" style=\"float:right;\" /><span class=\"red\">Update Errors</span></div>") . ' ' . border('sred', 'end') . ' </div> <div id="error" style="display:none"> ' . border('sred', 'start', "<div style=\"cursor:pointer;width:550px;\" onclick=\"swapShow('errorCol','error')\"><img src=\"" . $roster_conf['img_url'] . "minus.gif\" style=\"float:right;\" /><span class=\"red\">Update Errors</span></div>") . $errorstringout . border('sred', 'end') . '</div>'; // Print the downloadable errors separately so we can generate a download print "<br />\n"; print '<form method="post" action="update.php" name="post">' . "\n"; print '<input type="hidden" name="data" value="' . htmlspecialchars(stripAllHtml($errorstringout)) . '" />' . "\n"; print '<input type="hidden" name="send_file" value="error" />' . "\n"; print '<input type="submit" name="download" value="Save Error Log" />' . "\n"; print '</form>'; print "<br />\n"; } // Print the update messages print border('syellow', 'start', 'Update Log') . '<div style="font-size:10px;background-color:#1F1E1D;text-align:left;height:300px;width:550px;overflow:auto;">' . $messages . '</div>' . border('syellow', 'end'); // Print the downloadable messages separately so we can generate a download print "<br />\n"; print '<form method="post" action="' . $roster_conf['roster_dir'] . '/admin/update.php" name="post">' . "\n"; print '<input type="hidden" name="data" value="' . htmlspecialchars(stripAllHtml($messages)) . '" />' . "\n"; print '<input type="hidden" name="send_file" value="update" />' . "\n"; print '<input type="submit" name="download" value="Save Update Log" />' . "\n"; print '</form>'; print "<br />\n";