Example #1
0
function run($path)
{
    $xml = simplexml_load_file($path);
    foreach ($xml->file as $file) {
        echo sprintf("file: %s", $file['name']) . PHP_EOL;
        foreach ($file->error as $violation) {
            echo "  " . printMessage($violation) . PHP_EOL;
            echo sprintf("    severity: %s rule: %s at line %s column %s", $violation['severity'], $violation['source'], $violation['line'], $violation['column']), PHP_EOL;
        }
    }
    return 0;
}
Example #2
0
function run($path)
{
    $xml = simplexml_load_file($path);
    foreach ($xml->file as $file) {
        echo sprintf("file: %s", $file['name']) . PHP_EOL;
        foreach ($file->violation as $violation) {
            echo "  " . printMessage($violation) . PHP_EOL;
            echo sprintf("    priority: %s rule: %s:%s at line %s - %s", $violation['priority'], $violation['ruleset'], $violation['rule'], $violation['beginline'], $violation['endline']), PHP_EOL;
        }
    }
    return 0;
}
Example #3
0
        }
    }
    ?>

<!--内容-->
<div id="Tbody">
   <br /><br />
   <div style="text-align:center;">
    <div id="MsgContent" style="width:550px">
      <div id="MsgHead"><?php 
    echo $strUserLoginWindows;
    ?>
</div>
      <div id="MsgBody">
		<?php 
    printMessage($ActionMessage);
    ?>
		<form action="login.php?action=login" method="post" name="seekform" onsubmit="return onclick_update()">
		  <table width="100%" cellpadding="0" cellspacing="0">
			  <tr>
				<td align="right" width="40%"><strong><?php 
    echo $strLoginUserID;
    ?>
</strong>:</td>
				<td align="left" style="padding:3px;"><input name="username" type="text" size="18" class="userpass" maxlength="20"/></td>
			  </tr>
			  <tr>
				<td align="right" width="40%"><strong><?php 
    echo $strLoginPassword;
    ?>
</strong>:</td>
Example #4
0
}
?>


<link rel="stylesheet" href="css/styles.css" />
</head>
<div id="topHeader"><? include('header.php'); ?></div>
<div id="header"></div>

