!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.4.18 (Ubuntu). PHP/7.0.33-0ubuntu0.16.04.16 

uname -a: Linux digifus 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/almazen_agosto17/ahab/resources/   drwxr-xr-x
Free 10.11 GB of 29.4 GB (34.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     base_resource.py (1.26 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
from flask_restful import Resource
from ahab.models.model import Model
from json import loads
from flask import request

class BaseResource(Resource):

    def __init__(self, table, pk, labels, relations={}):
        self.model = Model(
            table, pk, labels=labels, relations=relations
        )

    def get(self):
        return self._parse_collection(self.model.get_all())
    
    def post(self):
        data = self._get_input_data()
        print 'input data', data
        input = self._unapply_labels(data)
        print 'formatted data', input
        output = self.model.create(input)
        self._on_item_created(data)
        return output, 200

    def put(self, id):
        data = self._get_input_data()
        input = self._unapply_labels(data)       
        return self.model.update(id, input)

    def _get_input_data(self):
        return loads(request.data)

    def _parse_collection(self, collection):
        return collection

    def _unapply_labels(self, data):
        input = {}
        for d in data:
            if d in self.labels.values():
                input[self.labels.keys()[self.labels.values().index(d)]] = data[d]
            else:
                input[d] = data[d]
        return input

    def _on_item_created(self, output):
        pass

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0057 ]--