예제 #1
0
파일: pastebin.php 프로젝트: ewosp/pastebin
    }
}
///////////////////////////////////////////////////////////////////////////////
// user submitted the "private pastebin" form? redirect them...
//
if ($_GET['goprivate']) {
    $sub = trim(strtolower($_GET['goprivate']));
    if (preg_match('/^[a-z0-9][a-z0-9\\.\\-]*[a-z0-9]$/i', $sub)) {
        header("Location: http://{$sub}." . TOPDOMAIN);
        exit;
    }
}
///////////////////////////////////////////////////////////////////////////////
// create our pastebin object
//
$pastebin = new Pastebin($CONF);
// clean up older posts
$pastebin->doGarbageCollection();
///////////////////////////////////////////////////////////////////////////////
// process new posting
//
$errors = array();
if (isset($_POST['paste'])) {
    session_start();
    if ($_POST['quux'] == $_SESSION['solution'] && strtolower($_POST['quux2']) == strtolower('blanc')) {
        //process posting and redirect
        $id = $pastebin->doPost($_POST);
        if ($id) {
            $pastebin->redirectToPost($id);
            exit;
        }
예제 #2
0
파일: api.php 프로젝트: KingNoosh/Teknik
                 } else {
                     array_push($jsonArray, array('error' => $CONF['errors']['InvRequest']));
                 }
                 break;
             default:
                 array_push($jsonArray, array('error' => $CONF['errors']['InvRequest']));
                 break;
         }
     } else {
         array_push($jsonArray, array('error' => $CONF['errors']['InvRequest']));
     }
     break;
 case 'paste':
     if (isset($_POST['code'])) {
         // Create our pastebin object
         $pastebin = new Pastebin($CONF, $db);
         /// Clean up older posts
         $pastebin->doGarbageCollection();
         $id = $pastebin->doPost($_POST);
         $post = $pastebin->getPaste($id);
         array_push($jsonArray, array('results' => array('paste' => array('id' => $id, 'url' => get_page_url("p", $CONF) . '/' . $id, 'title' => $post['title'], 'format' => $post['format'], 'expiration' => $post['expires'], 'password' => $post['password']))));
     } else {
         array_push($jsonArray, array('error' => $CONF['errors']['NoPaste']));
     }
     break;
 case 'ricehalla':
     if (isset($_GET['action'])) {
         $action = strtolower($_GET['action']);
         switch ($action) {
             case "post":
                 if (isset($_POST['username'])) {
예제 #3
0
    }
}
///////////////////////////////////////////////////////////////////////////////
// user submitted the "private pastebin" form? redirect them...
//
if ($_GET['goprivate']) {
    $sub = trim(strtolower($_GET['goprivate']));
    if (preg_match('/^[a-z0-9][a-z0-9\\.\\-]*[a-z0-9]$/i', $sub)) {
        header("Location: http://{$sub}.pastebin.com");
        exit;
    }
}
///////////////////////////////////////////////////////////////////////////////
// create our pastebin object
//
$pastebin = new Pastebin($CONF);
///////////////////////////////////////////////////////////////////////////////
// process new posting
//
$errors = array();
if (isset($_POST['paste'])) {
    //process posting and redirect
    $id = $pastebin->doPost($_POST);
    if ($id) {
        $pastebin->redirectToPost($id);
        exit;
    }
}
///////////////////////////////////////////////////////////////////////////////
// process download
//
예제 #4
0
try {
    // authentication
    $auth = new \Pste\Auth($request);
    if (!$auth->isAuthenticated()) {
        \Pste\Registry::getInstance()->authenticated = false;
    } else {
        \Pste\Registry::getInstance()->authenticated = true;
        \Pste\Registry::getInstance()->user = $auth->getUser();
    }
    /// Clean up older posts
    //    $pastebin->doGarbageCollection();
    // Process new posting
    $errors = array();
    if ($request->hasParam('paste')) {
        /* Process posting and redirect */
        $pastebin = new Pastebin($CONF);
        $id = $pastebin->doPost($_POST);
        if ($id) {
            $pastebin->redirectToPost($id);
            exit;
        }
    }
    if ($request->hasParam('show') && ($config->restrict_show && \Pste\Registry::getInstance()->authenticated || !$config->restrict_show)) {
        $content = \Pste\Component::add(new \Pste\Component\SinglePaste(array('pid' => $request->getParam('show'), 'request' => $request)));
    } else {
        if ($request->hasParam('archive')) {
            require_once 'components/PasteArchive.php';
            $content = \Pste\Component::add(new \Pste\Component\PasteArchive(array('page' => $request->getParam('page'), 'request' => $request)));
        } else {
            if ($request->hasParam('submit', 'GET')) {
                $content = \Pste\Component::add(new \Pste\Component\PasteForm(array('request' => $request)));
예제 #5
0
파일: index.php 프로젝트: KingNoosh/Teknik
        if (get_magic_quotes_gpc()) {
            $val = stripslashes($val);
        }
    }
    if (count($_GET)) {
        array_walk($_GET, 'callback_stripslashes');
    }
    if (count($_POST)) {
        array_walk($_POST, 'callback_stripslashes');
    }
    if (count($_COOKIE)) {
        array_walk($_COOKIE, 'callback_stripslashes');
    }
}
// Create our pastebin object
$pastebin = new Pastebin($CONF, $db);
/// Clean up older posts
$pastebin->doGarbageCollection();
// Process new posting
$errors = array();
if (isset($_POST['code'])) {
    /* Process posting and redirect */
    $id = $pastebin->doPost($_POST);
    if ($id) {
        $pastebin->redirectToPost($id);
        exit;
    }
}
// Process downloads.
if (isset($_GET['dl'])) {
    global $errors;