!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)

/usr/lib/python2.4/site-packages/Ft/Server/Server/Drivers/Postgres/   drwxr-xr-x
Free 3.35 GB of 27.03 GB (12.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     PostgresContainer.py (1.96 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
from Ft.Server.Server import FtServerServerException, Error
from Ft.Server.Common import ResourceTypes
from Ft.Server import FTSERVER_NAMESPACE
from Ft.Xml.XLink import XLINK_NAMESPACE
from Ft.Server.Server.Drivers.FtssDriver import DataStoreContainer

FTSS_CONTAIMENT_TABLE = 'ftss_containment'

class PostgresContainer(DataStoreContainer):
    """
    Implements simple containment as a table in Postgres:
    
    parent   /  child
    ------------------
    /parent1 |  child1
    /parent2 |  child2
    """
    def __init__(self,db):
        """
        Used if instanciated directly in order to do initialization
        """
        self._db = db
    
    def initialize(self):
        """
        Initialize the table
        """                
        self._db.query("CREATE TABLE %s (parent text, child text)"%(FTSS_CONTAIMENT_TABLE))
        self._db.query("CREATE UNIQUE INDEX %s_PC_idx ON %s (parent,child)"%(FTSS_CONTAIMENT_TABLE,FTSS_CONTAIMENT_TABLE))
        self._db.query("CREATE INDEX %s_P_idx ON %s (parent)"%(FTSS_CONTAIMENT_TABLE,FTSS_CONTAIMENT_TABLE))
    
    def fetchChildren(self,parent):
        """
        Returns a list of child uris for the given parent.  Parent is a PathImp
        """
        try:
            data = self._db.query("SELECT child FROM %s WHERE parent = '%s'"%(FTSS_CONTAIMENT_TABLE,parent.absolutePath)).getresult()
        except AttributeError:
            return []
        if not data:
            return []
        return [dataItem[0] for dataItem in data]
        
    def manageChildren(self,parent,child,add=True):
        """
        Adds/remove the child specified by the given path to the parent (path - a PathImp)
        """
        if add:
            self._db.query("INSERT INTO %s (parent,child) VALUES ('%s','%s')"%(FTSS_CONTAIMENT_TABLE,parent.absolutePath,child))
        else:            
            self._db.query("DELETE FROM %s where parent = '%s' and child = '%s'"%(FTSS_CONTAIMENT_TABLE,parent.absolutePath,child))
        

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