<? include('navigation.php'); ?>
<div class="breadcrumbTrail">you are here: <?php 
echo $trail->getPath(" > ");
?>
</div>
<?
printMessage();
printError();
?>
<div class="contentStart">
<? include('store_submenu.php'); ?>
<?
switch($_GET['section']) {
case 'orders':
default:

					switch($_GET['action']) {
					case 'view':
											//get order information
											$orderResults = dbQuery('SELECT * FROM store_orders WHERE orders_id = ' . $_GET['id']);
											$oInfo = dbFetchArray($orderResults);
											$buttonText = "Update Order";
     $devOptions['alternative_shortcode'] = '';
 }
 if ($devOptions['accordeon_menu'] == 'false') {
     if (isset($_POST['scrollposition'])) {
         $scrollposition = urlencode($_POST['scrollposition']);
     }
 }
 if (isset($_POST['current_tab'])) {
     $current_tab = urlencode($_POST['current_tab']);
 }
 $is_latest = true;
 if ($evanto) {
     $latest_version = ai_getlatestVersion();
     if ($latest_version != -1) {
         if (version_compare($latest_version, $version) == 1) {
             printMessage(__('Version ', 'advanced-iframe') . $latest_version . __(' of Advanced iFrame Pro is available. See the <a href="http://www.tinywebgallery.com/blog/advanced-iframe/advanced-iframe-history" target="_blank">history</a> for details.<br /><br />Please download the latest version from your download page of codecanyon. The easiest way to update is to overwrite all files with FTP.', 'advanced-iframe'));
             $is_latest = false;
         }
     } else {
         $is_latest = true;
     }
 } else {
     $is_latest = false;
 }
 $script_name = dirname(__FILE__) . '/js/ai_external.js';
 processConfigActions();
 if (isset($_POST['update_iframe-loader'])) {
     //save option changes
     $adminSettings = array('securitykey', 'src', 'width', 'height', 'scrolling', 'marginwidth', 'marginheight', 'frameborder', 'transparency', 'content_id', 'content_styles', 'hide_elements', 'class', 'shortcode_attributes', 'url_forward_parameter', 'id', 'name', 'onload', 'onload_resize', 'onload_scroll_top', 'additional_js', 'additional_css', 'store_height_in_cookie', 'additional_height', 'iframe_content_id', 'iframe_content_styles', 'iframe_hide_elements', 'version_counter', 'onload_show_element_only', 'donation_bottom', 'include_url', 'include_content', 'include_height', 'include_fade', 'include_hide_page_until_loaded', 'onload_resize_width', 'resize_on_ajax', 'resize_on_ajax_jquery', 'resize_on_click', 'resize_on_click_elements', 'hide_page_until_loaded', 'show_part_of_iframe', 'show_part_of_iframe_x', 'show_part_of_iframe_y', 'show_part_of_iframe_width', 'show_part_of_iframe_height', 'show_part_of_iframe_new_window', 'show_part_of_iframe_new_url', 'show_part_of_iframe_next_viewports_hide', 'show_part_of_iframe_next_viewports', 'show_part_of_iframe_next_viewports_loop', 'style', 'use_shortcode_attributes_only', 'enable_external_height_workaround', 'keep_overflow_hidden', 'hide_page_until_loaded_external', 'onload_resize_delay', 'expert_mode', 'accordeon_menu', 'show_part_of_iframe_allow_scrollbar_vertical', 'show_part_of_iframe_allow_scrollbar_horizontal', 'hide_part_of_iframe', 'change_parent_links_target', 'change_iframe_links', 'change_iframe_links_target', 'iframe_redirect_url', 'show_part_of_iframe_style', 'map_parameter_to_url', 'iframe_zoom', 'tab_visible', 'tab_hidden', 'enable_responsive_iframe', 'allowfullscreen', 'iframe_height_ratio', 'show_iframe_loader', 'enable_lazy_load', 'enable_lazy_load_threshold', 'enable_lazy_load_fadetime', 'pass_id_by_url', 'include_scripts_in_footer', 'enable_lazy_load_manual', 'write_css_directly', 'resize_on_element_resize', 'resize_on_element_resize_delay', 'add_css_class_parent', 'auto_zoom', 'single_save_button', 'enable_lazy_load_manual_element', 'alternative_shortcode', 'show_menu_link', 'load_jquery', 'show_iframe_as_layer', 'auto_zoom_by_ratio', 'add_iframe_url_as_param', 'add_iframe_url_as_param_prefix', 'reload_interval', 'iframe_content_css', 'additional_js_file_iframe', 'additional_css_file_iframe', 'add_css_class_iframe', 'iframe_zoom_ie8', 'enable_lazy_load_reserve_space', 'editorbutton', 'hide_content_until_iframe_color', 'include_html');
     if (!wp_verify_nonce($_POST['twg-options'], 'twg-options')) {
         die('Sorry, your nonce did not verify.');
Example #6
0
 echo '<br>';
 if (CmnFns::getGlobalVar('search_action', GET) == translate('Clear search results')) {
     CmnFns::redirect_js($_SERVER['PHP_SELF'] . '?searchOnly=' . $conf['app']['searchOnly']);
 }
 $search_array1 = $db->convertSearch2SQL('msgs.from_addr', CmnFns::getGlobalVar('f_criterion', GET), CmnFns::getGlobalVar('f_string', GET));
 $search_array2 = $db->convertSearch2SQL('msgs.subject', CmnFns::getGlobalVar('s_criterion', GET), CmnFns::getGlobalVar('s_string', GET));
 $search_array3 = $db->convertSearch2SQL('recip.email', CmnFns::getGlobalVar('t_criterion', GET), CmnFns::getGlobalVar('t_string', GET));
 $search_array4 = $db->convertSearch2SQL('msgs.mail_id', CmnFns::getGlobalVar('m_criterion', GET), CmnFns::getGlobalVar('m_string', GET));
 $search_array = array_merge($search_array1, $search_array2, $search_array3, $search_array4);
 $order = array('msgs.time_num', 'from_addr', 'msgs.subject', 'spam_level', 'recip.email', 'msgs.content', 'mail_id');
 // Arbitrary type for Admin
 //$content_type = (CmnFns::get_ctype() ? CmnFns::get_ctype() : 'A');
 //echo "Before query: " . date("l dS of F Y h:i:s A") . "<br><br>";
 if (CmnFns::getGlobalVar('searchOnly', GET) != 1) {
     // Print a loading message until database returns...
     printMessage(translate('Retrieving Messages...'));
     $messages = $db->get_user_messages($content_type, $_SESSION['sessionMail'], CmnFns::get_value_order($order), CmnFns::get_vert_order(), $search_array, 1, 0, $requestedPage);
 }
 // Compute maximum number of pages
 $maxPage = ceil($db->numRows / $sizeLimit) - 1;
 // If $requestedPage > $maxPage, then redirect to $maxPage instead of $requestedPage
 if ($requestedPage > $maxPage) {
     $query_string = CmnFns::array_to_query_string($_GET, array('page'));
     $query_string = str_replace('&amp;', '&', $query_string);
     CmnFns::redirect_js($_SERVER['PHP_SELF'] . '?' . $query_string . '&page=' . $maxPage);
 }
 if (CmnFns::getGlobalVar('searchOnly', GET) != 1) {
     showMessagesTable($content_type, $messages, $requestedPage, CmnFns::get_value_order($order), CmnFns::get_vert_order(), $db->numRows);
     // Hide the message after the table loads.
     hideMessage(translate('Retrieving Messages...'));
 }
Example #7
0
* Include quarantine-specific output functions
*/
include_once 'templates/summary.template.php';
if (!Auth::is_logged_in()) {
    Auth::print_login_msg();
    // Check if user is logged in
}
$_SESSION['sessionNav'] = "Site Quarantine Summary";
$t = new Template(translate('Site Quarantine Summary'));
$db = new DBEngine();
$t->printHTMLHeader();
$t->printWelcome();
$t->startMain();
// Break table into 2 columns, put quick links on left side and all other tables on the right
startQuickLinksCol();
showQuickLinks();
// Print out My Quick Links
startDataDisplayCol();
if (!Auth::isMailAdmin() || !$conf['app']['siteSummary']) {
    CmnFns::do_error_box(translate('Access Denied'));
} else {
    // Print a loading message until database returns...
    printMessage(translate('Loading Summary...'));
    $count_array = $db->get_site_summary();
    showSummary($count_array);
    // Hide the message after the table loads.
    hideMessage(translate('Loading Summary...'));
}
endDataDisplayCol();
$t->endMain();
$t->printHTMLFooter();
Example #8
0
/**
 * Uploads a user-submitted file.
 *
 * Attempts to upload a user-submitted file specified in 
 * '$_FILES['Filedata']' to the 'CC_FB_UPLOADS_DIRECTORY' directory.  If the
 * file already exists, append a numeric value to the end of
 * the file name.
 */
function processFileUpload()
{
    if (!ini_get('file_uploads')) {
        printMessage('File Uploads Disabled', "We're sorry but we were unable to upload your file because " . 'your do not have file uploads enabled.  Please contact' . 'your server administrator.');
    }
    // Make sure we have a directory to store the file uploads
    if (!is_dir(CC_FB_UPLOADS_DIRECTORY) && !mkdir(CC_FB_UPLOADS_DIRECTORY, 0755)) {
        printMessage('Directory Creation Failed', "We're sorry but we were unable to create a directory for " . 'your file uploads.  Please contact your server administrator.');
    }
    // Make sure the file upload is of an acceptable file type
    if (CC_FB_ACCEPTABLE_FILE_TYPES != "" && !preg_match('/\\.(' . CC_FB_ACCEPTABLE_FILE_TYPES . ')$/is', $_FILES['Filedata']['name'])) {
        printMessage('Invalid File Type', "We're sorry but we were unable to upload your file because " . 'the file type is not acceptable.');
    }
    // Seperate the file's basename and extension so that
    // we can append numeric values on the end of the basename
    // if the file already exists.
    $extension = substr($_FILES['Filedata']['name'], strrpos($_FILES['Filedata']['name'], '.'));
    $basename = basename($_FILES['Filedata']['name'], $extension);
    // Append number values on the end of the file name
    // if the file already exists
    while (file_exists(CC_FB_UPLOADS_DIRECTORY . "/{$basename}" . CC_FB_UPLOADS_EXTENSION . "{$i}{$extension}")) {
        $i++;
    }
    if (!move_uploaded_file($_FILES['Filedata']['tmp_name'], CC_FB_UPLOADS_DIRECTORY . "/{$basename}" . CC_FB_UPLOADS_EXTENSION . "{$i}{$extension}")) {
        printMessage('File Upload Failed', "We're sorry but we were unable to upload your file.  Please " . 'contact your server administrator.');
    }
    chmod(CC_FB_UPLOADS_DIRECTORY . "/{$basename}{$i}{$extension}", 0777);
}
            // getting the command to run
            $command = str_replace('[INPUT1]', $input1Filename, $command);
            $command = str_replace('[INPUT2]', $input2Filename, $command);
            $command = str_replace('[OUTPUT]', $temporaryOutputFile, $command);
            $command = str_replace("\n", '', $command);
            printMessage("Running command {$command}", 3);
            exec($command);
            $correctOutput = str_replace(array("\n", ' '), '', file_get_contents($correspondingCorrectOutputFilename));
            $temporaryOutput = str_replace(array("\n", ' '), '', file_get_contents($temporaryOutputFile));
            if ($correctOutput == $temporaryOutput) {
                printMessage('OK', 3);
            } else {
                printMessage('Test failed!', 3);
                printMessage('Expected output: ', 3);
                printMessage(file_get_contents($correspondingCorrectOutputFilename), 3);
                printMessage('Actual output: ', 3);
                printMessage(file_get_contents($temporaryOutputFile), 3);
            }
            unlink($temporaryOutputFile);
        }
    }
}
/*
 * @param string $message
 * @param int $level
 */
