Exemple #1
0
<?php

/* Reformatted 12.11.2015 */
// helpers nad includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$db = new Db("SocialNetwork");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// No privleges Required
$RULES = new Rules(0, "profile");
// Selects collection from Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Groups");
$collection = $db->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "group_id");
// Used for anayltics
$LOG = new Logging("Groups.query");
$LOG->log($RULES->getId(), 72, $query, 100, "Groups Queried");
// Find Documents in Collection
$documents = $collection->find($query);
// Output
$OUTPUT->success(1, $documents);
?>

  
Exemple #2
0
<?php

/* Reformatted 12.11.2015 */
// Helper functions adn includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("Auth");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// Admin Privleges required
$RULES = new Rules(5, "providers");
// Selects Collection From Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Providers");
$collection = $DB->selectCollection($collectionName);
// provider name required for specific query (otherwise all will be returned)
$query = Helper::formatQuery($REQUEST, "provider_name", null, array("protocol" => "OAuth2"));
// Used for analytics
$LOG = new Logging("Auth2.query");
$LOG->log($RULES->getId(), 112, $query, 100, "User viewed items in cart/wishlist");
// Find Documents in Collection
$documents = $collection->find($query);
// Output
$OUTPUT->success(1, $documents);
Exemple #3
0
/* Reformatted 12.11.2015 */
// Helper and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("System");
$OUTPUT = new Output();
// Get Request Variables
$REQUEST = new Request();
// Admin Privleges needed
$RULES = new Rules(5, "cms");
// Select Collection From Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Content");
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "field_name");
// Values which are permitted by the Adjustment Script
$permitted = array("field_name", "content.full", "content.short", "header.text", "header.sub", "header.url_safe", "picture.banner", "picture.other[]", "picture.slideshow[]");
// Format Update and options
$update = Helper::updatePermitted($REQUEST, $permitted);
$options = Helper::formatOptions($REQUEST);
// Used for analytics
$LOG = new Logging("CMS.adjust");
$LOG->log($RULES->getId(), 51, $query, 100, "Content Updated");
// Find And Modify Documents in Collection
$document = $collection->findAndModify($query, $update, $options);
// Output
$OUTPUT->success(0, $document);
?>

  
Exemple #4
0
<?php

include_once '/var/www/html/Lux/Core/Helper.php';
$DB = new Db("SocialNetwork");
$OUTPUT = new Output();
$collection = $DB->selectCollection("Messages");
$REQUEST = new Request();
$RULES = new Rules(1, "social");
$query = Helper::formatQuery($REQUEST, "id", "thread_id");
$options = Helper::formatLimits($REQUEST);
$document = $collection->find($query, $options);
$OUTPUT->success(0, $document);
?>

Exemple #5
0
<?php

/* Reformatted 12.11.2015 */
// Helper script and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("System");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// Admin privleges needed
$RULES = new Rules(5, "accounts");
// Selects Collection from Databse Connection
$collectionName = Helper::getCollectionName($REQUEST, "Accounts", false);
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "user", "system_info.user");
// Used for Analytics
$LOG = new Logging("Accounts.query");
$LOG->log($RULES->getId(), 2, $RULES->getId(), 100, "User Account Queried");
// Find Documents in Collection
$documents = $collection->find($query);
// Output
$OUTPUT->success(0, $documents);
?>

  
Exemple #6
0
<?php

