!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/libraries/sql-parser/src/Utils/   drwxr-xr-x
Free 1.9 GB of 27.03 GB (7.02%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Misc.php (3.23 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/**
* Miscellaneous utilities.
*
* @package    SqlParser
* @subpackage Utils
*/
namespace SqlParserUtils;

use
SqlParserComponentsExpression;
use
SqlParserStatementsSelectStatement;

/**
* Miscellaneous utilities.
*
* @category   Misc
* @package    SqlParser
* @subpackage Utils
* @author     Dan Ungureanu <udan1107@gmail.com>
* @license    http://opensource.org/licenses/GPL-2.0 GNU Public License
*/
class Misc
{

    
/**
     * Gets a list of all aliases and their original names.
     *
     * @param SelectStatement $statement The statement to be processed.
     * @param string          $database  The name of the database.
     *
     * @return array
     */
    
public static function getAliases($statement, $database)
    {
        if (!(
$statement instanceof SelectStatement)
            || (empty(
$statement->expr))
            || (empty(
$statement->from))
        ) {
            return array();
        }

        
$retval = array();

        
$tables = array();

        
/**
         * Expressions that may contain aliases.
         * These are extracted from `FROM` and `JOIN` keywords.
         *
         * @var Expression[] $expressions
         */
        
$expressions = $statement->from;

        
// Adding expressions from JOIN.
        
if (!empty($statement->join)) {
            foreach (
$statement->join as $join) {
                
$expressions[] = $join->expr;
            }
        }

        foreach (
$expressions as $expr) {
            if ((!isset(
$expr->table)) || ($expr->table === '')) {
                continue;
            }

            
$thisDb = ((isset($expr->database)) && ($expr->database !== '')) ?
                
$expr->database : $database;

            if (!isset(
$retval[$thisDb])) {
                
$retval[$thisDb] = array(
                    
'alias' => null,
                    
'tables' => array(),
                );
            }

            if (!isset(
$retval[$thisDb]['tables'][$expr->table])) {
                
$retval[$thisDb]['tables'][$expr->table] = array(
                    
'alias' => ((isset($expr->alias)) && ($expr->alias !== '')) ?
                        
$expr->alias : null,
                    
'columns' => array(),
                );
            }

            if (!isset(
$tables[$thisDb])) {
                
$tables[$thisDb] = array();
            }
            
$tables[$thisDb][$expr->alias] = $expr->table;
        }

        foreach (
$statement->expr as $expr) {
            if ((!isset(
$expr->column)) || ($expr->column === '')
                || (!isset(
$expr->alias)) || ($expr->alias === '')
            ) {
                continue;
            }

            
$thisDb = ((isset($expr->database)) && ($expr->database !== '')) ?
                
$expr->database : $database;

            if ((isset(
$expr->table)) && ($expr->table !== '')) {
                
$thisTable = isset($tables[$thisDb][$expr->table]) ?
                    
$tables[$thisDb][$expr->table] : $expr->table;
                
$retval[$thisDb]['tables'][$thisTable]['columns'][$expr->column] = $expr->alias;
            } else {
                foreach (
$retval[$thisDb]['tables'] as &$table) {
                    
$table['columns'][$expr->column] = $expr->alias;
                }
            }
        }

        return
$retval;
    }
}

:: 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.0069 ]--