当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_sanitize函数代码示例

本文整理汇总了PHP中PMA_sanitize函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_sanitize函数的具体用法?PHP PMA_sanitize怎么用?PHP PMA_sanitize使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_sanitize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PMA_tableHeader

/**
 * display table header (<table><thead>...</thead><tbody>)
 *
 * @param boolean $db_is_system_schema whether db is information schema or not
 * @param boolean $replication         whether to sho replication status
 *
 * @return string html data
 */
function PMA_tableHeader($db_is_system_schema = false, $replication = false)
{
    $cnt = 0;
    // Let's count the columns...
    if ($db_is_system_schema) {
        $action_colspan = 4;
    } else {
        $action_colspan = 7;
    }
    $html_output = '<table class="data">' . "\n" . '<thead>' . "\n" . '<tr><th></th>' . "\n" . '<th>' . PMA_sortableTableHeader(__('Table'), 'table') . '</th>' . "\n";
    if ($replication) {
        $html_output .= '<th>' . "\n" . '        ' . __('Replication') . "\n" . '</th>';
    }
    $html_output .= '<th colspan="' . $action_colspan . '">' . "\n" . '        ' . __('Action') . "\n" . '</th>' . '<th>' . PMA_sortableTableHeader(__('Rows'), 'records', 'DESC') . PMA_Util::showHint(PMA_sanitize(__('May be approximate. See [doc@faq3-11]FAQ 3.11[/doc].'))) . "\n" . '</th>' . "\n";
    if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
        $html_output .= '<th>' . PMA_sortableTableHeader(__('Type'), 'type') . '</th>' . "\n";
        $cnt++;
        $html_output .= '<th>' . PMA_sortableTableHeader(__('Collation'), 'collation') . '</th>' . "\n";
        $cnt++;
    }
    if ($GLOBALS['is_show_stats']) {
        // larger values are more interesting so default sort order is DESC
        $html_output .= '<th>' . PMA_sortableTableHeader(__('Size'), 'size', 'DESC') . '</th>' . "\n" . '<th>' . PMA_sortableTableHeader(__('Overhead'), 'overhead', 'DESC') . '</th>' . "\n";
        $cnt += 2;
    }
    if ($GLOBALS['cfg']['ShowDbStructureCreation']) {
        // larger values are more interesting so default sort order is DESC
        $html_output .= '<th>' . PMA_sortableTableHeader(__('Creation'), 'creation', 'DESC') . '</th>' . "\n";
        $cnt += 2;
    }
    if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']) {
        // larger values are more interesting so default sort order is DESC
        $html_output .= '<th>' . PMA_sortableTableHeader(__('Last update'), 'last_update', 'DESC') . '</th>' . "\n";
        $cnt += 2;
    }
    if ($GLOBALS['cfg']['ShowDbStructureLastCheck']) {
        // larger values are more interesting so default sort order is DESC
        $html_output .= '<th>' . PMA_sortableTableHeader(__('Last check'), 'last_check', 'DESC') . '</th>' . "\n";
        $cnt += 2;
    }
    $html_output .= '</tr>' . "\n";
    $html_output .= '</thead>' . "\n";
    $html_output .= '<tbody>' . "\n";
    $GLOBALS['colspan_for_structure'] = $cnt + $action_colspan + 3;
    return $html_output;
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:54,代码来源:structure.lib.php

示例2: PMA_TableHeader

/**
 * void PMA_TableHeader([bool $db_is_information_schema = false])
 * display table header (<table><thead>...</thead><tbody>)
 *
 * @uses    PMA_showHint()
 * @uses    $GLOBALS['cfg']['PropertiesNumColumns']
 * @uses    $GLOBALS['is_show_stats']
 * @uses    $GLOBALS['colspan_for_structure']
 * @uses    PMA_SortableTableHeader()
 * @param   boolean $db_is_information_schema
 * @param   boolean $replication
 */