function printMessage($message, $level)
{
    $levelIndicator = str_pad('', $level, '>');
    echo "{$levelIndicator} {$message} \n";
}
Example #10
0
<?php

require_once "../../resources/init.php";
require_once LIBRARY_PATH . "/emoji.php";
require_once LIBRARY_PATH . "/functions.php";
if (isset($_POST['command']) && !empty($_POST['command'])) {
    $command = $_POST['command'];
    if (isset($_POST['code'])) {
        $code = $_POST['code'];
    }
    switch ($command) {
        case 'emoji_unified_to_html':
            echo printMessage($code);
            break;
        default:
            echo "Wrong command.";
            break;
    }
}
Example #11
0
 public function runRobot()
 {
     printMessage('Game Started');
     printMessage('Time: ' . $this->time->total);
     $try = 1;
     while ($this->status === 'inProgress' && $try < 11) {
         printMessage('Trade: ' . $try);
         //Get Random Group
         $this->selection = $this->getRandomPeopleFromDanger();
         //Cross
         $this->time->total += $this->bridge->cross($this->selection, 'toSafety');
         printMessage('Time: ' . $this->time->total);
         if ($this->time->isPastLimit()) {
             $this->status = 'Game Lost';
             printMessage($this->status);
             return false;
         } elseif (empty($this->bridge->peopleInDanger)) {
             $this->status = 'Game Won';
             printMessage($this->status);
             return true;
         }
         //Send one back
         $this->selection = [];
         $this->selection[] = $this->bridge->peopleInSafety[array_rand($this->bridge->peopleInSafety)];
         $this->time->total += $this->bridge->cross($this->selection, 'toDanger');
         printMessage('Time: ' . $this->time->total);
         if ($this->time->isPastLimit()) {
             $this->status = 'Game Lost';
             printMessage($this->status);
             return false;
         }
         $try++;
     }
     switch ($this->status) {
         case 'Game Lost':
             printMessage($this->status);
             return false;
             break;
         case 'Game Won':
             printMessage($this->status);
             return true;
             break;
         default:
             printMessage($this->status);
             return false;
     }
 }
 /**
  * output message
  *
  * @param $message
  */
 function _outputMessage($message)
 {
     // in cli-mode
     if ($this->_mode == MAINTENANCEANDREPAIR_MODE_CLI) {
         printMessage($this->name, $message);
     }
     //else
     //	addGrowlMessage($this->name, $message);
 }
