function check_login() { $login_name = safe_convert($this->getPost('login_name')); $login_pass = $this->getPost('login_pass'); $remember_pass = $this->getPost('remember_pass'); $normal = $this->getPost('normal'); if ($this->setting->get_conf('system.enable_login_captcha')) { $captcha =& loader::lib('captcha'); if (!$captcha->check($this->getPost('captcha'))) { form_ajax_failed('text', lang('invalid_captcha_code')); } } if (!$login_name) { form_ajax_failed('text', lang('username_empty')); } if (!$login_pass) { form_ajax_failed('text', lang('userpass_empty')); } if ($remember_pass) { $expire_time = time() + 86400 * 30; //记住密码30天 } else { $expire_time = 0; } $go_url = $normal ? site_link('default') : $_SERVER['HTTP_REFERER']; if ($this->user->set_login($login_name, md5($login_pass), $expire_time)) { $this->plugin->trigger('user_loged_in', $login_name); //登录时检查更新 if ($this->setting->get_conf('system.enable_auto_update')) { check_update(); } form_ajax_success('box', lang('login_success'), null, 0.5, $go_url); } else { form_ajax_failed('text', lang('username_pass_error')); } }
$cformsSettings['global']['cforms_root'] = get_cf_plugindir() . $cformsSettings['global']['plugindir']; $cformsSettings['global']['tinyURI'] = get_option('siteurl') . '/wp-includes/js/tinymce'; $cformsSettings['global']['cforms_root_dir'] = dirname(__FILE__); $cformsSettings['global']['cforms_IIS'] = strpos(dirname(__FILE__), '\\') !== false ? '\\' : '/'; $cformsSettings['global']['v'] = $localversion; ### Common HTML message information $cformsSettings['global']['cforms_style_title'] = 'font:normal 0.8em Verdana; text-align:right; color:#777; margin:3px 0'; $cformsSettings['global']['cforms_style_table'] = 'background:#F4F5FB; color:#666; font-size:1em; font-family:verdana;'; $cformsSettings['global']['cforms_style_fs_td'] = 'font-size:105%; font-variant:small-caps; letter-spacing:2px; border-bottom:2px solid #E6E8F7; padding:6px 2px 6px 4px; background:#EFF0FA;'; $cformsSettings['global']['cforms_style_fsend_td'] = 'background:#E6E8F7; font-size:0px; line-height:2px; height:2px;'; $cformsSettings['global']['cforms_style_fsendSP_td'] = 'font-size:0px; line-height:2px; height:4px;'; $cformsSettings['global']['cforms_style_key_td'] = 'color:#000; font-size:90%; white-space:nowrap; padding:4px 20px 4px 15px; vertical-align:top;'; $cformsSettings['global']['cforms_style_val_td'] = 'font-size:90%; width:100%;'; $cformsSettings['global']['cforms_style_cforms'] = 'font:normal 10px Arial; color:#777;'; ### check for upgrade pre-9.0 to 9.0 if (check_update()) { return; } ### file upload setINI('form', 'cforms_upload_dir', defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR . '/plugins/' . basename(dirname(__FILE__)) : ABSPATH . 'wp-content/plugins/' . basename(dirname(__FILE__)) . '/attachments'); setINI('form', 'cforms_upload_ext', 'txt,zip,doc,rtf,xls'); setINI('form', 'cforms_upload_size', '1024'); setINI('form', 'cforms_dontclear', false); ### tracking settings setINI('form', 'cforms_rsskey', md5(rand())); setINI('form', 'cforms_rss', false); setINI('form', 'cforms_rss_count', 5); ### fields for default form setINI('form', 'cforms_count_fields', '5'); setINI('form', 'cforms_count_field_1', __('My Fieldset', 'cforms') . '$#$fieldsetstart$#$0$#$0$#$0$#$0$#$0'); setINI('form', 'cforms_count_field_2', __('Your Name|Your Name', 'cforms') . '$#$textfield$#$1$#$0$#$1$#$0$#$0');
if (!check_setup($prefix . "mods", $database) && check_setup($prefix . "preferences", $database)) { $setup_success = FALSE; $setup_relocate = "Location: " . $base_url . "update.php"; } elseif (MAINT) { $setup_success = FALSE; $setup_relocate = "Location: " . $base_url . "maintenance.php"; } if (check_setup($prefix . "system", $database)) { mysql_select_db($database, $brewing); $query_version_check = sprintf("SELECT version FROM %s WHERE id='1'", $prefix . "system"); $version_check = mysql_query($query_version_check, $brewing) or die(mysql_error()); $row_version_check = mysql_fetch_assoc($version_check); // For 2.0.1.0 and update is NOT needed // For updating to 2.0.0, check if "sponsorEnable" column is in the sponsors table // If so, run the update if (!check_update("sponsorEnable", $prefix . "sponsors")) { $update_required = TRUE; $setup_success = FALSE; $setup_relocate = "Location: " . $base_url . "update.php"; } if ($row_version_check['version'] != $current_version) { // Run update scripts if required if ($update_required) { $setup_success = FALSE; $setup_relocate = "Location: " . $base_url . "update.php"; } else { $updateSQL = sprintf("UPDATE %s SET version='%s', version_date='%s' WHERE id='1'", $prefix . "system", $current_version, "2016-02-15"); mysql_select_db($database, $brewing); mysql_real_escape_string($updateSQL); $result1 = mysql_query($updateSQL, $brewing) or die(mysql_error()); $setup_relocate = "Location: " . $base_url;
function admin_data_management() { global $framework_version; ?> <div id="optionsframework-metabox" class="metabox-holder"> <div id="optionsframework" class="postbox store-holder"> <div class="wrap"> <h3><?php echo theme_locals("data_management"); ?> </h3> <div class="data_management"> <p><?php echo theme_locals("info_box_1"); ?> </p> <div class="theme_box"> <h4><?php echo theme_locals('cherry_framework'); ?> </h4> <?php if (FILE_WRITEABLE) { ?> <div class="error"><p><?php echo theme_locals("info_box_2"); ?> </p></div> <?php } ?> <div class="controls framework_info"> <span class="data_label"><?php echo theme_locals("name"); ?> :</span><span class="data_val"><?php echo get_theme_info(PARENT_NAME, 'Name'); ?> </span><br> <span class="data_label"><?php echo theme_locals("author"); ?> :</span><span class="data_val"><?php echo get_theme_info(PARENT_NAME, 'Author'); ?> </span><br> <span class="data_label"><?php echo theme_locals("your_version"); ?> :</span><span id="your_version_<?php echo PARENT_NAME; ?> " class="data_val"><?php echo $framework_version; ?> </span><br> <span class="data_label"><?php echo theme_locals("update_version"); ?> :</span><span id="update_version" class="data_val"><?php echo check_update(); ?> </span><br> <span class="data_label"><?php echo theme_locals("backup_version"); ?> :</span><span id="version_<?php echo PARENT_NAME; ?> " class="data_val"><?php echo get_file_date(PARENT_NAME)->backup_version; ?> </span><br> <span class="data_label"><?php echo theme_locals("backup_date"); ?> :</span><span id="date_<?php echo PARENT_NAME; ?> " class="data_val"><?php echo get_file_date(PARENT_NAME)->date; ?> </span><br> <span class="data_label"><?php echo theme_locals("description"); ?> :</span><span class="data_val"><?php echo get_theme_info(PARENT_NAME, 'Description'); ?> </span><br> <?php add_radio_button(get_theme_info(PARENT_NAME, 'Template'), "", true); ?> </div> <?php if (FILE_WRITEABLE) { ?> <div class="buttons_controls"> <div class="button_wrapper"> <?php $update_url = wp_nonce_url('update.php?action=upgrade-theme&theme=' . urlencode(PARENT_NAME), 'upgrade-theme_' . urlencode(PARENT_NAME)); $disable_class = ""; $cap = ""; if ($framework_version >= check_update()) { $cap = '<span class="cap"></span>'; $disable_class = "disable_button"; } echo "<a id=\"update_framework\" class=\"button-primary " . $disable_class . "\" href=\"" . $update_url . "\" onclick=\"if ( confirm('Updating this theme will lose any customizations you have made. \\'Cancel\\' to stop, \\'OK\\' to update.') ) {return true;}return false;\">" . theme_locals("update") . "</a>" . $cap; ?> </div> <div class="button_wrapper"> <a class="button-primary backup_theme" href="<?php echo PARENT_NAME; ?> " title="<?php echo theme_locals('backup'); ?> "><?php echo theme_locals("backup"); ?> </a> </div> <div class="button_wrapper"> <a class="button-primary restore_theme " href="<?php echo PARENT_NAME; ?> " title="<?php echo theme_locals('restore'); ?> "><?php echo theme_locals("restore"); ?> </a> </div> <div class="button_wrapper"> <a class="button-primary download_backup" href="<?php echo PARENT_NAME; ?> " title="<?php echo theme_locals('download_backup'); ?> "><?php echo theme_locals("download_backup"); ?> </a> </div> </div> <?php } else { printf('<p><em>' . theme_locals('warning_notice_1') . ' ' . theme_locals('warning_notice_3') . '</em></p>'); } ?> </div> <?php $themes_dir = get_theme_root(); $themes = scandir($themes_dir); $themes_array = array(); foreach ($themes as $theme) { if (is_dir("{$themes_dir}/{$theme}")) { if (strtolower(get_theme_info($theme, 'Template')) == 'cherryframework' && strtolower($theme) != 'cherryframework') { array_push($themes_array, $theme); } } } if (count($themes_array) != 0) { ?> <div class="theme_box"> <h4><?php echo theme_locals("child_theme"); ?> </h4> <div class="controls child_theme"> <div class="child_theme_title"> <span class="select"> </span> <span class="child_preview"><?php echo theme_locals("preview"); ?> </span> <span class="name"><?php echo theme_locals("name"); ?> </span> <span class="date"><?php echo theme_locals("backup_date"); ?> </span> </div> <div class="child_theme_list"> <?php $input_checked = true; foreach ($themes_array as $theme) { echo '<label>'; echo '<span class="select">'; add_radio_button($theme, "theme_name", $input_checked); if ($input_checked) { $input_checked = false; } echo '</span>'; echo '<span class="child_preview">'; if (file_exists($themes_dir . "/{$theme}/screenshot.png")) { echo '<img src="' . get_theme_root_uri() . "/{$theme}/screenshot.png" . '" alt="' . $theme . '">'; } echo '</span>'; echo '<span class="name">' . $theme . '</span>'; echo '<span id="date_' . $theme . '" class="date">' . get_file_date($theme)->date . '</span>'; echo '</label>'; $not_child_theme = false; } ?> </div> </div> <?php if (FILE_WRITEABLE) { ?> <div class="buttons_controls"> <div class="button_wrapper"> <a class="button-primary backup_theme" href="CherryFramework" title="<?php echo theme_locals('backup'); ?> "><?php echo theme_locals("backup"); ?> </a> </div> <div class="button_wrapper"> <a class="button-primary restore_theme" href="CherryFramework" title="<?php echo theme_locals('restore'); ?> "><?php echo theme_locals("restore"); ?> </a> </div> <div class="button_wrapper"> <a class="button-primary download_backup" href="CherryFramework" title="<?php echo theme_locals('download_backup'); ?> "><?php echo theme_locals("download_backup"); ?> </a> </div> </div> <?php } else { printf('<p><em>' . theme_locals('warning_notice_1') . ' ' . theme_locals('warning_notice_3') . '</em></p>'); } ?> </div> <?php } ?> </div> </div> </div> </div> <?php }
include 'functions.php'; include 'connect.php'; //Include database connection /* Create the table Purchase_List if it does not exist.*/ $query = " SHOW TABLES LIKE 'Purchase_List' "; $result = mysqlQuery_Result($connection, $query); if (mysqli_num_rows($result) == 0) { $query = "CREATE TABLE Purchase_List ( "; $query .= "\tPurchase_ID INT UNSIGNED AUTO_INCREMENT, "; $query .= "\tIP VARCHAR(15) , "; $query .= "\tCountry_Name VARCHAR(20), "; $query .= "\tPRIMARY KEY(Purchase_ID)) "; mysqlQuery($connection, $query); } /* auto update GeoIP database, if it is not latest one. */ check_update($dbname, $connection); ?> <html lang="en"> <head> <title>IP Location Lookup</title> <meta charset="utf-8"> <link rel="stylesheet" href="css/style.css" type="text/css" media="all"> <script type="text/javascript" src="js/javascript.js" ></script> </head> <body id="page1"> <div class="main"> <header> <div class="wrapper">
function check_update() { $response = check_update(); if (!$response) { $data = lang('connect_to_server_failed'); } else { if ($response['return'] == 'lastest') { $data = lang('your_system_is_up_to_date'); } elseif ($response['return'] == 'new') { $newversion = $response['version']; $publish_date = $response['pubdate']; $data = lang('new_update_available', $newversion, $publish_date) . '<a href="' . site_link('update', 'core', array('version' => $newversion)) . '">' . lang('update_immediately') . '</a> ' . lang('or') . ' <a href="' . $response['package'] . '">' . lang('update_manually') . '</a>'; } else { $data = lang('connect_to_server_failed'); } } ajax_box($data, lang('check_update')); }
function _load_module_updater() { require_once SYSTEM_ROOT . './function/updater.php'; check_update(); }
if (isset($_GET['op'])) { $op = $_GET['op']; } if (isset($_POST['op'])) { $op = $_POST['op']; } $page = isset($_GET['page']) ? $_GET['page'] : 1; $start = $page > 1 ? ($page - 1) * $xoopsModuleConfig['list_max'] : 0; $myts =& MyTextSanitizer::getInstance(); $tblstyle = "border='0' cellspacing='1' cellpadding='3' class='outer' width='100%'"; switch ($op) { case 'edit_update': edit_update(); exit; case 'check_update': check_update(); exit; } if (!empty($_GET['lib'])) { global $mydirpath; $mydirpath = dirname(dirname(__FILE__)); $mydirname = basename($mydirpath); // common libs (eg. altsys) $lib = preg_replace('/[^a-zA-Z0-9_-]/', '', $_GET['lib']); $page = preg_replace('/[^a-zA-Z0-9_-]/', '', @$_GET['page']); if (file_exists(XOOPS_TRUST_PATH . '/libs/' . $lib . '/' . $page . '.php')) { include XOOPS_TRUST_PATH . '/libs/' . $lib . '/' . $page . '.php'; } else { if (file_exists(XOOPS_TRUST_PATH . '/libs/' . $lib . '/index.php')) { include XOOPS_TRUST_PATH . '/libs/' . $lib . '/index.php'; } else {
/** * Fais la mise à jour vers la dernière version disponible * @param $force Force la mise à jour si TRUE */ function do_update($force) { // We must be sure there is an update available if (check_update() || $force) { // Extract "/dir/of/web/server" from "/dir/of/web/server/cakebox" $update_dir = escapeshellarg(substr(getcwd(), 0, strpos(getcwd(), "/cakebox"))); exec("bash scripts/patch_update {$update_dir}"); sleep(1); // let time before redirection header('Location:index.php?update_done'); } }
exit(0); } $data = read_testdata($probid); // Reorder testcases if (isset($_GET['move'])) { reorder_case($_GET['rank'], $_GET['move'], $data, $probid); // Redirect to the original page to prevent accidental redo's header('Location: testcase.php?probid=' . urlencode($probid)); return; } $title = 'Testcases for problem p' . specialchars(@$probid) . ' - ' . specialchars($prob['name']); $result = ''; if (isset($_POST['probid']) && IS_ADMIN) { $maxrank = 0; foreach ($data as $rank => $row) { $result .= check_update($probid, $rank, $FILES); if ($rank > $maxrank) { $maxrank = $rank; } } $result .= check_add($probid, $maxrank + 1, $FILES); } if (!empty($result)) { // Reload testcase data after updates $data = read_testdata($probid); } // Check if ranks must be renumbered (if test cases have been deleted). // There is no need to run this within one MySQL transaction since // nothing depends on the ranks being sequential, and we do preserve // their order while renumbering. end($data);
mysql_real_escape_string($updateSQL2); $result2 = mysql_query($updateSQL2, $brewing); } if (!check_update("contestCheckInPassword", $prefix . "contest_info")) { $updateSQL3 = "ALTER TABLE `" . $prefix . "contest_info` ADD `contestCheckInPassword` VARCHAR(255) NULL DEFAULT NULL;"; mysql_select_db($database, $brewing); mysql_real_escape_string($updateSQL3); $result3 = mysql_query($updateSQL3, $brewing); } if (!check_update("contestDropoffOpen", $prefix . "contest_info")) { $updateSQL4 = "ALTER TABLE `" . $prefix . "contest_info` CHANGE `contestCategories` `contestDropoffOpen` VARCHAR(255) NULL DEFAULT NULL;"; mysql_select_db($database, $brewing); mysql_real_escape_string($updateSQL4); $result4 = mysql_query($updateSQL4, $brewing); } if (!check_update("contestDropoffDeadline", $prefix . "contest_info")) { $updateSQL5 = "ALTER TABLE `" . $prefix . "contest_info` CHANGE `contestWinnersComplete` `contestDropoffDeadline` VARCHAR(255) NULL DEFAULT NULL;"; mysql_select_db($database, $brewing); mysql_real_escape_string($updateSQL5); $result5 = mysql_query($updateSQL5, $brewing); } $output .= "<li>Competition info table altered successfully.</li>"; // ----------------------------------------------------------- // Alter Table: Brewer // Adding judge experience // Add judge notes to organizers // ----------------------------------------------------------- $updateSQL4 = "ALTER TABLE `" . $prefix . "brewer` CHANGE `brewerJudgeAssignedLocation` `brewerJudgeExp` VARCHAR(25) NULL DEFAULT NULL;"; mysql_select_db($database, $brewing); mysql_real_escape_string($updateSQL4); $result4 = mysql_query($updateSQL4, $brewing);
</head> <body> <!-- HEADER --> <header> <div id="logo"> <a href="index.php"> <span class="first">Cake</span> <span class="second">Box</span> </a> </div> </header> <!-- / HEADER --> <?php // Verify if Cakebox is up to date if ($update_info = check_update()) { show_update($update_info); } // Show a message after an update if (isset($_GET['update_done'])) { show_update_done(); } ?> <!-- CONTENT --> <section id="content"> <?php // Test chmod of main directories check_dir();