function PMA_TableHeader($db_is_information_schema = false, $replication = false)
{
    $cnt = 0;
    // Let's count the columns...
    if ($db_is_information_schema) {
        $action_colspan = 3;
    } else {
        $action_colspan = 6;
    }
    echo '<table class="data">' . "\n" . '<thead>' . "\n" . '<tr><th></th>' . "\n" . '    <th>' . PMA_SortableTableHeader(__('Table'), 'table') . '</th>' . "\n";
    if ($replication) {
        echo '    <th>' . "\n" . '        ' . __('Replication') . "\n" . '    </th>';
    }
    echo '    <th colspan="' . $action_colspan . '">' . "\n" . '        ' . __('Action') . "\n" . '    </th>' . '    <th>' . PMA_SortableTableHeader(__('Rows'), 'records', 'DESC') . PMA_showHint(PMA_sanitize(__('May be approximate. See [a@./Documentation.html#faq3_11@Documentation]FAQ 3.11[/a]'))) . "\n" . '    </th>' . "\n";
    if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
        echo '    <th>' . PMA_SortableTableHeader(__('Type'), 'type') . '</th>' . "\n";
        $cnt++;
        echo '    <th>' . PMA_SortableTableHeader(__('Collation'), 'collation') . '</th>' . "\n";
        $cnt++;
    }
    if ($GLOBALS['is_show_stats']) {
        // larger values are more interesting so default sort order is DESC
        echo '    <th>' . PMA_SortableTableHeader(__('Size'), 'size', 'DESC') . '</th>' . "\n" . '    <th>' . PMA_SortableTableHeader(__('Overhead'), 'overhead', 'DESC') . '</th>' . "\n";
        $cnt += 2;
    }
    echo '</tr>' . "\n";
    echo '</thead>' . "\n";
    echo '<tbody>' . "\n";
    $GLOBALS['colspan_for_structure'] = $cnt + $action_colspan + 3;
}
开发者ID:dingdong2310,项目名称:g5_theme,代码行数:42,代码来源:db_structure.lib.php

示例3: PMA_TableHeader

/**
 * void PMA_TableHeader([bool $db_is_information_schema = false])
 * display table header (<table><thead>...</thead><tbody>)
 *
 * @uses    PMA_showHint()
 * @uses    $GLOBALS['cfg']['PropertiesNumColumns']
 * @uses    $GLOBALS['is_show_stats']
 * @uses    $GLOBALS['strTable']
 * @uses    $GLOBALS['strAction']
 * @uses    $GLOBALS['strRecords']
 * @uses    $GLOBALS['strApproximateCount']
 * @uses    $GLOBALS['strType']
 * @uses    $GLOBALS['strCollation']
 * @uses    $GLOBALS['strSize']
 * @uses    $GLOBALS['strOverhead']
 * @uses    $GLOBALS['structure_tbl_col_cnt']
 * @uses    PMA_SortableTableHeader()
 * @param   boolean $db_is_information_schema
 * @param   boolean $replication
 */
function PMA_TableHeader($db_is_information_schema = false, $replication = false)
{
    $cnt = 0;
    // Let's count the columns...
    if ($db_is_information_schema) {
        $action_colspan = 3;
    } else {
        $action_colspan = 6;
    }
    echo '<table class="data" style="float: left;">' . "\n" . '<thead>' . "\n" . '<tr><th></th>' . "\n" . '    <th>' . PMA_SortableTableHeader($GLOBALS['strTable'], 'table') . '</th>' . "\n";
    if ($replication) {
        echo '    <th>' . "\n" . '        ' . $GLOBALS['strReplication'] . "\n" . '    </th>';
    }
    echo '    <th colspan="' . $action_colspan . '">' . "\n" . '        ' . $GLOBALS['strAction'] . "\n" . '    </th>' . '    <th>' . PMA_SortableTableHeader($GLOBALS['strRecords'], 'records', 'DESC') . PMA_showHint(PMA_sanitize($GLOBALS['strApproximateCount'])) . "\n" . '    </th>' . "\n";
    if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
        echo '    <th>' . PMA_SortableTableHeader($GLOBALS['strType'], 'type') . '</th>' . "\n";
        $cnt++;
        echo '    <th>' . PMA_SortableTableHeader($GLOBALS['strCollation'], 'collation') . '</th>' . "\n";
        $cnt++;
    }
    if ($GLOBALS['is_show_stats']) {
        // larger values are more interesting so default sort order is DESC
        echo '    <th>' . PMA_SortableTableHeader($GLOBALS['strSize'], 'size', 'DESC') . '</th>' . "\n" . '    <th>' . PMA_SortableTableHeader($GLOBALS['strOverhead'], 'overhead', 'DESC') . '</th>' . "\n";
        $cnt += 2;
    }
    echo '</tr>' . "\n";
    echo '</thead>' . "\n";
    echo '<tbody>' . "\n";
    $GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3;
}
开发者ID:wdingsoft,项目名称:test1.jit,代码行数:50,代码来源:db_structure.lib.php

