function __construct()
 {
     $preferences = getPreferences();
     // what the hell is this used for?
     $this->EPOCH = new DateTime('5 January 2014');
     $this->START_DATE = $preferences['StartDate'];
     $this->END_DATE = $preferences['EndDate'];
     $this->BOOK_PAGES = $preferences['book_pages'];
     $this->FILM_MINUTES = $preferences['film_minutes'];
     $this->TARGETS = array('book' => $this->BOOK_PAGES, 'film' => $this->FILM_MINUTES);
     $this->ACTIONS = array('book' => 'inc_pagesread', 'film' => 'inc_minuteswatched');
     $this->ENTRYCONTENT = array('book' => 'PagesRead', 'film' => 'MinutesWatched');
     $this->TAGS = array('book' => array("#book", "#read"), 'film' => array("#film", "#movie", "#watch", "#listen", "#audio", "#radio"));
     $this->CHALLENGECONTENT = array('book' => 'Books', 'film' => 'Films');
     $this->CONTENTTYPE = array('pagesread' => 'book', 'minuteswatched' => 'film');
     $this->CONSUMER_KEY = $preferences['consumer_key'];
     $this->CONSUMER_SECRET_KEY = $preferences['consumer_secret_key'];
     $this->OAUTH_TOKEN = $preferences['oauth_token'];
     $this->OAUTH_SECRET_TOKEN = $preferences['oauth_secret_token'];
 }
Example #2
0
/**
 * Process the mail form results.
 *
 * This method is in charge of processing the mail form which
 * is posted from the CoffeeCup Flash Form Builder SWF.  This
 * process includes:
 * 
 * - Retrieving the preferences from the included CoffeeCup Flash
 *   Form Builder XML preferences file.
 * - Formats output for file output as well as for an email to
 *   the form user and the form owner as necesarry.
 * - Writes output to a file and sends it to the form user and
 *   the form owner as necessary.
 * - Writes form results to a database if necesarry.
 */
function processMailForm()
{
    fixUploadedFileName();
    $preferences = getPreferences();
    foreach ($preferences['form_fields'] as $key => $value) {
        if (trim($_POST[$key]) != '') {
            $email_response .= "{$key}: {$_POST[$key]}" . CC_FB_SENDMAIL_EOL . CC_FB_SENDMAIL_EOL;
            $form_response .= "{$key}: {$_POST[$key]}<br/>\n";
            $txt_file .= "{$key}: {$_POST[$key]}|";
        }
    }
    // If a file was uploaded, add the appropriate data to the response
    // fields
    if ($_POST['Uploaded_File'] != "") {
        $email_response .= "Uploaded File: {$_POST['Uploaded_File']}" . CC_FB_SENDMAIL_EOL . CC_FB_SENDMAIL_EOL;
        $form_response .= "    Uploaded File: {$_POST['Uploaded_File']}" . "<br/>\n";
        $txt_file .= "Uploaded File: {$_POST['Uploaded_File']}|";
    }
    sendResponseEmails($email_response, $preferences);
    writeResponseToFile($txt_file);
    writeResponseToDatabase($preferences);
    // Make sure we delete the file from the server if the user doesn't
    // want it
    if (!CC_FB_ATTACHMENT_SAVETOSERVER && $_POST['Uploaded_File'] != '') {
        @unlink(CC_FB_UPLOADS_DIRECTORY . "/{$_POST['Uploaded_File']}");
    }
    printResponsePage($form_response, $preferences);
}
Example #3
0
    die('You should not access this file directly.');
}
// @todo    remove database query
##
## add or edit a user preferences
##
$user_id = (int) w2PgetParam($_GET, 'user_id', '0');
$perms =& $AppUI->acl();
// check permissions for this record
$canEdit = canEdit('system');
// Check permissions
if (!$canEdit && $user_id != $AppUI->user_id) {
    $AppUI->redirect(ACCESS_DENIED);
}
// load the preferences
$prefs = getPreferences($user_id);
// get the user name
if ($user_id) {
    $user = CContact::getContactByUserid($user_id);
} else {
    $user = '******';
}
$titleBlock = new w2p_Theme_TitleBlock('Edit User Preferences', 'myevo-weather.png', $m);
$perms =& $AppUI->acl();
if ($canEdit) {
    $titleBlock->addCrumb('?m=system', 'system admin');
    $titleBlock->addCrumb('?m=system&a=systemconfig', 'system configuration');
}
$titleBlock->show();
?>
<script language="javascript" type="text/javascript">
Example #4
0
     getBestDrink();
     break;
 case "getSortedDrinks":
     getSortedDrinks();
     break;
 case "addPref":
     addPref();
     break;
 case "removePref":
     removePref();
     break;
 case "getAllDrinks":
     getAllDrinks();
     break;
 case "getPreferences":
     getPreferences();
     break;
 case "getDrinkTraits":
     getDrinkTraits();
     break;
 case "getDrinkInfo":
     getDrinkInfo();
     break;
 case "getRandomBestDrink":
     getRandomBestDrink();
     break;
 case "doSearch":
     doSearch();
     break;
 case "getNumPages":
     getNumPages();
Example #5
0
<?php

//stop the direct browsing to this file - let index.php handle which files get displayed
checkLogin();
$debtor = getTopDebtor();
$customer = getTopCustomer();
$biller = getTopBiller();
$billers = getBillers();
$customers = getCustomers();
$taxes = getTaxes();
$products = getProducts();
$preferences = getPreferences();
$defaults = getSystemDefaults();
if ($billers == null or $customers == null or $taxes == null or $products == null or $preferences == null) {
    $first_run_wizard = true;
    $smarty->assign("first_run_wizard", $first_run_wizard);
}
$smarty->assign("mysql", $mysql);
$smarty->assign("db_server", $db_server);
/*
$smarty -> assign("patch",count($patch));
$smarty -> assign("max_patches_applied", $max_patches_applied);
*/
$smarty->assign("biller", $biller);
$smarty->assign("billers", $billers);
$smarty->assign("customer", $customer);
$smarty->assign("customers", $customers);
$smarty->assign("taxes", $taxes);
$smarty->assign("products", $products);
$smarty->assign("preferences", $preferences);
$smarty->assign("debtor", $debtor);