* This file is an addition to the 
 * Framework for Object Orientated Web Development (Foowd).
 */
/**
 * Error handling functions/class/constants.
 *
 * $Id$
 * @package smdoc
 * @subpackage error
 */
/** Include storage class */
include_once SM_DIR . 'smdoc.class.storage.php';
/** Set constants and meta data */
setClassMeta('smdoc_error', 'Error Display');
setConst('ERROR_CLASS_ID', META_SMDOC_ERROR_CLASS_ID);
setConst('ERROR_TITLE', _("Page Error"));
/** METHOD PERMISSIONS **/
setPermission('smdoc_error', 'object', 'view', 'Everybody');
/**
 * Error class.
 *
 * Used for rendering error messages
 *
 * @package smdoc
 * @subpackage error
 */
class smdoc_error extends smdoc_storage
{
    /**
     * String containing error message.
     * @var string
 *
 * $Id$
 * @package smdoc
 */
/** METHOD PERMISSIONS */
setPermission('smdoc_news', 'class', 'create', 'News');
setPermission('smdoc_news', 'class', 'list', 'Everybody');
setPermission('smdoc_news', 'object', 'history', 'Nobody');
setPermission('smdoc_news', 'object', 'diff', 'Nobody');
setPermission('smdoc_news', 'object', 'revert', 'Nobody');
setPermission('smdoc_news', 'object', 'delete', 'News');
setPermission('smdoc_news', 'object', 'edit', 'News');
/** Class Descriptor/Meta information */
setClassMeta('smdoc_news', 'News');
setConst('NEWS_CLASS_ID', META_SMDOC_NEWS_CLASS_ID);
setConst('NEWS_CLASS_NAME', 'smdoc_news');
/**
 * Array identifying news source
 * @global array $NEWS_SOURCE
 */
global $NEWS_SOURCE;
$NEWS_SOURCE = array('table' => 'smdoc_news', 'table_create' => array(getClassname(NEWS_CLASS_ID), 'makeTable'));
/** 
 * Global containing default news categories 
 * @global array $NEWS_CATEGORIES
 */
global $NEWS_CATEGORIES;
$NEWS_CATEGORIES = array('None', 'Development', 'Stable', 'Plugins');
/**
 * News items/blurbs
 *
Beispiel #3
0
/**
 * Set class meta data.
 *
 * @param string className Name of the class.
 * @param string description Text description of the class.
 */
function setClassMeta($className, $description)
{
    $classid = crc32(strtolower($className));
    setConst('META_' . $classid . '_CLASSNAME', $className);
    setConst('META_' . $classid . '_DESCRIPTION', $description);
    setConst('META_' . strtoupper($className) . '_CLASS_ID', $classid);
}
 * @package smdoc
 * @subpackage Foowd
 */
/** Method permissions */
setPermission('foowd_text_plain', 'class', 'create', 'Edit');
setPermission('foowd_text_plain', 'object', 'edit', 'Edit');
setPermission('foowd_text_plain', 'object', 'revert', 'Edit');
setPermission('foowd_text_plain', 'object', 'delete', 'Edit');
setPermission('foowd_text_plain', 'object', 'clone', 'Edit');
/** Class descriptor/Meta information */
setClassMeta('foowd_text_plain', 'Plain Text');
/* Class settings */
setConst('DIFF_COMMAND', 'diff -Bb -u5');
setConst('DIFF_ADD_REGEX', '/^\\+([^+].*)/');
setConst('DIFF_MINUS_REGEX', '/^\\-([^-].*)/');
setConst('DIFF_SAME_REGEX', '/^ (.*)/');
/**
 * Plain text object class.
 *
 * This class defines a plain text area and methods to view and edit that area.
 *
 * @author Paul James
 * @package smdoc
 * @subpackage text
 */
class foowd_text_plain extends foowd_object
{
    /**
     * The text body.
     *
     * @var string
 * @package Foowd
 */
/** Method permissions */
setPermission('foowd_workspace', 'class', 'create', 'Gods');
setPermission('foowd_workspace', 'class', 'enter', 'Gods');
setPermission('foowd_workspace', 'object', 'edit', 'Gods');
setPermission('foowd_workspace', 'object', 'enter', 'Gods');
setPermission('foowd_workspace', 'object', 'fill', 'Gods');
setPermission('foowd_workspace', 'object', 'empty', 'Gods');
setPermission('foowd_workspace', 'object', 'export', 'Gods');
setPermission('foowd_workspace', 'object', 'import', 'Gods');
/** Class descriptor */
setClassMeta('foowd_workspace', 'Workspace');
setConst('WORKSPACE_CLASS_ID', META_FOOWD_WORKSPACE_CLASS_ID);
/** Workspace settings */
setConst('WORKSPACE_EXPORT_COMPRESS', FALSE);
/**
 * The Foowd workspace class.
 *
 * Class for holding information about a workspace and providing methods for
 * placing objects in and removing them from the workspace, and exporting
 * and importing objects from XML files.
 *
 * @author Paul James
 * @package Foowd
 */
class foowd_workspace extends foowd_object
{
    /**
     * A text description of the workspace.
     * 
Beispiel #6
0
setConst('DEBUG_MODE', 1);
setConst('DEBUG_LOG_FILE', ET_SDK_PATH . "/etws_log.txt");
setConst('ETRADE_OAUTH_SERVER', 'https://etws.etrade.com');
setConst('AUTHORIZE_URL', 'https://us.etrade.com/e/t/etws/authorize');
setConst('ETRADE_SERVER', 'https://etws.etrade.com');
setConst('REQUEST_TOKEN_URL', ETRADE_SERVER . '/oauth/request_token');
setConst('ACCESS_TOKEN_URL', ETRADE_SERVER . '/oauth/access_token');
setConst('RENEW_TOKEN_URL', ETRADE_SERVER . '/oauth/renew_access_token');
setConst('REVOKE_TOKEN_URL', ETRADE_SERVER . '/oauth/revoke_access_token');
setConst('URL_ACCOUNTLIST', ETRADE_SERVER . '/accounts/rest/accountlist');
setConst('URL_ACCOUNTBALANCE', ETRADE_SERVER . '/accounts/rest/accountbalance');
setConst('URL_ACCOUNTPOSITIONS', ETRADE_SERVER . '/accounts/rest/accountpositions');
setConst('URL_ACCOUNTALERTS', ETRADE_SERVER . '/accounts/rest/alerts');
setConst('URL_TRANSACTION_HISTORY', ETRADE_SERVER . '/accounts/rest');
setConst('URL_OPTIONCHAINS', ETRADE_SERVER . '/market/rest/optionchains');
setConst('URL_MARKETINDICES', ETRADE_SERVER . '/market/rest/marketindices');
setConst('URL_PRODUCTLOOKUP', ETRADE_SERVER . '/market/rest/productlookup');
setConst('URL_GETQUOTE', ETRADE_SERVER . '/market/rest/quote');
setConst('URL_EXPIRYDATES', ETRADE_SERVER . '/market/rest/optionexpiredate');
setConst('URL_ORDERLIST', ETRADE_SERVER . '/order/rest/orderlist');
setConst('URL_PL_EQ_ORDER', ETRADE_SERVER . '/order/rest/placeequityorder');
setConst('URL_PL_OP_ORDER', ETRADE_SERVER . '/order/rest/placeoptionorder');
setConst('URL_PR_EQ_ORDER', ETRADE_SERVER . '/order/rest/previewequityorder');
setConst('URL_PR_OP_ORDER', ETRADE_SERVER . '/order/rest/previewoptionorder');
setConst('URL_PR_CH_EQ_ORDER', ETRADE_SERVER . '/order/rest/previewchangeequityorder');
setConst('URL_PL_CH_EQ_ORDER', ETRADE_SERVER . '/order/rest/placechangeequityorder');
setConst('URL_PR_CH_OP_ORDER', ETRADE_SERVER . '/order/rest/previewchangeoptionorder');
setConst('URL_PL_CH_OP_ORDER', ETRADE_SERVER . '/order/rest/placechangeoptionorder');
setConst('URL_CANCEL_ORDER', ETRADE_SERVER . '/order/rest/cancelorder');
setConst('PUSH_URL', 'https://etwspushsb.etrade.com/apistream/cometd/oauth/');
        exit;
}
setConst('RESPONSE_FORMAT', 'xml');
setConst('REQUEST_FORMAT', 'json');
// It can be 'json' or 'xml', default is xml.
setConst('DEBUG_MODE', 1);
setConst('REQUEST_TOKEN_URL', ETRADE_OAUTH_SERVER . '/oauth/request_token');
setConst('ACCESS_TOKEN_URL', ETRADE_OAUTH_SERVER . '/oauth/access_token');
setConst('RENEW_TOKEN_URL', ETRADE_OAUTH_SERVER . '/oauth/renew_access_token');
setConst('REVOKE_TOKEN_URL', ETRADE_OAUTH_SERVER . '/oauth/revoke_access_token');
setConst('URL_ACCOUNTLIST', ETRADE_SERVER . '/accounts/' . $url_str_part . 'rest/accountlist');
setConst('URL_ACCOUNTBALANCE', ETRADE_SERVER . '/accounts/' . $url_str_part . 'rest/accountbalance');
setConst('URL_ACCOUNTPOSITIONS', ETRADE_SERVER . '/accounts/' . $url_str_part . 'rest/accountpositions');
setConst('URL_ACCOUNTALERTS', ETRADE_SERVER . '/accounts/' . $url_str_part . 'rest/alerts');
setConst('URL_TRANSACTION_HISTORY', ETRADE_SERVER . '/accounts/' . $url_str_part . 'rest');
setConst('URL_OPTIONCHAINS', ETRADE_SERVER . '/market/' . $url_str_part . 'rest/optionchains');
setConst('URL_MARKETINDICES', ETRADE_SERVER . '/market/' . $url_str_part . 'rest/marketindices');
setConst('URL_PRODUCTLOOKUP', ETRADE_SERVER . '/market/' . $url_str_part . 'rest/productlookup');
setConst('URL_GETQUOTE', ETRADE_SERVER . '/market/' . $url_str_part . 'rest/quote');
setConst('URL_EXPIRYDATES', ETRADE_SERVER . '/market/' . $url_str_part . 'rest/optionexpiredate');
setConst('URL_ORDERLIST', ETRADE_SERVER . '/order/' . $url_str_part . 'rest/orderlist');
setConst('URL_PL_EQ_ORDER', ETRADE_SERVER . '/order/' . $url_str_part . 'rest/placeequityorder');
setConst('URL_PL_OP_ORDER', ETRADE_SERVER . '/order/' . $url_str_part . 'rest/placeoptionorder');
setConst('URL_PR_EQ_ORDER', ETRADE_SERVER . '/order/' . $url_str_part . 'rest/previewequityorder');
setConst('URL_PR_OP_ORDER', ETRADE_SERVER . '/order/' . $url_str_part . 'rest/previewoptionorder');
setConst('URL_PR_CH_EQ_ORDER', ETRADE_SERVER . '/order/' . $url_str_part . 'rest/previewchangeequityorder');
setConst('URL_PL_CH_EQ_ORDER', ETRADE_SERVER . '/order/' . $url_str_part . 'rest/placechangeequityorder');
setConst('URL_PR_CH_OP_ORDER', ETRADE_SERVER . '/order/' . $url_str_part . 'rest/previewchangeoptionorder');
setConst('URL_PL_CH_OP_ORDER', ETRADE_SERVER . '/order/' . $url_str_part . 'rest/placechangeoptionorder');
setConst('URL_CANCEL_ORDER', ETRADE_SERVER . '/order/' . $url_str_part . 'rest/cancelorder');
 *
 * This file is an addition/modification to the
 * Framework for Object Orientated Web Development (Foowd).
 */
/**
 * Specific user extensions for the SquirrelMail documentation site.
 *
 * $Id$
 *
 * @package smdoc
 * @subpackage user
 */
/** Class Descriptor/Meta information */
setClassMeta('smdoc_user', 'SMDoc User');
setConst('USER_CLASS_ID', META_SMDOC_USER_CLASS_ID);
setConst('USER_CLASS_NAME', 'smdoc_user');
/** Include the user base class */
include_once SM_DIR . 'class.user.php';
/**
 * The smdoc extended user class.
 *
 * Class for holding information about a user and providing methods for
 * manipulating and getting information on a user.
 *
 * @package smdoc
 * @subpackage user
 */
class smdoc_user extends base_user
{
    /**
     * Make a Foowd database table.
 * Framework for Object Orientated Web Development (Foowd).
 */
/**
 * Name lookup implementation used to map easy object name like 'faq' to 
 * an objectid/classid pair for retrieval.
 *
 * $Id$
 *
 * @package smdoc
 */
/** Class descriptor/Meta information */
setClassMeta('smdoc_name_lookup', 'Singleton object lookup/name manager');
setPermission('smdoc_name_lookup', 'class', 'list', 'Edit');
setConst('SHORTNAMES_ID', 1063068242);
/** Regex to validate shortname */
setConst('REGEX_SHORTNAME', '/^[a-z_-]{0,11}$/');
/** Base storage class */
include_once SM_DIR . 'smdoc.class.storage.php';
/**
 * Singleton class provides a basic mapping for 
 * well-known simple names (faq, privacy..)
 * to objectid/className pairs.
 * 
 * @package smdoc
 */
class smdoc_name_lookup extends smdoc_storage
{
    /**
     * Array mapping shortnames to objectid/classid pairs
     * @var array
     */
 * Licensed under the GNU GPL. For full terms see the file COPYING.
 *
 * This file is an addition/modification to the
 * Framework for Object Orientated Web Development (Foowd).
 */
/** 
 * Defines small class for storing additional groups
 * in a single DB record.
 * 
 * $Id$
 * @package smdoc
 * @subpackage group
 */
/** Class descriptor/Meta information */
setClassMeta('smdoc_group_appext', 'Management of additional non-system groups');
setConst('APP_GROUPS_ID', -1807156497);
/** Base Storage class */
include_once SM_DIR . 'smdoc.class.storage.php';
/**
 * Small singleton class that stores additional groups in the DB
 * Managed by smdoc_group
 *
 * @package smdoc
 * @subpackage group
 */
class smdoc_group_appext extends smdoc_storage
{
    /**
     * Array containing application specific groups
     * @var array
     */
 *
 * $Id$
 * @see foowd_workspace
 * @package smdoc
 */
/** METHOD PERMISSIONS **/
setPermission('smdoc_translation', 'class', 'create', 'Translator');
setPermission('smdoc_translation', 'class', 'enter', 'Everybody');
setPermission('smdoc_translation', 'object', 'fill', 'Translator');
setPermission('smdoc_translation', 'object', 'empty', 'Translator');
setPermission('smdoc_translation', 'object', 'export', 'Gods');
setPermission('smdoc_translation', 'object', 'import', 'Gods');
/** CLASS DESCRIPTOR **/
setClassMeta('smdoc_translation', 'Site Translation');
setConst('TRANSLATION_CLASS_ID', META_SMDOC_TRANSLATION_CLASS_ID);
setConst('TRANSLATION_DEFAULT_LANGUAGE', 'en_US');
/** Base workspace implementation */
require_once SM_DIR . 'class.workspace.php';
/**
 * Extension of workspaces to allow all-in-one-place
 * management of site and translations.
 *
 * @package smdoc
 * @subpackage translation
 */
class smdoc_translation extends foowd_workspace
{
    /**
     * filename of applicable language flag.. 
     * @var string
     */
Beispiel #12
0
/**
 * check PHP version
 */
if (version_compare(phpversion(), '4.2.0', '<')) {
    trigger_error('You need PHP version 4.2.0 or greater to run FOOWD, please upgrade', E_USER_ERROR);
}
/**
 * define regex constants
 */
setConst('REGEX_ID', '/^[0-9-]{1,11}$/');
setConst('REGEX_TITLE', '/^[a-zA-Z0-9-_ \\[\\]&\\.\\?\\!]{1,32}$/');
setConst('REGEX_VERSION', '/^[0-9]*$/');
setConst('REGEX_PASSWORD', '/^[A-Za-z0-9]{4,32}$/');
setConst('REGEX_DATETIME', '/^[0-9-]{1,10}$/');
setConst('REGEX_EMAIL', '/^[A-Za-z0-9._-]+@[A-Za-z0-9._-]+\\.[A-Za-z]{1,4}$/');
setConst('REGEX_GROUP', '/^[a-zA-Z0-9-]{0,32}$/');
/**
 * The Foowd environment class.
 *
 * Sets up the Foowd environment, including database connection, user group
 * management and user initialisation, and provides methods for accessing
 * objects within the system.
 *
 * @author Paul James
 * @package Foowd
 * @version 0.8.4
 */
class foowd
{
    /* additional settings vars */
    /**
Beispiel #13
0
 * Framework for Object Orientated Web Development (Foowd).
 *
 * $Id$
 */
/**
 * Permission and constant definitions for the smdoc extended user class.
 *
 * @package smdoc
 * @subpackage user
 */
/**
 * Set constants and meta information for the user class
 */
setClassMeta('base_user', 'Base User');
setConst('USER_CLASS_ID', META_BASE_USER_CLASS_ID);
setConst('USER_CLASS_NAME', 'base_user');
/**
 * @global array $USER_SOURCE
 */
global $USER_SOURCE;
$USER_SOURCE = array('table' => 'smdoc_user', 'table_create' => array(getClassname(USER_CLASS_ID), 'makeTable'));
setPermission('base_user', 'class', 'login', 'Everybody');
setPermission('base_user', 'class', 'logout', 'Registered');
setPermission('base_user', 'class', 'create', 'Everybody');
setPermission('base_user', 'class', 'list', 'Everybody');
setPermission('base_user', 'object', 'groups', 'Gods');
setPermission('base_user', 'object', 'update', 'Author');
setPermission('base_user', 'object', 'clone', 'Nobody');
setPermission('base_user', 'object', 'admin', 'Nobody');
setPermission('base_user', 'object', 'xml', 'Nobody');
setPermission('base_user', 'object', 'permissions', 'Nobody');