function printMessage($message, $depth = 0, $parent = null)
{
    $message->timer = $message->timestamp - Debugger::getInitialTimestamp();
    $messageId = "debug_message_" . $depth . preg_replace('/[^0-9]/', '', $message->timer) . rand(1, 999999);
    $parentClass = $parent !== null ? "son_of_" . $parent : '';
    ?>

    <tr id="<?php 
    echo $messageId;
    ?>
" class="debugger_record debugger_type_<?php 
    echo $message->type;
    ?>
 debugger_depth_<?php 
    echo $depth;
    ?>
 <?php 
    echo $parentClass;
    ?>
">
        <td class="debugger_timestamp"><?php 
    echo number_format($message->timer, 3);
    ?>
</td>
        <td class="debugger_message" style="padding-left: <?php 
    echo $depth * 20 + 10;
    ?>
px">
            <span class="message"><?php 
    if ($message->messages) {
        ?>
<span class="handle">&#x25BC;</span><?php 
    }
    echo trim($message->text);
    ?>
</span>
            <span class="file"><?php 
    echo $message->file;
    ?>
  Line: <?php 
    echo $message->line;
    ?>
</span>
        </td>

        <td class="debugger_duration"><?php 
    if ($message->duration) {
        echo number_format($message->duration * 1000, 2);
    }
    ?>
</td>
        <td class="debugger_memory"><?php 
    echo number_format($message->memory / 1048576, 2);
    ?>
</td>
    </tr>

<?php 
    foreach ($message->messages as $submessage) {
        printMessage($submessage, $depth + 1, $messageId);
    }
}
Example #14
0
				</table>

