示例#1
0
 */
define('__CHRIS_ENTRY_POINT__', 666);
// include the configuration
require_once dirname(dirname(__FILE__)) . '/config.inc.php';
require_once joinPaths(CHRIS_CONTROLLER_FOLDER, 'security.controller.php');
// include the controller
require_once joinPaths(CHRIS_CONTROLLER_FOLDER, 'feed.controller.php');
require_once joinPaths(CHRIS_CONTROLLER_FOLDER, 'data.controller.php');
require_once joinPaths(CHRIS_CONTROLLER_FOLDER, 'plugin.controller.php');
require_once joinPaths(CHRIS_MODEL_FOLDER, 'meta.model.php');
// format session variables and post variable into a command line format
$feed_id = -1;
// do not assume FEED_PARAM is set
$parameters = isset($_POST['FEED_PARAM']) ? $_POST['FEED_PARAM'] : array(0 => "");
// validate the credentials
if (!SecurityC::login()) {
    // invalid credentials
    // destroy the session
    session_destroy();
    // .. and forward to the sorry page
    header('Location: ?sorry');
    exit;
}
$status_step = number_format(100 / count($parameters), 2);
foreach ($parameters as $k0 => $v0) {
    // launcher.php compliant
    // user?
    $username = $_SESSION['username'];
    $password = $_SESSION['password'];
    $feedname = sanitize($_POST['FEED_NAME']);
    if (isset($_POST['FEED_STATUS'])) {
示例#2
0
// check if a token was passed
$loggedIn = false;
if (isset($_GET['token'])) {
    $token = $_GET['token'];
} else {
    if (isset($_POST['token'])) {
        $token = $_POST['token'];
    }
}
if (isset($token)) {
    // token provided
    $loggedIn = TokenC::validate($token);
} else {
    // no token provided
    // if we don't have a token, we need to login
    $loggedIn = SecurityC::login();
}
if (!$loggedIn) {
    // invalid credentials
    // destroy the session
    session_destroy();
    $result['status'] = 'access denied';
} else {
    // propagate user attributes
    if (isset($_SESSION['username'])) {
        $result['username'] = $_SESSION['username'];
    }
    if (isset($_SESSION['userid'])) {
        $result['userid'] = $_SESSION['userid'];
    }
    //