!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/home/mnnews/public_html/login/phpmyadmin/   drwxr-xr-x
Free 4.57 GB of 27.03 GB (16.9%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     view_create.php (8.61 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* handles creation of VIEWs
*
* @todo js error when view name is empty (strFormEmpty)
* @todo (also validate if js is disabled, after form submission?)
* @package PhpMyAdmin
*/

require_once './libraries/common.inc.php';
require_once
'./libraries/SystemDatabase.class.php';

/**
* Runs common work
*/
require './libraries/db_common.inc.php';
$url_params['goto'] = 'tbl_structure.php';
$url_params['back'] = 'view_create.php';

$view_algorithm_options = array(
    
'UNDEFINED',
    
'MERGE',
    
'TEMPTABLE',
);

$view_with_options = array(
    
'CASCADED',
    
'LOCAL'
);

$view_security_options = array(
    
'DEFINER',
    
'INVOKER'
);

if (empty(
$sql_query)) {
    
$sql_query = '';
}

if (isset(
$_REQUEST['createview']) || isset($_REQUEST['alterview'])) {
    
/**
     * Creates the view
     */
    
$sep = "\r\n";

    if (isset(
$_REQUEST['createview'])) {
        
$sql_query = 'CREATE';
        if (isset(
$_REQUEST['view']['or_replace'])) {
            
$sql_query .= ' OR REPLACE';
        }
    } else {
        
$sql_query = 'ALTER';
    }

    if (
PMA_isValid($_REQUEST['view']['algorithm'], $view_algorithm_options)) {
        
$sql_query .= $sep . ' ALGORITHM = ' . $_REQUEST['view']['algorithm'];
    }

    if (! empty(
$_REQUEST['view']['definer'])) {
        
$sql_query .= $sep . ' DEFINER = ' . $_REQUEST['view']['definer'];
    }

    if (isset(
$_REQUEST['view']['sql_security'])) {
        if (
in_array($_REQUEST['view']['sql_security'], $view_security_options)) {
            
$sql_query .= $sep . ' SQL SECURITY '
                
. $_REQUEST['view']['sql_security'];
        }
    }

    
$sql_query .= $sep . ' VIEW ' . PMA_Util::backquote($_REQUEST['view']['name']);

    if (! empty(
$_REQUEST['view']['column_names'])) {
        
$sql_query .= $sep . ' (' . $_REQUEST['view']['column_names'] . ')';
    }

    
$sql_query .= $sep . ' AS ' . $_REQUEST['view']['as'];

    if (isset(
$_REQUEST['view']['with'])) {
        if (
in_array($_REQUEST['view']['with'], $view_with_options)) {
            
$sql_query .= $sep . ' WITH ' . $_REQUEST['view']['with']
                .
'  CHECK OPTION';
        }
    }

    if (!
$GLOBALS['dbi']->tryQuery($sql_query)) {
        if (! isset(
$_REQUEST['ajax_dialog'])) {
            
$message = PMA_Message::rawError($GLOBALS['dbi']->getError());
            return;
        }

        
$response = PMA_Response::getInstance();
        
$response->addJSON(
            
'message',
            
PMA_Message::error(
                
"<i>" . htmlspecialchars($sql_query) . "</i><br /><br />"
                
. $GLOBALS['dbi']->getError()
            )
        );
        
$response->isSuccess(false);
        exit;
    }

    
// If different column names defined for VIEW
    
$view_columns = array();
    if (isset(
$_REQUEST['view']['column_names'])) {
        
$view_columns = explode(',', $_REQUEST['view']['column_names']);
    }

    
$column_map = $GLOBALS['dbi']->getColumnMapFromSql(
        
$_REQUEST['view']['as'], $view_columns
    
);

    
$systemDb = $GLOBALS['dbi']->getSystemDatabase();
    
$pma_transformation_data = $systemDb->getExistingTransformationData(
        
$GLOBALS['db']
    );

    if (
$pma_transformation_data !== false) {

        
// SQL for store new transformation details of VIEW
        
$new_transformations_sql = $systemDb->getNewTransformationDataSql(
            
$pma_transformation_data, $column_map,
            
$_REQUEST['view']['name'], $GLOBALS['db']
        );

        
// Store new transformations
        
if ($new_transformations_sql != '') {
            
$GLOBALS['dbi']->tryQuery($new_transformations_sql);
        }

    }
    unset(
$pma_transformation_data);

    if (! isset(
$_REQUEST['ajax_dialog'])) {
        
$message = PMA_Message::success();
        include
'tbl_structure.php';
    } else {
        
$response = PMA_Response::getInstance();
        
$response->addJSON(
            
'message',
            
PMA_Util::getMessage(PMA_Message::success(), $sql_query)
        );
        
$response->isSuccess(true);
    }

    exit;
}

// prefill values if not already filled from former submission
$view = array(
    
'operation' => 'create',
    
'or_replace' => '',
    
'algorithm' => '',
    
'definer' => '',
    
'sql_security' => '',
    
'name' => '',
    
'column_names' => '',
    
'as' => $sql_query,
    
'with' => '',
);

if (
PMA_isValid($_REQUEST['view'], 'array')) {
    
$view = array_merge($view, $_REQUEST['view']);
}

$url_params['db'] = $GLOBALS['db'];
$url_params['reload'] = 1;

/**
* Displays the page
*/
$htmlString = '<!-- CREATE VIEW options -->'
    
. '<div id="div_view_options">'
    
. '<form method="post" action="view_create.php">'
    
. PMA_URL_getHiddenInputs($url_params)
    .
'<fieldset>'
    
. '<legend>'
    
. (isset($_REQUEST['ajax_dialog']) ?
        
__('Details') :
        (
$view['operation'] == 'create' ? __('Create view') : __('Edit view'))
    )
    .
'</legend>'
    
. '<table class="rte_table">';

if (
$view['operation'] == 'create') {
    
$htmlString .= '<tr>'
        
. '<td class="nowrap"><label for="or_replace">OR REPLACE</label></td>'
        
. '<td><input type="checkbox" name="view[or_replace]" id="or_replace"';
    if (
$view['or_replace']) {
        
$htmlString .= ' checked="checked"';
    }
    
$htmlString .= ' value="1" /></td></tr>';
}

$htmlString .= '<tr>'
    
. '<td class="nowrap"><label for="algorithm">ALGORITHM</label></td>'
    
. '<td><select name="view[algorithm]" id="algorithm">';
foreach (
$view_algorithm_options as $option) {
    
$htmlString .= '<option value="' . htmlspecialchars($option) . '"';
    if (
$view['algorithm'] === $option) {
        
$htmlString .= ' selected="selected"';
    }
    
$htmlString .= '>' . htmlspecialchars($option) . '</option>';
}
$htmlString .= '</select>'
    
. '</td></tr>';

$htmlString .= '<tr><td class="nowrap">' . __('Definer') . '</td>'
    
. '<td><input type="text" maxlength="100" size="50" name="view[definer]"'
    
. ' value="' . htmlspecialchars($view['definer']) . '" />'
    
. '</td></tr>';

$htmlString .= '<tr><td class="nowrap">SQL SECURITY</td>'
    
. '<td><select name="view[sql_security]">'
    
. '<option value=""></option>';
foreach (
$view_security_options as $option) {
    
$htmlString .= '<option value="' . htmlspecialchars($option) . '"';
    if (
$option == $view['sql_security']) {
        
$htmlString .= ' selected="selected"';
    }
    
$htmlString .= '>' . htmlspecialchars($option) . '</option>';
}
$htmlString .= '<select>'
    
. '</td></tr>';

if (
$view['operation'] == 'create') {
    
$htmlString .= '<tr><td class="nowrap">' . __('VIEW name') . '</td>'
        
. '<td><input type="text" size="20" name="view[name]"'
        
. ' onfocus="this.select()" maxlength="64"'
        
. ' value="' . htmlspecialchars($view['name']) . '" />'
        
. '</td></tr>';
} else {
    
$htmlString .= '<tr><td><input type="hidden" name="view[name]"'
        
. ' value="' . htmlspecialchars($view['name']) . '" />'
        
. '</td></tr>';
}

$htmlString .= '<tr><td class="nowrap">' . __('Column names') . '</td>'
    
. '<td><input type="text" maxlength="100" size="50" name="view[column_names]"'
    
. ' onfocus="this.select()"'
    
. ' value="' . htmlspecialchars($view['column_names']) . '" />'
    
. '</td></tr>';

$htmlString .= '<tr><td class="nowrap">AS</td>'
    
. '<td>'
    
. '<textarea name="view[as]" rows="15" cols="40" dir="' . $text_dir . '"';
if (
$GLOBALS['cfg']['TextareaAutoSelect'] || true) {
    
$htmlString .= ' onclick="selectContent(this, sql_box_locked, true)"';
}
$htmlString .= '>' . htmlspecialchars($view['as']) . '</textarea>'
    
. '</td></tr>';

$htmlString .= '<tr><td class="nowrap">WITH CHECK OPTION</td>'
    
. '<td><select name="view[with]">'
    
. '<option value=""></option>';
foreach (
$view_with_options as $option) {
    
$htmlString .= '<option value="' . htmlspecialchars($option) . '"';
    if (
$option == $view['with']) {
        
$htmlString .= ' selected="selected"';
    }
    
$htmlString .= '>' . htmlspecialchars($option) . '</option>';
}
$htmlString .= '<select>'
    
. '</td></tr>';

$htmlString .= '</table>'
    
. '</fieldset>';

if (! isset(
$_REQUEST['ajax_dialog'])) {
    
$htmlString .= '<fieldset class="tblFooters">'
        
. '<input type="hidden" name="'
        
. ($view['operation'] == 'create' ? 'createview' : 'alterview' )
        .
'" value="1" />'
        
. '<input type="submit" name="" value="' . __('Go') . '" />'
        
. '</fieldset>';
} else {
    
$htmlString .= '<input type="hidden" name="'
        
. ($view['operation'] == 'create' ? 'createview' : 'alterview' )
        .
'" value="1" />'
        
. '<input type="hidden" name="ajax_dialog" value="1" />'
        
. '<input type="hidden" name="ajax_request" value="1" />';
}

$htmlString .= '</form>'
    
. '</div>';

echo
$htmlString;

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0041 ]--