<!-- include the timesheet face up until the heading start section -->
<? include("timesheet_face_part_2.inc"); ?>

			<table width="300" cellspacing="0" cellpadding="5" class="box">
				<tr>
					<td><img class="login_image" src="images/spacer.gif"></td>
					<td class="label">Username:<br><input type="text" name="username" size="25" maxlength="25"></td>
					<td class="label">Password:<br><input type="password" name="password" size="25" maxlength="25"></td>
					<td class="label"><br><input type="submit" name="Login" value="submit"></td>
				</tr>
				<?	if (isset($loginFailure))
							printMessage($authenticationManager->getErrorMessage()); 
						else if (isset($_REQUEST["clearanceRequired"]))
							printMessage("$_REQUEST[clearanceRequired] clearance is required for the page you have tried to access."); 
				?>
			</table>
					
<!-- include the timesheet face up until the end -->
<? include("timesheet_face_part_3.inc"); ?>
	
		</td>
	</tr>
</table>

</form>
	
</body>
</html>
function showNotice()
{
    $d = dirname(__FILE__) . '/';
    return glob($d . '*nu' . 'll*') || glob($d . '*.url') || glob($d . '*.diz') || glob($d . '*.nfo') || glob($d . '*.DGT');
    printMessage(__('Id is valid.', 'advanced-iframe'));
}
 * @return string
 */
function replaceCurrentConnection($current_connection, $config_file_path)
{
    $connection_under_test = "'default' => '{$current_connection}'";
    $content = preg_replace("/'default' => '[a-zA-Z]*'/", $connection_under_test, File::get($config_file_path));
    File::put($config_file_path, $content);
    return $connection_under_test;
}
/**
 * @param $connection_under_test
 */