示例4: PMA_TableHeader

/**
 * void PMA_TableHeader([bool $db_is_information_schema = false])
 * display table header (<table><thead>...</thead><tbody>)
 *
 * @uses    PMA_showHint()
 * @uses    $GLOBALS['cfg']['PropertiesNumColumns']
 * @uses    $GLOBALS['is_show_stats']
 * @uses    $GLOBALS['strTable']
 * @uses    $GLOBALS['strAction']
 * @uses    $GLOBALS['strRecords']
 * @uses    $GLOBALS['strApproximateCount']
 * @uses    $GLOBALS['strType']
 * @uses    $GLOBALS['strCollation']
 * @uses    $GLOBALS['strSize']
 * @uses    $GLOBALS['strOverhead']
 * @uses    $GLOBALS['structure_tbl_col_cnt']
 * @param   boolean $db_is_information_schema
 */
function PMA_TableHeader($db_is_information_schema = false)
{
    $cnt = 0;
    // Let's count the columns...
    if ($db_is_information_schema) {
        $action_colspan = 3;
    } else {
        $action_colspan = 6;
    }
    echo '<table class="data" style="float: left;">' . "\n" . '<thead>' . "\n" . '<tr><td></td>' . "\n" . '    <th>' . $GLOBALS['strTable'] . '</th>' . "\n" . '    <th colspan="' . $action_colspan . '">' . "\n" . '        ' . $GLOBALS['strAction'] . "\n" . '    </th>' . '    <th>' . $GLOBALS['strRecords'] . PMA_showHint(PMA_sanitize($GLOBALS['strApproximateCount'])) . "\n" . '    </th>' . "\n";
    if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
        echo '    <th>' . $GLOBALS['strType'] . '</th>' . "\n";
        $cnt++;
        echo '    <th>' . $GLOBALS['strCollation'] . '</th>' . "\n";
        $cnt++;
    }
    if ($GLOBALS['is_show_stats']) {
        echo '    <th>' . $GLOBALS['strSize'] . '</th>' . "\n" . '    <th>' . $GLOBALS['strOverhead'] . '</th>' . "\n";
        $cnt += 2;
    }
    echo '</tr>' . "\n";
    echo '</thead>' . "\n";
    echo '<tbody>' . "\n";
    $GLOBALS['structure_tbl_col_cnt'] = $cnt + $action_colspan + 3;
}
开发者ID:alecbenson,项目名称:TurnoutWeb-Patches,代码行数:43,代码来源:db_structure.php

示例5: PMA_lang

/**
 * Returns sanitized language string, taking into account our special codes
 * for formatting. Takes variable number of arguments.
 * Based on PMA_sanitize from sanitize.lib.php.
 *
 * @param string $lang_key key in $GLOBALS WITHOUT 'strSetup' prefix
 *
 * @return string
 */
function PMA_lang($lang_key)
{
    $message = isset($GLOBALS["strConfig{$lang_key}"]) ? $GLOBALS["strConfig{$lang_key}"] : $lang_key;
    $message = PMA_sanitize($message);
    if (func_num_args() == 1) {
        return $message;
    } else {
        $args = func_get_args();
        array_shift($args);
        return vsprintf($message, $args);
    }
}
开发者ID:mercysmart,项目名称:naikelas,代码行数:21,代码来源:config_functions.lib.php

