/** * * 建树 * @param unknown_type $item * @param unknown_type $name * @param unknown_type $full_key * @param unknown_type $is_last * @param unknown_type $return_html */ private function _create_key_tree($item, $name, $full_key, $is_last, &$return_html) { $this->_nowLevel = $full_key !== '' ? count(explode(SEPERATOR, $full_key)) : 0; $this->_create_key_tree_head($item, $name, $full_key, $is_last, $return_html); if (count($item) > 0) { $tree_sub2 = array(); if ($full_key != $this->_sub_key) { //因为dom的ID不能包含冒号: 所以将:替换为___ $tree_sub2[] = '<li class="folder' . (empty($full_key) ? '' : ' collapsed') . ($is_last ? ' last' : '') . '" title="' . urlencode($full_key) . '" id="keyid_' . str_replace(SEPERATOR, '___', $full_key) . '">'; $tree_sub2[] = '<div class="icon">' . format_html($name) . ' <span class="info">(' . count($item) . ')</span>'; $tree_sub2[] = !empty($full_key) ? '<a href="#" class="refresh" onclick="return refreshTree(this)"><img src="' . base_url('static/images/refresh.png') . '" width="10" height="10" title="刷新当前节点" alt="[X]"></a>' : ''; $tree_sub2[] = !empty($full_key) ? '<a href="' . manager_site_url('export', 'index', 'key=' . urlencode($full_key) . ':*') . '" class="export"><img src="' . base_url('static/images/export.png') . '" width="10" height="10" title="导出当前节点" alt="[X]"></a>' : ''; $tree_sub2[] = !empty($full_key) ? '<a href="' . manager_site_url('delete', 'index', 'tree=' . urlencode($full_key) . ':') . '" class="deltree"><img src="' . base_url('static/images/delete.png') . '" width="10" height="10" title="删除整个树" alt="[X]"></a>' : ''; $tree_sub2[] = '</div>'; } $tree_sub2[] = '<ul>'; $return_html[] = implode(PHP_EOL, $tree_sub2); if ($this->_nowLevel < $this->_auto_build_tree_level && is_array($item)) { $l = count($item); foreach ($item as $childname => $childitem) { if (empty($full_key)) { $childfullkey = $childname; } else { $childfullkey = $full_key . SEPERATOR . $childname; } $this->_create_key_tree($childitem, $childname, $childfullkey, --$l == 0, $return_html); } } $return_html[] = '</ul>'; if ($full_key != $this->_sub_key) { $return_html[] = '</li>'; } } }
<td colspan=2> <b><?php echo stripslashes($row["vKBTitle"]); ?> </b> </td> </tr> <tr align="left" class="listingmaintext"> <td colspan=2> <?php ?> <?PHP// echo format_html(nl2br(htmlentities($row["tKBDesc"]))); ?> <?php echo format_html(nl2br(stripslashes($row["tKBDesc"]))); ?> </td> </tr> <tr align="left" class="listingmaintext"> <td colspan="5" class="dotedhoriznline" height="1"><img src="./images/spacerr.gif" width="1" height="1"></td> </tr> <?php $cnt++; } mysql_free_result($rs); ?> <tr class="listingmaintext"> <td align="left" width="30%"><?php echo $navigate[1] . " " . TEXT_OF . " " . $totalrows . " " . TEXT_RESULTS; ?>
?> <?php /* Disable phone number detection on apple devices. */ ?> <meta name=format-detection content="telephone=no"> <?php /* I don't think we ever want this to be indexed*/ ?> <meta name=robots content="noindex,nofollow,noarchive"> <meta name=author content="https://github.com/ErikDubbelboer/"> <title><?php echo format_html($server['host']); ?> - phpRedisAdmin</title> <?php foreach ($page['css'] as $css) { ?> <link rel=stylesheet href="css/<?php echo $css; ?> .css?v1" media=all> <?php } ?> <link rel="shortcut icon" href="images/favicon.png">
<?php include "../../include.php"; if ($posting) { $theuser_id = $page['is_admin'] ? $_POST["created_user"] : $_SESSION["user_id"]; db_query("UPDATE press_releases SET\n\t\t\theadline = '{$_POST["headline"]}',\t\n\t\t\tdetail = '{$_POST["detail"]}',\t\n\t\t\tlocation = '{$_POST["location"]}',\t\n\t\t\ttext = '" . format_html($_POST["text"]) . "',\t\n\t\t\tcorporationID = {$_POST["corporationID"]},\n\t\t\tupdated_date = GETDATE(),\n\t\t\tupdated_user = {$theuser_id}\n\t\t\tWHERE id = " . $_GET["id"]); url_change("../?id=" . $_GET["id"]); } echo drawTop(); $r = db_grab("SELECT id, headline, detail, location, releaseDate, corporationID, text FROM press_releases WHERE id = " . $_GET["id"]); $form = new intranet_form(); if ($page['is_admin']) { $form->addUser("created_user", "Posted By", $_SESSION["user_id"], false, "EEDDCC"); } $form->addRow("itext", "Headline", "headline", $r["headline"], "", true, 255); $form->addRow("itext", "Detail", "detail", $r["detail"], "", false, 255); $form->addRow("itext", "Location", "location", $r["location"], "", true, 255); $form->addRow("select", "Organization", "corporationID", "SELECT id, title from organizations ORDER BY title", $r["corporationID"]); $form->addRow("date", "Date", "releaseDate", $r["releaseDate"]); $form->addRow("textarea", "Text", "text", $r["text"], "", true); $form->addRow("submit", "update press release"); $form->draw("Update Release"); echo drawBottom();
<p id="scorep"> <label for="score">Score:</label> <input type="text" name="score" id="score" size="30" <?php echo isset($_GET['score']) ? 'value="' . format_html($_GET['score']) . '"' : ''; ?> > </p> <p> <label for="value">Value:</label> <textarea name="value" id="value" cols="80" rows="20"><?php echo nl2br(format_html($value)); ?> </textarea> </p> <input type="hidden" name="oldvalue" value="<?php echo format_html($value); ?> "> <p> <input type="submit" class="button" value="<?php echo $edit ? 'Edit' : 'Add'; ?> "> </p> </form> <?php require 'footer.inc.php';
<?php PagerWidget::header(); ?> <h2> 导出数据 <?php echo isset($key) ? format_html($key) : ''; ?> </h2> <form action="" method="post"> <p> <label for="type">数据格式:</label> <select name="type" id="type"> <option value="redis" <?php echo isset($type) && $type == 'redis' ? 'selected="selected"' : ''; ?> >Redis</option> <option value="json" <?php echo isset($type) && $type == 'json' ? 'selected="selected"' : ''; ?> >JSON</option> </select> </p> <p> <input type="submit" class="button" value="导出"> </p> </form> <?php PagerWidget::footer();
function print_namespace($item, $name, $fullkey, $islast) { global $config, $redistypes, $server, $redis; // Is this also a key and not just a namespace? if (isset($item['__phpredisadmin__'])) { // Unset it so we won't loop over it when printing this namespace. unset($item['__phpredisadmin__']); $type = $redis->type($fullkey); if (!isset($redistypes[$type])) { return; } $type = $redistypes[$type]; $class = array(); $len = false; if (isset($_GET['key']) && ($fullkey == $_GET['key'])) { $class[] = 'current'; } if ($islast) { $class[] = 'last'; } // Get the number of items in the key. if (!isset($config['faster']) || !$config['faster']) { switch ($type) { case 'hash': $len = $redis->hLen($fullkey); break; case 'list': $len = $redis->lSize($fullkey); break; case 'set': // This is currently the only way to do this, this can be slow since we need to retrieve all keys $len = count($redis->sMembers($fullkey)); break; case 'zset': // This is currently the only way to do this, this can be slow since we need to retrieve all keys $len = count($redis->zRange($fullkey, 0, -1)); break; } } ?> <li<?php echo empty($class) ? '' : ' class="'.implode(' ', $class).'"'?>> <a href="?view&s=<?php echo $server['id']?>&key=<?php echo urlencode($fullkey)?>"><?php echo format_html($name)?><?php if ($len !== false) { ?><span class="info">(<?php echo $len?>)</span><?php } ?></a> </li> <?php } // Does this namespace also contain subkeys? if (count($item) > 0) { ?> <li class="folder<?php echo empty($fullkey) ? '' : ' collapsed'?><?php echo $islast ? ' last' : ''?>"><div class="icon"><?php echo format_html($name)?> <span class="info">(<?php echo count($item)?>)</span></div> <ul> <?php $l = count($item); foreach ($item as $childname => $childitem) { // $fullkey will be empty on the first call. if (empty($fullkey)) { $childfullkey = $childname; } else { $childfullkey = $fullkey.$config['seperator'].$childname; } print_namespace($childitem, $childname, $childfullkey, (--$l == 0)); } ?> </ul> </li> <?php } }
function _public_add_info($type = 'bbs') { $info = $this->_article_info(); if (!$info) { return; } if ($type == 'bbs') { require_once libfile('function/editor'); $info['content'] = dstripslashes($info['content']); $info['content'] = img_htmlbbcode($info['content'], $info['page_url']); $info['content'] = media_htmlbbcode($info['content'], $info['page_url']); $info['content'] = audio_htmlbbcode($info['content'], $info['page_url']); $info['content'] = htmlspecialchars_decode(html2bbcode($info['content'])); $info['content'] = dstripslashes(format_html($info['content'])); $script .= '<div id="show_title" style="display:none">' . $info['title'] . '</div><div id="show_content" style="display:none">' . $info['content'] . '</div><script language="javascript" type="text/javascript" >'; $script .= ' var subject = $("show_title").innerHTML; var message = $("show_content").innerHTML; $("subject").value= subject; message = message.replace(/<p>([\\s\\S]*?)<\\/p>/ig, "$1<br />"); message = message.replace(/<center>([\\s\\S]*?)<\\/center>/ig, "[align=center]$1[/align]"); $(\'e_textarea\').value = message; $("subject").focus();'; $script .= '</script>'; } else { if ($type == 'portal') { $script .= '<div id="show_title" style="display:none">' . $info['title'] . '</div><div id="show_content" style="display:none">' . $info['content'] . '</div><script language="javascript" type="text/javascript" >'; $script .= ' var subject = $("show_title").innerHTML; var message = $("show_content").innerHTML; $("title").value= subject; $("from").value= \'' . $this->_public_data($info['from']) . '\'; document.getElementsByName(\'fromurl\')[0].value = \'' . $this->_public_data($info['url']) . '\'; document.getElementsByName(\'author\')[0].value = \'' . $this->_public_data($info['author']) . '\'; $(\'uchome-ttHtmlEditor\').value = message; var p = window.frames[\'uchome-ifrHtmlEditor\']; var obj = p.window.frames[\'HtmlEditor\']; obj.document.body.innerHTML = message; edit_save(); $("title").focus()'; $script .= '</script>'; } else { if ($type == 'blog') { $script .= '<div id="show_title" style="display:none">' . $info['title'] . '</div><div id="show_content" style="display:none">' . $info['content'] . '</div><script language="javascript" type="text/javascript" >'; $script .= ' var subject = $("show_title").innerHTML; var message = $("show_content").innerHTML; $("subject").value= subject; document.getElementsByName(\'tag\')[0].value = \'' . $this->_public_data($info['article_tag']) . '\'; $(\'uchome-ttHtmlEditor\').value = message; var p = window.frames[\'uchome-ifrHtmlEditor\']; var obj = p.window.frames[\'HtmlEditor\']; obj.document.body.innerHTML = message; edit_save(); $("subject").focus()'; $script .= '</script>'; } } } return $script; }
function output_update_html($token, $status, $done, $cancelled, $failed, $err, $errs, $errs_admin = false, $ajax = false) { global $fups_url_cancel, $fups_url_notify_email_address, $fups_url_run; if ($err) { ?> <div class="fups_error"><?php echo format_html($err); ?> </div> <?php return; } ?> <h3>Status</h3> <div id="fups_div_status"> <?php echo htmlspecialchars($status); ?> </div> <?php if ($done) { $output_info = json_decode(file_get_contents(make_output_info_filename($token)), true); if ($output_info == null) { ?> <p>We are sorry, but an unexpected error occurred. The scraping process completed, and the output was created, however we were unable to decode the list of output files. Please feel free to <a href="<?php echo FUPS_CONTACT_URL; ?> ">contact me</a> for help with accessing your output files, quoting token "<?php echo $token; ?> ".</p> <?php } else { ?> <p>Success! Your posts were retrieved and the output is ready. The following output files are available:</p> <table style="border-collapse: collapse;"> <tr><th style="border: 1px solid black;">Description</th><th style="border: 1px solid black;">View/download file (opens in a new window)</th><th style="border: 1px solid black;">File size</th></tr> <?php foreach ($output_info as $opv) { ?> <tr><td style="border: 1px solid black;"><?php echo $opv['description']; ?> </td><td style="border: 1px solid black;"><a target="_blank" href="<?php echo $opv['url']; ?> ">View/download file</a></td><td style="border: 1px solid black;"><?php echo number_format($opv['size']) . ' bytes'; ?> </td></tr> <?php } ?> </table> <p>If you're wondering what to do next, here are some possible steps:</p> <ol> <li>Click on the "View/download file" link beside the HTML file which is sorted according to your preference. This will open up a new window/tab for that file. Switch to this window/tab if necessary, and then save the page, e.g. in Firefox click the "File" menu option and under that click "Save Page As". Select the directory/folder and filename you wish to save this output as (remember this location for the next step).</li> <li>Start up a word processor such as LibreOffice/OpenOffice or Microsoft Word. Open up in that word processor the HTML file that you saved in the previous step, e.g. click the "File" menu option and under that click "Open", then select the file you saved in the previous step. You are now free to edit the file as you like. You can now (if you so desire) save the file in a friendlier format than HTML, a format such as your editor's default format, e.g. in LibreOffice, click the "File" menu option and then click "Save As" or "Export", and choose the format you desire.</li> </ol> <?php show_delete($token, true); } } else { if ($cancelled) { ?> <p>Cancelled by your request.</p> <?php show_delete($token, false); } else { if ($failed) { ?> <p>The script appears to have exited due to an error; the error message is shown below. I have been notified of this error by email; if you would like me to get back to you if/when I have fixed the error, then please enter your email address into the following box and press the button to notify me of it.</p> <div> <form method="post" action="<?php echo $fups_url_notify_email_address; ?> "> <input type="hidden" name="token" value="<?php echo $token; ?> " /> <label for="email_address.id">Your contact email address:</label><br /> <input type="text" name="email_address" id="email_address.id" /><br /> <label for="message.id">Any message you'd like to include (leaving this blank is fine):</label><br /> <textarea rows="5" cols="80" name="message" id="message.id"></textarea><br /> <input type="submit" value="Notify the FUPS maintainer" /> </form> </div> <p>Alternatively, feel free to retry or to <a href="<?php echo FUPS_CONTACT_URL; ?> ">contact me</a> manually about this error, quoting your run token of "<?php echo $token; ?> ".</p> <?php show_delete($token, false); } else { $same_status = isset($_GET['last_status']) && $status == $_GET['last_status']; ?> <p> <a href="<?php echo $fups_url_run . '?token=' . $token . ($same_status ? '&last_status=' . htmlspecialchars(urlencode($status)) : '') . ($ajax ? '&ajax=yes' : ''); ?> "><?php echo $ajax ? 'Refresh page' : 'Check progress'; ?> </a><?php if ($ajax) { echo ' (it should not be necessary to click this link unless something goes wrong)'; } ?> . <?php if ($same_status) { ?> (It appears that progress has halted unexpectedly - the current status is the same as the previous status. It is likely that an error has caused the process to exit before finishing. We are sorry about this failure. In case you want to be sure that progress has indeed halted, you are welcome to click the preceding link, but otherwise, this page will no longer automatically refresh.) <?php show_delete($token, false); } else { ?> <?php echo !$ajax ? 'Your browser should automatically refresh this page every ' . FUPS_META_REDIRECT_DELAY . ' seconds or so to update progress, but if you don\'t want to wait, you\'re welcome to click the link. ' : ''; ?> If you have changed your mind about wanting to run this script through to the end, <strong>please</strong> click this <a href="<?php echo $fups_url_cancel; ?> ?token=<?php echo $token . ($ajax ? '&ajax=yes' : ''); ?> ">cancel</a> link rather than just closing this page - clicking the cancel link will free up the resources (in particular a background process) associated with your task. <?php } ?> </p> <?php } } } $paren_msg_will_be_emailed = '(Unless a mailing error occurs, these will be emailed to me as-is if/when FUPS finishes running, with your token, "' . htmlspecialchars($token) . '", included in the email\'s subject)'; $paren_msg_emailed = '(Unless a mailing error occurred, these have been emailed to me as-is, with your token, "' . htmlspecialchars($token) . '", included in the email\'s subject)'; if ($errs) { ?> <h3>Errors</h3> <p><?php echo $done || $failed ? $paren_msg_emailed : $paren_msg_will_be_emailed; ?> </p> <?php $len = strlen($errs); if ($len > FUPS_MAX_ERROR_FILE_EMAIL_LENGTH) { $errs = substr($errs, 0, FUPS_MAX_ERROR_FILE_EMAIL_LENGTH); $trunc_msg = '[Truncated from ' . number_format($len) . ' bytes to ' . number_format(FUPS_MAX_ERROR_FILE_EMAIL_LENGTH) . ' bytes]'; ?> <p><?php echo $trunc_msg; ?> </p> <?php } ?> <div class="fups_error"> <?php echo format_html($errs); ?> </div> <?php if ($errs_admin && ($done || $failed)) { // The toggle_ext_errs() Javascript function below is defined in run.php ?> <p><a href="javascript:toggle_ext_errs();">Show/hide extended error messages</a> <?php echo $paren_msg_emailed; ?> </p> <div id="id_ext_err" style="display: none;"> <h3>Extended error messages</h3> <?php $len = strlen($errs_admin); if ($len > FUPS_MAX_ADMIN_FILE_EMAIL_LENGTH) { $errs_admin = substr($errs_admin, 0, FUPS_MAX_ADMIN_FILE_EMAIL_LENGTH); $trunc_msg = '[Truncated from ' . number_format($len) . ' bytes to ' . number_format(FUPS_MAX_ADMIN_FILE_EMAIL_LENGTH) . ' bytes]'; ?> <p><?php echo $trunc_msg; ?> </p> <?php } ?> <div class="fups_error"><?php echo format_html($errs_admin); ?> </div> </div> <?php } } // Early return possible }
<?php include "../include.php"; if ($posting) { format_post_bits("isAdmin,temporary"); $_POST["description"] = format_html($_POST["description"]); db_enter("bulletin_board_topics", "title description isAdmin temporary"); //db_query("UPDATE bulletin_board_topics SET threadDate = GETDATE() WHERE id = " . $_GET["id"]); don't do this syndicateBulletinBoard(); url_change("topic.php?id=" . $_GET["id"]); } drawTop(); $t = db_grab("SELECT title, description, isAdmin, temporary, createdBy FROM bulletin_board_topics WHERE id = " . $_GET["id"]); $form = new intranet_form(); if ($isAdmin) { $form->addUser("createdBy", "Posted By", $t["createdBy"], false, true); $form->addCheckbox("isAdmin", "Admin Post?", $t["isAdmin"], "(check if yes)", true); } $form->addCheckbox("temporary", "Lifespan", $t['temporary'], "Check Box to Delete Post After 30 Days"); $form->addRow("itext", "Subject", "title", $t["title"], "", true); $form->addRow("textarea", "Message", "description", $t["description"], "", true); $form->addRow("submit", "edit topic"); $form->draw("Edit Bulletin Board Topic"); drawBottom();
<?php PagerWidget::header(); ?> <h2>重命名 <?php echo format_html($key); ?> </h2> <form action="" method="post"> <input type="hidden" name="old" value="<?php echo format_html($key); ?> "> <p> <label for="key">Key:</label> <input type="text" name="key" id="key" size="30"value="<?php echo format_html($key); ?> "> </p> <p> <input type="submit" class="button" value="重命名"> </p> </form> <?php PagerWidget::footer();
?><!DOCTYPE html> <html lang=en> <head> <meta charset=utf-8> <?php if (is_ie()) { // Always force latest IE rendering engine and chrome frame (also hides compatibility mode button) ?><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><?php } ?> <meta name=author content="https://github.com/ErikDubbelboer/"> <?php /* I don't think we ever want this to be indexed*/ ?> <meta name=robots content="noindex,nofollow,noarchive"> <title><?php echo format_html($server['host'])?> - phpRedisAdmin</title> <?php foreach ($page['css'] as $css) { ?> <link rel=stylesheet href="css/<?php echo $css; ?>.css?v1" media=all> <?php } ?> <link rel="shortcut icon" href="images/favicon.png"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script> <?php foreach ($page['js'] as $js) { ?> <script src="js/<?php echo $js; ?>.js?v1"></script> <?php } ?> </head> <body>
function format_post_html($fieldnames) { //takes a comma-separated list of POST keys and formats the html in them global $_POST; $fields = array_post_fields($fieldnames); foreach ($fields as $field) { $return = format_html($_POST[$field]); $_POST[$field] = empty($return) ? "NULL" : "'" . $_POST[$field] . "'"; } }
/** * Main Function * * @access public * @param int $argc The number of command line arguments * @param array &$argv The command line arguments * @uses $GLOBALS['SOURCEKIND'] * @uses downwiki() * @uses downhtml() * @uses downattach() */ function main($argc, &$argv) { if ($argc < 2) { $help = ''; $help .= '$ php pkwkdownloader.php [option...] pkwkurl' . "\n"; $help .= '$ php pkwkdownloader.php --format [option...] pkwkurl' . "\n"; $help .= 'Examples)' . "\n"; $help .= '$ php pkwkdownloader.php -p [adminpass] -un [read username] -up [read userpass] -k html -d html/ http://example.com/pukiwiki/index.php' . "\n"; $help .= '$ php pkwkdownloader.php -p [adminpass] -un [read username] -up [read userpass] -k wiki -d wiki/ http://example.com/pukiwiki/index.php' . "\n"; $help .= '$ php pkwkdownloader.php -p [adminpass] -un [read username] -up [read userpass] -k attach -d attach/ http://example.com/pukiwiki/index.php' . "\n"; $help .= '$ php pkwkdownloader.php --format -d html/ -s relative http://example.com/pukiwiki/index.php' . "\n"; $help .= 'Please see http://lsx.sourceforge.jp/?pkwkdownloader.php for further details' . "\n"; $help .= 'NOTE: PukiWiki Plus! requires adminpss always. This must be fixed in the future.' . "\n"; print $help; exit; } while (($arg = next($argv)) !== FALSE) { // skip $argv[0] switch ($arg) { case '-d': case '--directory-prefix': $GLOBALS['DOWNDIR'] = next($argv); if (strrpos($GLOBALS['DOWNDIR'], '/') !== strlen($GLOBALS['DOWNDIR']) - 1) { $GLOBALS['DOWNDIR'] .= '/'; } break; case '-k': case '--kind': $GLOBALS['SOURCEKIND'] = next($argv); break; case '-c': case '--continue': $GLOBALS['CONTINUE'] = TRUE; break; case '-w': case '--waittime': $GLOBALS['WAITTIME'] = next($argv); break; case '-p': case '--password': $GLOBALS['ADMINPASS'] = next($argv); break; case '-un': case '--username': $GLOBALS['USERNAME'] = next($argv); break; case '-up': case '--userpass': $GLOBALS['USERPASS'] = next($argv); break; case '-g': case '--filter': $GLOBALS['FILTER'] = next($argv); break; case '-v': case '--except': $GLOBALS['EXCEPT'] = next($argv); break; case '-m': case '--format': $GLOBALS['FORMAT'] = TRUE; break; case '-s': case '-=urlstyle': $GLOBALS['URLSTYLE'] = next($argv); break; case '-e': case '--encode': $GLOBALS['ENCODE'] = next($argv); break; case '-p': case '-publichome': $GLOBALS['PUBLICHOME'] = next($argv); break; default: $GLOBALS['PKWKURL'] = $arg; $GLOBALS['PKWKBASEURL'] = substr($GLOBALS['PKWKURL'], 0, strrpos($GLOBALS['PKWKURL'], '/')) . '/'; break; } } if ($GLOBALS['PKWKURL'] === '') { print 'No PukiWiki Top URL was specified. exit. '; exit; } if ($GLOBALS['FORMAT']) { format_html(); exit; } switch ($GLOBALS['SOURCEKIND']) { case 'attach': downattach(); break; case 'html': downhtml(); break; case 'wiki': default: downwiki(); break; } }
<?php include "../../include.php"; if (url_action("delete")) { db_query("UPDATE press_releases SET \n\t\t\t\tdeleted_date = GETDATE(),\n\t\t\t\tdeleted_user = {$_SESSION["user_id"]},\n\t\t\t\tis_active = 0\n\t\t\tWHERE id = " . $_GET["id"]); url_drop(); } elseif ($posting) { $theuser_id = $page['is_admin'] ? $_POST["created_user"] : $_SESSION["user_id"]; db_query("INSERT INTO press_releases (\n\t\theadline,\n\t\tdetail,\n\t\tlocation,\n\t\treleaseDate,\n\t\ttext,\n\t\tcorporationID,\n\t\tcreated_date,\n\t\tcreated_user,\n\t\tis_active\n\t) VALUES (\n\t\t'" . $_POST["headline"] . "',\n\t\t'" . $_POST["detail"] . "',\n\t\t'" . $_POST["location"] . "',\n\t\t" . format_post_date("releaseDate") . ",\n\t\t'" . format_html($_POST["text"]) . "',\n\t\t" . $_POST["corporationID"] . ",\n\t\tGETDATE(),\n\t\t" . $theuser_id . ",\n\t\t1\n\t)"); url_change(); } echo drawTop(); if (url_id()) { $r = db_grab("SELECT\n\t\t\theadline,\n\t\t\tdetail,\n\t\t\tlocation,\n\t\t\ttext,\n\t\t\treleaseDate\n\t\tFROM press_releases\n\t\tWHERE id = " . $_GET["id"]); ?> <table class="left" cellspacing="1"> <?php if ($page['is_admin']) { echo drawHeaderRow("Press Release", 1, "edit", "edit/?id=" . $_GET["id"]); } else { echo drawHeaderRow("Press Release", 1); } ?> <tr> <td style="padding:20px;" class="text"> <h1><?php echo $r["headline"]; ?> </h1> <b><?php echo $r["detail"];
function print_namespace($item, $name, $fullkey, $islast) { global $config, $server, $redis; // Is this also a key and not just a namespace? if (isset($item['__phpredisadmin__'])) { // Unset it so we won't loop over it when printing this namespace. unset($item['__phpredisadmin__']); $class = array(); $len = false; if (isset($_GET['key']) && $fullkey == $_GET['key']) { $class[] = 'current'; } if ($islast) { $class[] = 'last'; } // Get the number of items in the key. if (!isset($config['faster']) || !$config['faster']) { switch ($redis->type($fullkey)) { case 'hash': $len = $redis->hLen($fullkey); break; case 'list': $len = $redis->lLen($fullkey); break; case 'set': $len = $redis->sCard($fullkey); break; case 'zset': $len = $redis->zCard($fullkey); break; } } ?> <li<?php echo empty($class) ? '' : ' class="' . implode(' ', $class) . '"'; ?> > <a href="?view&s=<?php echo $server['id']; ?> &d=<?php echo $server['db']; ?> &key=<?php echo urlencode($fullkey); ?> "><?php echo format_html($name); if ($len !== false) { ?> <span class="info">(<?php echo $len; ?> )</span><?php } ?> </a> </li> <?php } // Does this namespace also contain subkeys? if (count($item) > 0) { ?> <li class="folder<?php echo $fullkey === '' ? '' : ' collapsed'; echo $islast ? ' last' : ''; ?> "> <div class="icon"><?php echo format_html($name); ?> <span class="info">(<?php echo count($item); ?> )</span> <?php if ($fullkey !== '') { ?> <a href="delete.php?s=<?php echo $server['id']; ?> &d=<?php echo $server['db']; ?> &tree=<?php echo urlencode($fullkey); ?> :" class="deltree"><img src="images/delete.png" width="10" height="10" title="Delete tree" alt="[X]"></a><?php } ?> </div><ul> <?php $l = count($item); foreach ($item as $childname => $childitem) { // $fullkey will be empty on the first call. if ($fullkey === '') { $childfullkey = $childname; } else { $childfullkey = $fullkey . $server['seperator'] . $childname; } print_namespace($childitem, $childname, $childfullkey, --$l == 0); } ?> </ul> </li> <?php } }
</p> <?php } ?> <table> <tr><th><div>Key</div></th><th><div>Value</div></th></tr> <?php foreach ($info as $key => $value) { if ($key == 'allocation_stats') { // This key is very long to split it into multiple lines $value = str_replace(',', ",\n", $value); } ?> <tr <?php echo $alt ? 'class="alt"' : ''; ?> ><td><div><?php echo format_html($key); ?> </div></td><td><pre><?php echo format_html(is_array($value) ? print_r($value, true) : $value); ?> </pre></td></tr> <?php $alt = !$alt; } ?> </table> <?php require 'includes/footer.inc.php';
<input type="text" name="hkey" id="hkey" size="30" maxlength="30" <?php echo isset($_GET['hkey']) ? 'value="'.format_html($_GET['hkey']).'"' : ''?>> </p> <p id="indexp"> <label for="index">Index:</label> <input type="text" name="index" id="index" size="30" <?php echo isset($_GET['index']) ? 'value="'.format_html($_GET['index']).'"' : ''?>> <span class="info">empty to append, -1 to prepend</span> </p> <p id="scorep"> <label for="score">Score:</label> <input type="text" name="score" id="score" size="30" <?php echo isset($_GET['score']) ? 'value="'.format_html($_GET['score']).'"' : ''?>> </p> <p> <label for="value">Value:</label> <textarea name="value" id="value" cols="80" rows="20"><?php echo nl2br(format_html($value))?></textarea> </p> <input type="hidden" name="oldvalue" value="<?php echo format_html($value)?>"> <p> <input type="submit" class="button" value="<?php echo $edit ? 'Edit' : 'Add'?>"> </p> </form> <?php require 'footer.inc.php'; ?>
top.location.href = top.location.pathname+'?overview&s=<?php echo $server['id']; ?> '; </script> <?php require 'includes/footer.inc.php'; die; } $page['css'][] = 'frame'; $page['js'][] = 'frame'; require 'includes/header.inc.php'; ?> <h2>Import</h2> <form action="<?php echo format_html($_SERVER['REQUEST_URI']); ?> " method="post"> <p> <label for="commands">Commands:<br> <br> <span class="info"> Valid are:<br> SET<br> HSET<br> LPUSH<br> RPUSH<br> LSET<br> SADD<br> ZADD
function db_enter($table, $fields, $index = "id") { global $editing, $language, $user; $fields = explode(" ", $fields); foreach ($fields as $field) { if ($field == "password") { //binary password if ($editing) { $query1[] = $field . " = PWDENCRYPT('" . $_POST[$field] . "')"; } else { $query1[] = $field; $query2[] = $field . " = PWDENCRYPT('" . $_POST[$field] . "')"; } } elseif (substr($field, 0, 1) == "#") { //numeric $field = substr($field, 1); if (empty($_POST[$field])) { $_POST[$field] = "NULL"; } if ($editing) { $query1[] = $field . " = " . $_POST[$field]; } else { $query1[] = $field; $query2[] = $_POST[$field]; } } elseif (substr($field, 0, 1) == "*") { //date $field = substr($field, 1); if (isset($_POST["no" . $field])) { if ($editing) { $query1[] = $field . " = NULL"; } else { $query1[] = $field; $query2[] = "NULL"; } } else { if ($editing) { $query1[] = $field . " = " . format_post_date($field); } else { $query1[] = $field; $query2[] = format_post_date($field); } } } elseif (substr($field, 0, 1) == "@") { //file $field = substr($field, 1); if (isset($_POST[$field])) { //file posting is optional, from a php point of view if ($editing) { $query1[] = $field . " = " . format_binary($_POST[$field]); } else { $query1[] = $field; $query2[] = format_binary($_POST[$field]); } } } elseif (substr($field, 0, 1) == "|") { //html $field = substr($field, 1); if (isset($_POST[$field])) { if ($editing) { $query1[] = $field . " = " . format_html($_POST[$field]); } else { $query1[] = $field; $query2[] = "'" . format_html($_POST[$field]) . "'"; } } } else { //text $_POST[$field] = trim($_POST[$field]); $_POST[$field] = empty($_POST[$field]) ? "NULL" : "'" . $_POST[$field] . "'"; if ($editing) { $query1[] = $table . '.' . $field . " = " . $_POST[$field]; } else { $query1[] = $table . '.' . $field; $query2[] = $_POST[$field]; } } } if ($editing) { $query1[] = "updatedOn = GETDATE()"; if (isset($_POST["updatedBy"])) { $query1[] = "updatedBy = " . $_POST["updatedBy"]; } else { $query1[] = "updatedBy = " . $user["id"]; } db_query("UPDATE " . $table . " SET " . implode(", ", $query1) . " WHERE " . $index . " = " . $_GET["id"]); return $_GET["id"]; } else { $query1[] = "createdOn"; $query2[] = "GETDATE()"; $query1[] = "createdBy"; $query2[] = isset($_POST["createdBy"]) ? $_POST["createdBy"] : $user["id"]; $query1[] = "isActive"; $query2[] = 1; $r = db_query("INSERT INTO " . $table . " ( " . implode(", ", $query1) . " ) VALUES ( " . implode(", ", $query2) . ")"); return $r; } }
require 'header.inc.php'; ?> <h2>Edit TTL</h2> <form action="<?php echo format_html($_SERVER['REQUEST_URI']); ?> " method="post"> <p> <label for="key">Key:</label> <input type="text" name="key" id="key" size="30" <?php echo isset($_GET['key']) ? 'value="' . format_html($_GET['key']) . '"' : ''; ?> > </p> <p> <label for="ttl"><abbr title="Time To Live">TTL</abbr>:</label> <input type="text" name="ttl" id="ttl" size="30" <?php echo isset($_GET['ttl']) ? 'value="' . format_html($_GET['ttl']) . '"' : ''; ?> > <span class="info">(-1 to remove the TTL)</span> </p> <p> <input type="submit" class="button" value="Edit TTL"> </p> </form> <?php require 'footer.inc.php';
if (!isset($info[$i]['Memory'])) { $info[$i]['Memory'] = array('used_memory' => $info[$i]['used_memory']); } } } $page['css'][] = 'frame'; $page['js'][] = 'frame'; require 'includes/header.inc.php'; ?> <?php foreach ($config['servers'] as $i => $server) { ?> <div class="server"> <h2><?php echo isset($server['name']) ? format_html($server['name']) : format_html($server['host']); ?> </h2> <?php if (!$info[$i]) { ?> <div style="text-align:center;color:red">Server Down</div> <?php } else { ?> <table> <tr><td><div>Redis version:</div></td><td><div><?php echo $info[$i]['Server']['redis_version'];
<br /> 到达服务器限制的临界值: <?php echo $db_size_critical; ?> </p> <input type="button" value="加载数据" onClick="loadTree(this)" /> <?php } ?> </div> <!-- #keys --> <div id="frame"> <iframe src="<?php echo format_html($iframe_url); ?> " id="iframe" name="iframe" frameborder="0" scrolling="0"></iframe> </div> <!-- #frame --> </div> <!-- #sidebar --> <script type="text/javascript"> var _global = _global || {}; <?php $uri = $_SERVER['QUERY_STRING']; $uri_arr = explode('&', $uri); $unset_arr = array('c', 'm', 'key'); foreach ($uri_arr as $k => $v) {
<?php include "include.php"; if ($posting) { db_query('DELETE FROM it_system_status'); db_query('INSERT INTO it_system_status ( message, updated_date, updated_user ) VALUES ("' . format_html($_POST['helpdesk_status']) . '", GETDATE(),' . user() . ')'); url_change('./'); } echo drawTop(); echo lib_get('tinymce'); echo draw_javascript_src('/_intranet.seedco.site/lib/tinymce/tinymce_3_3_8/tiny_mce.js'); echo draw_javascript('form_tinymce_init("/css/tinymce-helpdesk-status.css", true);'); ?> <table class="left" cellspacing="1"> <form action="<?php echo $request["path_query"]; ?> " method="post"> <?php echo drawHeaderRow("Update Status Message"); ?> <tr> <td><?php echo draw_form_textarea("helpdesk_status", $helpdeskStatus, "tinymce", false); ?> </td> </tr> <tr> <td class="bottom"><?php echo draw_form_submit("update message"); ?>
<li> Example: <a href="<?php echo HtmlSpecialChars($example_url); ?> "><?php echo HtmlSpecialChars($example_url); ?> </a> </li> <?php } ?> <?php foreach ($endpoint['notes'] as $note) { ?> <li><?php echo format_html($note); ?> </li> <?php } ?> <?php if ($endpoint['discovery']) { ?> <li> Supports discovery via <code><link></code> tags </li> <?php } ?> </ul> <?php
<tr> <td><div>大小(Size):</div></td> <td><div><?php echo $size; ?> <?php echo $type == 'string' ? '字符' : '项'; ?> </div></td> </tr> </table> <br /> <table> <tr> <td><div><?php echo nl2br(format_html($values)); ?> </div></td> <td> <div> <a href="<?php echo manager_site_url('edit', 'index', 'key=' . urlencode($key) . '&type=string'); ?> "> <img src="<?php echo base_url('static/images/edit.png'); ?> " width="16" height="16" title="编辑" alt="编辑" /> </a> </div> </td>
function get_other_info($content, $args) { if (!$content) { return false; } extract($args); if (!$from_get_rules && !$author_get_rules && !$dateline_get_rules) { return false; } $html = get_htmldom_obj($content); if (!$html) { return false; } if ($from_get_rules) { if ($from_get_type == 1) { $re['from'] = dom_get_str($html, $from_get_rules); } else { $re['from'] = str_get_str($content, $from_get_rules, 'data'); } } if ($author_get_rules) { if ($author_get_type == 1) { $re['author'] = dom_get_str($html, $author_get_rules); } else { $re['author'] = str_get_str($content, $author_get_rules, 'data'); } } if ($dateline_get_rules) { if ($dateline_get_type == 1) { $re['article_dateline'] = dom_get_str($html, $dateline_get_rules); unset($div); } else { $re['article_dateline'] = str_get_str($content, $dateline_get_rules, 'data'); } } foreach ((array) $re as $k => $v) { $re[$k] = format_html($v); } $html->clear(); unset($html); return $re; }
require 'footer.inc.php'; die; } $page['css'][] = 'frame'; $page['js'][] = 'frame'; require 'header.inc.php'; ?> <h2>Import</h2> <form action="<?php echo format_html($_SERVER['REQUEST_URI'])?>" method="post"> <p> <label for="commands">Commands:<br> <br> <span class="info"> Valid are:<br> SET<br> HSET<br> RPUSH<br> SADD<br> ZADD </span> </label> <textarea name="commands" id="commands" cols="80" rows="20"></textarea> </p>
$alt = !$alt; } ?> <?php } else { if ($type == 'zset') { ?> <table> <tr><th><div>Score</div></th><th><div>Value</div></th><th><div> </div></th><th><div> </div></th></tr> <?php foreach ($values as $value) { $score = $redis->zScore($_GET['key'], $value); $display_value = $redis->exists($value) ? '<a href="view.php?s=' . $server['id'] . '&key=' . urlencode($value) . '">' . nl2br(format_html($value)) . '</a>' : nl2br(format_html($value)); ?> <tr <?php echo $alt ? 'class="alt"' : ''; ?> ><td><div><?php echo $score; ?> </div></td><td><div><?php echo $display_value; ?> </div></td><td><div> <a href="edit.php?s=<?php echo $server['id']; ?> &type=zset&key=<?php
<?php $alt = !$alt; } ?> <?php } // ZSet else if ($type == 'zset') { ?> <table> <tr><th><div>Score</div></th><th><div>Value</div></th><th><div> </div></th><th><div> </div></th></tr> <?php foreach ($values as $value) { $score = $redis->zScore($_GET['key'], $value); ?> <tr <?php echo $alt ? 'class="alt"' : ''?>><td><div><?php echo $score?></div></td><td><div><?php echo nl2br(format_html($value))?></div></td><td><div> <a href="edit.php?s=<?php echo $server['id']?>&type=zset&key=<?php echo urlencode($_GET['key'])?>&score=<?php echo $score?>&value=<?php echo urlencode($value)?>"><img src="images/edit.png" width="16" height="16" title="Edit" alt="[E]"></a> <a href="delete.php?s=<?php echo $server['id']?>&type=zset&key=<?php echo urlencode($_GET['key'])?>&value=<?php echo urlencode($value)?>" class="delval"><img src="images/delete.png" width="16" height="16" title="Delete" alt="[X]"></a> </div></td></tr> <?php $alt = !$alt; } ?> <?php } if ($type != 'string') { ?> </table> <p> <a href="edit.php?s=<?php echo $server['id']?>&type=<?php echo $type?>&key=<?php echo urlencode($_GET['key'])?>" class="add">Add another value</a>