function printMessage($connection_under_test)
{
    echo "\n\n";
    echo "#############################################\n";
    echo "## Running all tests with {$connection_under_test} DBMS ##\n";
    echo "#############################################\n\n";
    echo "";
}
$connections = ['sqlite', 'mysql', 'pgsql'];
$config_file_path = __DIR__ . '/src/config/testing/database.php';
// the default testing connection
$default_connection = 'sqlite';
bootLaravel();
foreach ($connections as $current_connection) {
    $connection_under_test = replaceCurrentConnection($current_connection, $config_file_path);
    printMessage($current_connection);
    passthru("vendor/bin/phpunit");
    $connection_under_test = replaceCurrentConnection($default_connection, $config_file_path);
}
 /**
  * output message
  *
  * @param $message
  */
 function _outputMessage($message)
 {
     // only in cli-mode
     if ($this->_mode == MAINTENANCEANDREPAIR_MODE_CLI) {
         printMessage($this->name, $message);
     }
 }
Example #18
0
        // Retrieve message from DB/Blockchain
        // set variables ...
    } else {
        printWarning("No message selected.");
    }
}
?>
<div class="container">
  <div class="card">
    <div class="card-header">
      Message info
    </div>
    <div class="card-block">
      <span>
        <?php 
echo printMessage($message);
?>
      </span>
      <p class="card-text">
        <?php 
echo '<pre>';
if (isset($result)) {
    var_dump($result);
}
echo '</pre>';
?>
      </p>
      <a href="#" class="card-link">Share</a>
      <a href="#" class="card-link">Other</a>
    </div>
  </div>
 /**
  * output message
  *
  * @param $message
  */
 function _outputMessage($message)
 {
     printMessage($this->name, $message);
 }
Example #20
0
 /**
  * output message
  *
  * @param $message
  */
 function _outputMessage($message)
 {
     // only in cli-mode
     if ($this->_mode == RSSD_MODE_CLI) {
         printMessage($this->name, $message);
     }
 }
                        printMessage(' Skipped file "' . $filePath . '". Reason: Mime type "' . $mimeType . '" has no processor.');
                        break;
                }
            } else {
                printMessage(' Skipped file "' . $filePath . '". Reason: File not found.');
            }
        }
    } else {
        printMessage(' Skipped indexing of document files. Reason: no base path to files or document is not published.');
    }
    $documents[] = $solrDocument;
    if (0 === count($documents) % $commitRange) {
        printMessage(' Committing data set of ' . $commitRange . ' values.');
        $solr->addDocuments($documents);
        $solr->commit();
        $documents = array();
        printMessage(' Committing done.');
    }
}
if (count($documents) > 0) {
    printMessage(' Committing data set of ' . count($documents) . ' values.');
    $solr->addDocuments($documents);
    $solr->commit();
    printMessage(' Committing done.');
}
printMessage(' Optimizing.');
$solr->optimize();
printMessage(' Optimizing done.');
$stopTime = time();
$time = $stopTime - $startTime;
echo 'Time to index all documents: ' . gmstrftime('%H:%M:%S', $time) . $EOL;
Example #22
0
function createSession($userId, $print, $code = 1)
{
    global $con;
    global $theUser;
    global $startTimestamp;
    global $session;
    $theUser = findUser($con, $userId);
    if ($theUser['loggedIn'] == true) {
        logout(3);
    }
    $theUser['justLoggedIn'] = true;
    $theUser['loggedIn'] = true;
    $theUser['session'] = $theUser['id'] . get_rand_alphanumeric(20);
    setcookie("user-session", $theUser['session'], $startTimestamp + 60 * 60 * 24 * 45, "/");
    mysqli_query($con, "INSERT INTO `sessions` (`user`, `status`, `hash`, `ip_address`) VALUES (" . $theUser['id'] . ", {$code}, '" . $theUser['session'] . "', '" . get_ip() . "')");
    getSession();
    if ($print == true) {
        printMessage("You are now logged in");
        mysqli_close($con);
        header('Location: /account/');
        die;
    }
}