示例6: getErrorMessage

 /**
  * Returns error message for failed authentication.
  *
  * @return string
  */
 public function getErrorMessage()
 {
     if (!empty($GLOBALS['login_without_password_is_forbidden'])) {
         return __('Login without a password is forbidden by configuration' . ' (see AllowNoPassword)');
     } elseif (!empty($GLOBALS['allowDeny_forbidden'])) {
         return __('Access denied!');
     } elseif (!empty($GLOBALS['no_activity'])) {
         return sprintf(__('No activity within %s seconds; please log in again.'), $GLOBALS['cfg']['LoginCookieValidity']);
     } else {
         $dbi_error = $GLOBALS['dbi']->getError();
         if (!empty($dbi_error)) {
             return PMA_sanitize($dbi_error);
         } elseif (isset($GLOBALS['errno'])) {
             return '#' . $GLOBALS['errno'] . ' ' . __('Cannot log in to the MySQL server');
         } else {
             return __('Cannot log in to the MySQL server');
         }
     }
 }
开发者ID:mercysmart,项目名称:naikelas,代码行数:24,代码来源:AuthenticationPlugin.class.php

示例7: PMA_showHint

        ?>
</a></td>
    <?php 
    }
    // end if (! $db_is_information_schema)
    // there is a null value in the ENGINE
    // - when the table needs to be repaired, or
    // - when it's a view
    //  so ensure that we'll display "in use" below for a table
    //  that needs to be repaired
    if (isset($each_table['TABLE_ROWS']) && ($each_table['ENGINE'] != null || $table_is_view)) {
        if ($table_is_view) {
            if ($each_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews']) {
                $row_count_pre = '~';
                $sum_row_count_pre = '~';
                $show_superscript = PMA_showHint(PMA_sanitize(sprintf(__('This view has at least this number of rows. Please refer to %sdocumentation%s.'), '[a@./Documentation.html#cfg_MaxExactCountViews@_blank]', '[/a]')));
            }
        } elseif ($each_table['ENGINE'] == 'InnoDB' && !$each_table['COUNTED']) {
            // InnoDB table: we did not get an accurate row count
            $row_count_pre = '~';
            $sum_row_count_pre = '~';
            $show_superscript = '';
        } else {
            $row_count_pre = '';
            $show_superscript = '';
        }
        ?>
    <td class="value tbl_rows"><?php 
        echo $row_count_pre . PMA_formatNumber($each_table['TABLE_ROWS'], 0) . $show_superscript;
        ?>
</td>
开发者ID:bugyak,项目名称:phporadmin,代码行数:31,代码来源:db_structure.php

示例8: getTable

 /**
  * Prepare a table of results returned by a SQL query.
  *
  * @param integer &$dt_result           the link id associated to the query
  *                                      which results have to be displayed
  * @param array   &$displayParts        the parts to display
  * @param array   $analyzed_sql_results analyzed sql results
  * @param boolean $is_limited_display   With limited operations or not
  *
  * @return  string   $table_html   Generated HTML content for resulted table
  *
  * @access  public
  *
  * @see     sql.php file
  */
 public function getTable(&$dt_result, &$displayParts, $analyzed_sql_results, $is_limited_display = false)
 {
     /**
      * The statement this table is built for.
      * @var \SqlParser\Statements\SelectStatement
      */
     $statement = $analyzed_sql_results['statement'];
     $table_html = '';
     // Following variable are needed for use in isset/empty or
     // use with array indexes/safe use in foreach
     $fields_meta = $this->__get('fields_meta');
     $showtable = $this->__get('showtable');
     $printview = $this->__get('printview');
     // why was this called here? (already called from sql.php)
     //$this->setConfigParamsForDisplayTable();
     /**
      * @todo move this to a central place
      * @todo for other future table types
      */
     $is_innodb = isset($showtable['Type']) && $showtable['Type'] == self::TABLE_TYPE_INNO_DB;
     if ($is_innodb && PMA_isJustBrowsing($analyzed_sql_results, true)) {
         // "j u s t   b r o w s i n g"
         $pre_count = '~';
         $after_count = Util::showHint(PMA_sanitize(__('May be approximate. See [doc@faq3-11]FAQ 3.11[/doc].')));
     } else {
         $pre_count = '';
         $after_count = '';
     }
     // 1. ----- Prepares the work -----
     // 1.1 Gets the information about which functionalities should be
     //     displayed
     list($displayParts, $total) = $this->_setDisplayPartsAndTotal($displayParts);
     // 1.2 Defines offsets for the next and previous pages
     if ($displayParts['nav_bar'] == '1') {
         list($pos_next, $pos_prev) = $this->_getOffsets();
     }
     // end if
     // 1.3 Extract sorting expressions.
     //     we need $sort_expression and $sort_expression_nodirection
     //     even if there are many table references
     $sort_expression = array();
     $sort_expression_nodirection = array();
     $sort_direction = array();
     if (!empty($statement->order)) {
         foreach ($statement->order as $o) {
             $sort_expression[] = $o->expr->expr . ' ' . $o->type;
             $sort_expression_nodirection[] = $o->expr->expr;
             $sort_direction[] = $o->type;
         }
     } else {
         $sort_expression[] = '';
         $sort_expression_nodirection[] = '';
         $sort_direction[] = '';
     }
     $number_of_columns = count($sort_expression_nodirection);
     // 1.4 Prepares display of first and last value of the sorted column
     $sorted_column_message = '';
     for ($i = 0; $i < $number_of_columns; $i++) {
         $sorted_column_message .= $this->_getSortedColumnMessage($dt_result, $sort_expression_nodirection[$i]);
     }
     // 2. ----- Prepare to display the top of the page -----
     // 2.1 Prepares a messages with position information
     if ($displayParts['nav_bar'] == '1' && isset($pos_next)) {
         $message = $this->_setMessageInformation($sorted_column_message, $analyzed_sql_results, $total, $pos_next, $pre_count, $after_count);
         $table_html .= Util::getMessage($message, $this->__get('sql_query'), 'success');
     } elseif (!isset($printview) || $printview != '1') {
         $table_html .= Util::getMessage(__('Your SQL query has been executed successfully.'), $this->__get('sql_query'), 'success');
     }
     // 2.3 Prepare the navigation bars
     if (!mb_strlen($this->__get('table'))) {
         if ($analyzed_sql_results['querytype'] == 'SELECT') {
             // table does not always contain a real table name,
             // for example in MySQL 5.0.x, the query SHOW STATUS
             // returns STATUS as a table name
             $this->__set('table', $fields_meta[0]->table);
         } else {
             $this->__set('table', '');
         }
     }
     // can the result be sorted?
     if ($displayParts['sort_lnk'] == '1') {
         // At this point, $sort_expression is an array but we only verify
         // the first element in case we could find that the table is
         // sorted by one of the choices listed in the
         // "Sort by key" drop-down
//.........这里部分代码省略.........
开发者ID:rugbyprof,项目名称:phpmyadmin,代码行数:101,代码来源:DisplayResults.php

示例9: PMA_sanitize

/* $Id: server_databases.php 10421 2007-06-04 17:03:26Z lem9 $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
 * Does the common work
 */
require_once './libraries/common.lib.php';
$js_to_run = 'functions.js';
require './libraries/server_common.inc.php';
/**
 * avoids 'undefined index' errors
 */
if (empty($_REQUEST['sort_by'])) {
    $sort_by = 'SCHEMA_NAME';
} else {
    $sort_by = PMA_sanitize($_REQUEST['sort_by']);
}
if (isset($_REQUEST['sort_order']) && strtolower($_REQUEST['sort_order']) == 'desc') {
    $sort_order = 'desc';
} else {
    $sort_order = 'asc';
}
$dbstats = empty($_REQUEST['dbstats']) ? 0 : 1;
$pos = empty($_REQUEST['pos']) ? 0 : (int) $_REQUEST['pos'];
/**
 * Drops multiple databases
 */
// workaround for IE behavior (it returns some coordinates based on where
// the mouse was on the Drop image):
if (isset($_REQUEST['drop_selected_dbs_x'])) {
    $_REQUEST['drop_selected_dbs'] = true;
开发者ID:JakubMarden,项目名称:eshop,代码行数:30,代码来源:server_databases.php

示例10: PMA_generate_common_hidden_inputs

" method="post">
<input type="hidden" name="query_type" value="<?php 
    echo $what;
    ?>
" />
    <?php 
    if (strpos(' ' . $action, 'db_') == 1) {
        echo PMA_generate_common_hidden_inputs($db);
    } elseif (strpos(' ' . $action, 'tbl_') == 1 || $what == 'row_delete') {
        echo PMA_generate_common_hidden_inputs($db, $table);
    } else {
        echo PMA_generate_common_hidden_inputs();
    }
    ?>
<input type="hidden" name="reload" value="<?php 
    echo isset($reload) ? PMA_sanitize($reload) : 0;
    ?>
" />
<?php 
    foreach ($selected as $idx => $sval) {
        echo '<input type="hidden" name="selected[]" value="' . htmlspecialchars($sval) . '" />' . "\n";
    }
    if ($what == 'drop_tbl' && !empty($views)) {
        foreach ($views as $current) {
            echo '<input type="hidden" name="views[]" value="' . htmlspecialchars($current) . '" />' . "\n";
        }
    }
    if ($what == 'row_delete') {
        echo '<input type="hidden" name="original_sql_query" value="' . htmlspecialchars($original_sql_query) . '" />' . "\n";
        echo '<input type="hidden" name="original_url_query" value="' . htmlspecialchars($original_url_query) . '" />' . "\n";
    }
开发者ID:findlakes,项目名称:XSS-Platform,代码行数:31,代码来源:mult_submits.inc.php

示例11: isset

    ?>
" />
    <input type="hidden" name="purge" value="<?php 
    echo isset($purge) ? PMA_sanitize($purge) : '';
    ?>
" />
    <input type="hidden" name="cpurge" value="<?php 
    echo isset($cpurge) ? PMA_sanitize($cpurge) : '';
    ?>
" />
    <input type="hidden" name="purgekey" value="<?php 
    echo isset($purgekey) ? PMA_sanitize($purgekey) : '';
    ?>
" />
    <input type="hidden" name="show_query" value="<?php 
    echo isset($show_query) ? PMA_sanitize($show_query) : '';
    ?>
" />
    <?php 
    echo '<fieldset class="confirmation">' . "\n" . '    <legend>' . $strDoYouReally . '</legend>' . '    <tt>' . htmlspecialchars($stripped_sql_query) . '</tt>' . "\n" . '</fieldset>' . "\n" . '<fieldset class="tblFooters">' . "\n";
    ?>
    <input type="submit" name="btnDrop" value="<?php 
    echo $strYes;
    ?>
" id="buttonYes" />
    <input type="submit" name="btnDrop" value="<?php 
    echo $strNo;
    ?>
" id="buttonNo" />
    <?php 
    echo '</fieldset>' . "\n" . '</form>' . "\n";
开发者ID:robmat,项目名称:samplebator,代码行数:31,代码来源:sql.php

示例12: PMA_sanitize

<?php

/* $Id: tbl_create.php 10144 2007-03-20 11:22:31Z cybot_tm $ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
 * Get some core libs
 */
require_once './libs/common.lib.php';
require_once './libs/Table.class.php';
$js_to_run = 'functions.js';
if (isset($table)) {
    $table = PMA_sanitize($table);
}
require_once './libs/header.inc.php';
// Check parameters
PMA_checkParameters(array('db', 'table'));
/**
 * Defines the url to return to in case of error in a sql statement
 */
$err_url = $cfg['DefaultTabTable'] . '?' . PMA_generate_common_url($db, $table);
/**
 * Selects the database to work with
 */
PMA_DBI_select_db($db);
/**
 * The form used to define the structure of the table has been submitted
 */
$abort = false;
if (isset($submit_num_fields)) {
    $regenerate = true;
    $num_fields = $orig_num_fields + $added_fields;
开发者ID:BGCX261,项目名称:zhe-project-agri-hg-to-git,代码行数:31,代码来源:tbl_create.php

示例13: PMA_showMessage

/**
 * displays the message and the query
 * usually the message is the result of the query executed
 *
 * @param string  $message   the message to display
 * @param string  $sql_query the query to display
 * @param string  $type      the type (level) of the message
 * @param boolean $is_view   is this a message after a VIEW operation?
 *
 * @return  string
 *
 * @access  public
 */
function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view = false)
{
    /*
     * PMA_ajaxResponse uses this function to collect the string of HTML generated
     * for showing the message.  Use output buffering to collect it and return it
     * in a string.  In some special cases on sql.php, buffering has to be disabled
     * and hence we check with $GLOBALS['buffer_message']
     */
    if ($GLOBALS['is_ajax_request'] == true && !isset($GLOBALS['buffer_message'])) {
        ob_start();
    }
    global $cfg;
    if (null === $sql_query) {
        if (!empty($GLOBALS['display_query'])) {
            $sql_query = $GLOBALS['display_query'];
        } elseif ($cfg['SQP']['fmtType'] == 'none' && !empty($GLOBALS['unparsed_sql'])) {
            $sql_query = $GLOBALS['unparsed_sql'];
        } elseif (!empty($GLOBALS['sql_query'])) {
            $sql_query = $GLOBALS['sql_query'];
        } else {
            $sql_query = '';
        }
    }
    if (isset($GLOBALS['using_bookmark_message'])) {
        $GLOBALS['using_bookmark_message']->display();
        unset($GLOBALS['using_bookmark_message']);
    }
    // Corrects the tooltip text via JS if required
    // @todo this is REALLY the wrong place to do this - very unexpected here
    if (!$is_view && strlen($GLOBALS['table']) && $cfg['ShowTooltip']) {
        $tooltip = PMA_Table::sGetToolTip($GLOBALS['db'], $GLOBALS['table']);
        $uni_tbl = PMA_jsFormat($GLOBALS['db'] . '.' . $GLOBALS['table'], false);
        echo "\n";
        echo '<script type="text/javascript">' . "\n";
        echo '//<![CDATA[' . "\n";
        echo "if (window.parent.updateTableTitle) window.parent.updateTableTitle('" . $uni_tbl . "', '" . PMA_jsFormat($tooltip, false) . "');" . "\n";
        echo '//]]>' . "\n";
        echo '</script>' . "\n";
    }
    // end if ... elseif
    // Checks if the table needs to be repaired after a TRUNCATE query.
    // @todo what about $GLOBALS['display_query']???
    // @todo this is REALLY the wrong place to do this - very unexpected here
    if (strlen($GLOBALS['table']) && $GLOBALS['sql_query'] == 'TRUNCATE TABLE ' . PMA_backquote($GLOBALS['table'])) {
        if (PMA_Table::sGetStatusInfo($GLOBALS['db'], $GLOBALS['table'], 'Index_length') > 1024 && !PMA_DRIZZLE) {
            PMA_DBI_try_query('REPAIR TABLE ' . PMA_backquote($GLOBALS['table']));
        }
    }
    unset($tbl_status);
    // In an Ajax request, $GLOBALS['cell_align_left'] may not be defined. Hence,
    // check for it's presence before using it
    echo '<div id="result_query" align="' . (isset($GLOBALS['cell_align_left']) ? $GLOBALS['cell_align_left'] : '') . '">' . "\n";
    if ($message instanceof PMA_Message) {
        if (isset($GLOBALS['special_message'])) {
            $message->addMessage($GLOBALS['special_message']);
            unset($GLOBALS['special_message']);
        }
        $message->display();
        $type = $message->getLevel();
    } else {
        echo '<div class="' . $type . '">';
        echo PMA_sanitize($message);
        if (isset($GLOBALS['special_message'])) {
            echo PMA_sanitize($GLOBALS['special_message']);
            unset($GLOBALS['special_message']);
        }
        echo '</div>';
    }
    if ($cfg['ShowSQL'] == true && !empty($sql_query)) {
        // Html format the query to be displayed
        // If we want to show some sql code it is easiest to create it here
        /* SQL-Parser-Analyzer */
        if (!empty($GLOBALS['show_as_php'])) {
            $new_line = '\\n"<br />' . "\n" . '&nbsp;&nbsp;&nbsp;&nbsp;. "';
            $query_base = htmlspecialchars(addslashes($sql_query));
            $query_base = preg_replace('/((\\015\\012)|(\\015)|(\\012))/', $new_line, $query_base);
        } else {
            $query_base = $sql_query;
        }
        $query_too_big = false;
        if (strlen($query_base) > $cfg['MaxCharactersInDisplayedSQL']) {
            // when the query is large (for example an INSERT of binary
            // data), the parser chokes; so avoid parsing the query
            $query_too_big = true;
            $shortened_query_base = nl2br(htmlspecialchars(substr($sql_query, 0, $cfg['MaxCharactersInDisplayedSQL']) . '[...]'));
        } elseif (!empty($GLOBALS['parsed_sql']) && $query_base == $GLOBALS['parsed_sql']['raw']) {
            // (here, use "! empty" because when deleting a bookmark,
//.........这里部分代码省略.........
开发者ID:AmberWish,项目名称:laba_web,代码行数:101,代码来源:common.lib.php

示例14: decodeBB

 /**
  * decode $message, taking into account our special codes
  * for formatting
  *
  * @param string $message the message
  *
  * @return string  the decoded message
  * @access  public
  * @static
  */
 public static function decodeBB($message)
 {
     return PMA_sanitize($message, false, true);
 }
开发者ID:yszar,项目名称:linuxwp,代码行数:14,代码来源:Message.class.php

示例15: PMA_auth_fails

/**
 * User is not allowed to login to MySQL -> authentication failed
 *
 * @return  boolean   always true (no return indeed)
 *
 * @access  public
 */
function PMA_auth_fails()
{
    /* Session name */
    $session_name = $GLOBALS['cfg']['Server']['SignonSession'];
    /* Does session exist? */
    if (isset($_COOKIE[$session_name])) {
        /* End current session */
        $old_session = session_name();
        $old_id = session_id();
        session_write_close();
        /* Load single signon session */
        session_name($session_name);
        session_id($_COOKIE[$session_name]);
        session_start();
        /* Set error message */
        if (!empty($GLOBALS['login_without_password_is_forbidden'])) {
            $_SESSION['PMA_single_signon_error_message'] = __('Login without a password is forbidden by configuration (see AllowNoPassword)');
        } elseif (!empty($GLOBALS['allowDeny_forbidden'])) {
            $_SESSION['PMA_single_signon_error_message'] = __('Access denied');
        } elseif (!empty($GLOBALS['no_activity'])) {
            $_SESSION['PMA_single_signon_error_message'] = sprintf(__('No activity within %s seconds; please log in again'), $GLOBALS['cfg']['LoginCookieValidity']);
        } elseif (PMA_DBI_getError()) {
            $_SESSION['PMA_single_signon_error_message'] = PMA_sanitize(PMA_DBI_getError());
        } elseif (isset($php_errormsg)) {
            $_SESSION['PMA_single_signon_error_message'] = $php_errormsg;
        } else {
            $_SESSION['PMA_single_signon_error_message'] = __('Cannot log in to the MySQL server');
        }
    }
    PMA_auth();
}
开发者ID:dingdong2310,项目名称:g5_theme,代码行数:38,代码来源:signon.auth.lib.php


注:本文中的PMA_sanitize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。