/* Reformatted 12.11.2015 */
// Helper script and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$db = new Db("SocialNetwork");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// No Privleeges needed
$RULES = new Rules(0, "profile");
// Select Collection From Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Users");
$collection = $db->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST);
// Used for anayltics
$LOG = new Logging("Profile.query");
$LOG->log($RULES->getId(), 92, $query, 100, "Social Network Profile Queried");
// Find Documents
$documents = $collection->find($query);
// Output
$OUTPUT->success(1, $documents);
?>

  
Exemple #7
0
/* Reformatted 12.11.2015 */
// helper functions and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("Auth");
$OUTPUT = new Output();
// Get Request Variables
$REQUEST = new Request();
// Admin privleges needed
$RULES = new Rules(5, "providers");
// Select Collection From Database
$collectionName = Helper::getCollectionName($REQUEST, "Providers");
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "provider_name");
// Values which are accepted by the adjustment Script
$permitted = array("provider_name", "base1", "base2", "base3", "client_id", "client_secret", "default_scope");
// Used for Analytics
$LOG = new Logging("Auth1.adjust");
$LOG->log($RULES->getId(), 111, $query, 100, "User Modified Asset");
// Format Update and Options
$update = Helper::updatePermitted($REQUEST, $permitted);
$update["protocol"] = "OAuth2";
$options = Helper::formatOptions($REQUEST);
// Find and Modify Documents in Collection
$documents = $collection->findAndModify($query, $update, $options);
$OUTPUT->success(0, $documents);
?>

  
Exemple #8
0
/* Reformatted 12.11.2015 */
// Helper script and include
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("System");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// No Privleges Needed
$RULES = new Rules(0, "session");
// Selects Collection From Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Sessions");
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "sid");
// Used for anayltics
$LOG = new Logging("Session.query");
$LOG->log($RULES->getId(), 102, $query, 100, "Session Variable Queried");
// Find Documents in Collection
$documents = $collection->find($query);
// Only Available for Sessions:
if ($REQUEST->avail("sid")) {
    $SESSION = new Session($REQUEST->get("sid"));
} else {
    $SESSION = new Session();
}
if ($REQUEST->avail("key")) {
    $OUTPUT->success(1, $SESSION->get($REQUEST->get("key")), $documents);
} else {
    $OUTPUT->success(1, $SESSION->get(), $documents);
Exemple #9
0
<?php

/* Reformatted 12.11.2015 */
// Helper function's and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$db = new Db("Scoreboard");
$OUTPUT = new Output();
// Get Request Variables
$REQUEST = new Request();
// No Priveleges needed
$RULES = new Rules(0, "scoreboard");
// Select collection
$collectionName = Helper::getCollectionName($REQUEST, "Users");
$collection = $db->selectCollection($collectionName);
// Find Ownership Rules
$OWNERSHIP = new Ownership($RULES);
// Format a query from the request
$query = Helper::formatQuery($REQUEST, "user_id", "user_id");
// Used for analytics
$LOG = new Logging("Asset.query");
$LOG->log($RULES->getId(), 32, $query, 100, "User Queried Asset");
// Find Documents in Collection
$documents = $collection->find($query);
// Filter out unOwned Documents
$documents = $OWNERSHIP->query($documents);
// Output
$OUTPUT->success(1, $documents);
Exemple #10
0
<?php

/* Reformatted 12.11.2015 */
// Helper script and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("Auth");
$OUTPUT = new Output();
// Get Request Data
$REQUEST = new Request();
// Admin Privleges Required
$RULES = new Rules(5, "oauth");
// Selects Collection from Databse Connection
$collectionName = Helper::getCollectionName($REQUEST, "Clients");
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "client_name");
// Used for anayltics
$LOG = new Logging("OAuth.query");
$LOG->log($RULES->getId(), 72, $query, 100, "OAuth Providers Queried");
// Find Documents in Collection
$documents = $collection->find($query);
// Output
$OUTPUT->success(0, $documents);
?>

  
Exemple #11
0
/* Reformatted 12.11.2015 */
// Helper and includes
include_once '/var/www/html/Lux/Core/Helper.php';
// Create Database Connection
$DB = new Db("System");
$OUTPUT = new Output();
// Get Request Variables
$REQUEST = new Request();
// Admin privleges required
$RULES = new Rules(5, "contact");
// Select Collection From Database Connection
$collectionName = Helper::getCollectionName($REQUEST, "Contact");
$collection = $DB->selectCollection($collectionName);
// Format Query
$query = Helper::formatQuery($REQUEST, "email_id");
//array("email_id" => $REQUEST->get("email_id"));
// values that are accepted by the adjustment script
$permitted = array("address[]", "address", "sender", "email_id");
// Format and Update Options
$update = Helper::updatePermitted($REQUEST, $permitted);
$options = Helper::formatOptions($REQUEST);
// Used for analytics
$LOG = new Logging("Contact.adjust");
$LOG->log($RULES->getId(), 61, $query, 100, "Content Updated");
// Find and Modify Documents in Collection
$document = $collection->findAndModify($query, $update, $options);
// Output
$OUTPUT->success(0, $document);
?>
Exemple #12
0
<?php

include_once '/var/www/html/Lux/Core/Helper.php';
$db = new Db("Inventory");
$OUTPUT = new Output();
$REQUEST = new Request();
$orders = $db->selectCollection("Orders");
$RULES = new Rules(1, "orders");
$REQUEST = new Request();
// get the asset, push it into the cart that is selected
$document = $orders->findAndModify(Helper::formatQuery($REQUEST), array("shipper_id" => $RULES->getId(), "status.shipped" => true, "status.recieved" => true, "status.paid" => true, "status.modified" => true, "status.processed" => true, "status.finalized" => true));
$OUTPUT->success(0, $document, null);