Changeset 439 for branches


Ignore:
Timestamp:
Nov 30, 2013 7:30:44 PM (10 years ago)
Author:
anonymous
Message:

added public and private keywords to all properties and methods, changed old classname constructor function to construct, removed more ?> closing tags

Location:
branches/eli_branch
Files:
37 edited

Legend:

Unmodified
Added
Removed
  • branches/eli_branch/bin/acl.cli.php

    r415 r439  
    375375
    376376
    377 ?>
  • branches/eli_branch/bin/module_maker/_config.inc.php

    r432 r439  
    7373
    7474
    75 ?>
  • branches/eli_branch/docs/examples/contact_form/contact.php

    r413 r439  
    119119}
    120120
    121 ?>
  • branches/eli_branch/docs/examples/example.cli.php

    r396 r439  
    146146
    147147
    148 ?>
  • branches/eli_branch/lib/ACL.inc.php

    r438 r439  
    4040
    4141    // Configuration parameters for this object.
    42     var $_params = array(
     42    private $_params = array(
    4343       
    4444        // If false nothing will be cached or retrieved. Useful for testing realtime data requests.
     
    5252     * Constructor.
    5353     */
    54     function ACL()
     54    public function __construct()
    5555    {
    5656        $app =& App::getInstance();
     
    7373     * @static
    7474     */
    75     static function &getInstance()
     75    public static function &getInstance()
    7676    {
    7777        static $instance = null;
     
    9191     * @param  array    $params     Array of parameters (key => val pairs).
    9292     */
    93     function setParam($params)
     93    public function setParam($params)
    9494    {
    9595        $app =& App::getInstance();
     
    110110     * @return mixed               Configured parameter value.
    111111     */
    112     function getParam($param)
     112    public function getParam($param)
    113113    {
    114114        $app =& App::getInstance();
     
    129129     * @since   04 Jun 2006 16:41:42
    130130     */
    131     function initDB($recreate_db=false)
     131    public function initDB($recreate_db=false)
    132132    {
    133133        $app =& App::getInstance();
     
    224224    * @since    14 Jun 2006 22:39:29
    225225    */
    226     function add($name, $parent=null, $type)
     226    public function add($name, $parent=null, $type)
    227227    {
    228228        $app =& App::getInstance();
     
    287287
    288288    // Alias functions for the different object types.
    289     function addRequestObject($name, $parent=null)
     289    public function addRequestObject($name, $parent=null)
    290290    {
    291291        return $this->add($name, $parent, 'aro');
    292292    }
    293     function addControlObject($name, $parent=null)
     293    public function addControlObject($name, $parent=null)
    294294    {
    295295        return $this->add($name, $parent, 'aco');
    296296    }
    297     function addXtraObject($name, $parent=null)
     297    public function addXtraObject($name, $parent=null)
    298298    {
    299299        return $this->add($name, $parent, 'axo');
     
    311311    * @since    14 Jun 2006 22:39:29
    312312    */
    313     function remove($name, $type)
     313    public function remove($name, $type)
    314314    {
    315315        $app =& App::getInstance();
     
    368368   
    369369    // Alias functions for the different object types.
    370     function removeRequestObject($name)
     370    public function removeRequestObject($name)
    371371    {
    372372        return $this->remove($name, 'aro');
    373373    }
    374     function removeControlObject($name)
     374    public function removeControlObject($name)
    375375    {
    376376        return $this->remove($name, 'aco');
    377377    }
    378     function removeXtraObject($name)
     378    public function removeXtraObject($name)
    379379    {
    380380        return $this->remove($name, 'axo');
     
    393393    * @since    14 Jun 2006 22:39:29
    394394    */
    395     function move($name, $new_parent, $type)
     395    public function move($name, $new_parent, $type)
    396396    {
    397397        $app =& App::getInstance();
     
    490490   
    491491    // Alias functions for the different object types.
    492     function moveRequestObject($name, $new_parent=null)
     492    public function moveRequestObject($name, $new_parent=null)
    493493    {
    494494        return $this->move($name, $new_parent, 'aro');
    495495    }
    496     function moveControlObject($name, $new_parent=null)
     496    public function moveControlObject($name, $new_parent=null)
    497497    {
    498498        return $this->move($name, $new_parent, 'aco');
    499499    }
    500     function moveXtraObject($name, $new_parent=null)
     500    public function moveXtraObject($name, $new_parent=null)
    501501    {
    502502        return $this->move($name, $new_parent, 'axo');
     
    516516    * @since    15 Jun 2006 01:58:48
    517517    */
    518     function grant($aro=null, $aco=null, $axo=null, $access='allow')
     518    public function grant($aro=null, $aco=null, $axo=null, $access='allow')
    519519    {
    520520        $app =& App::getInstance();
     
    573573    * @since    15 Jun 2006 04:35:54
    574574    */
    575     function revoke($aro=null, $aco=null, $axo=null)
     575    public function revoke($aro=null, $aco=null, $axo=null)
    576576    {
    577577        return $this->grant($aro, $aco, $axo, 'deny');
     
    591591    * @since    20 Jun 2006 20:16:12
    592592    */
    593     function delete($aro=null, $aco=null, $axo=null)
     593    public function delete($aro=null, $aco=null, $axo=null)
    594594    {
    595595        $app =& App::getInstance();
     
    650650    * @since    15 Jun 2006 03:58:23
    651651    */
    652     function check($aro, $aco=null, $axo=null)
     652    public function check($aro, $aco=null, $axo=null)
    653653    {
    654654        $app =& App::getInstance();
  • branches/eli_branch/lib/App.inc.php

    r433 r439  
    4343
    4444    // Namespace of this application instance.
    45     var $_ns;
     45    private $_ns;
    4646
    4747    // If $app->start has run successfully.
    48     var $running = false;
     48    public $running = false;
    4949
    5050    // Instance of database object.
    51     var $db;
     51    public $db;
    5252
    5353    // Array of query arguments will be carried persistently between requests.
    54     var $_carry_queries = array();
     54    private $_carry_queries = array();
    5555
    5656    // Dictionary of global application parameters.
    57     var $_params = array();
     57    private $_params = array();
    5858
    5959    // Default parameters.
    60     var $_param_defaults = array(
     60    private $_param_defaults = array(
    6161
    6262        // Public name and email address for this application.
     
    169169     * @static
    170170     */
    171     static function &getInstance($namespace='')
     171    public static function &getInstance($namespace='')
    172172    {
    173173        static $instance = null;
     
    183183     * Constructor.
    184184     */
    185     function App($namespace='')
     185    public function __construct($namespace='')
    186186    {
    187187        // Set namespace of application instance.
     
    203203     * @param  array    $param     Array of parameters (key => val pairs).
    204204     */
    205     function setParam($param=null)
     205    public function setParam($param=null)
    206206    {
    207207        if (isset($param) && is_array($param)) {
     
    218218     * @return  mixed               Parameter value, or null if not existing.
    219219     */
    220     function getParam($param=null)
     220    public function getParam($param=null)
    221221    {
    222222        if ($param === null) {
     
    237237     * @since   15 Jul 2005 00:32:21
    238238     */
    239     function start()
     239    public function start()
    240240    {
    241241        if ($this->running) {
     
    394394     * @since   17 Jul 2005 17:20:18
    395395     */
    396     function stop()
     396    public function stop()
    397397    {
    398398        session_write_close();
     
    421421     * @param string $line    __LINE__.
    422422     */
    423     function raiseMsg($message, $type=MSG_NOTICE, $file=null, $line=null)
     423    public function raiseMsg($message, $type=MSG_NOTICE, $file=null, $line=null)
    424424    {
    425425        $message = trim($message);
     
    463463     * @since   21 Dec 2005 13:09:20
    464464     */
    465     function getRaisedMessages()
     465    public function getRaisedMessages()
    466466    {
    467467        if (!$this->running) {
     
    480480     * @since   21 Dec 2005 13:21:54
    481481     */
    482     function clearRaisedMessages()
     482    public function clearRaisedMessages()
    483483    {
    484484        if (!$this->running) {
     
    501501     * @since   15 Jul 2005 01:39:14
    502502     */
    503     function printRaisedMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg')
     503    public function printRaisedMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg')
    504504    {
    505505        if (!$this->running) {
     
    574574     * @param string $line      The line of the file where the log event occurs.
    575575     */
    576     function logMsg($message, $priority=LOG_INFO, $file=null, $line=null)
     576    public function logMsg($message, $priority=LOG_INFO, $file=null, $line=null)
    577577    {
    578578        static $previous_events = array();
     
    704704     * @return                The string representation of $priority.
    705705     */
    706     function logPriorityToString($priority) {
     706    public function logPriorityToString($priority) {
    707707        $priorities = array(
    708708            LOG_EMERG   => 'emergency',
     
    733733     * @since   13 Oct 2007 11:34:51
    734734     */
    735     function setQuery($query_key, $val)
     735    public function setQuery($query_key, $val)
    736736    {
    737737        if (!is_array($query_key)) {
     
    755755     * @since   14 Nov 2005 19:24:52
    756756     */
    757     function carryQuery($query_key, $default=false)
     757    public function carryQuery($query_key, $default=false)
    758758    {
    759759        if (!is_array($query_key)) {
     
    780780     * @since   18 Jun 2007 20:57:29
    781781     */
    782     function dropQuery($query_key, $unset=false)
     782    public function dropQuery($query_key, $unset=false)
    783783    {
    784784        if (!is_array($query_key)) {
     
    816816     * @return string url with attached queries and, if not using cookies, the session id
    817817     */
    818     function url($url, $carry_args=null, $always_include_sid=false)
     818    public function url($url, $carry_args=null, $always_include_sid=false)
    819819    {
    820820        if (!$this->running) {
     
    907907     * @since   09 Dec 2005 17:58:45
    908908     */
    909     function oHREF($url, $carry_args=null, $always_include_sid=false)
     909    public function oHREF($url, $carry_args=null, $always_include_sid=false)
    910910    {
    911911        $url = $this->url($url, $carry_args, $always_include_sid);
     
    927927     *                                      false  <-- To not carry any queries. If URL already has queries those will be retained.
    928928     */
    929     function printHiddenSession($carry_args=null)
     929    public function printHiddenSession($carry_args=null)
    930930    {
    931931        if (!$this->running) {
     
    986986     * @param   bool    $always_include_sid     Force session id to be added to Location header.
    987987     */
    988     function dieURL($url, $carry_args=null, $always_include_sid=false)
     988    public function dieURL($url, $carry_args=null, $always_include_sid=false)
    989989    {
    990990        if (!$this->running) {
     
    10331033    * @since    31 Mar 2006 19:17:00
    10341034    */
    1035     function dieBoomerangURL($id=null, $carry_args=null, $default_url=null, $queryless_referrer_comparison=false)
     1035    public function dieBoomerangURL($id=null, $carry_args=null, $default_url=null, $queryless_referrer_comparison=false)
    10361036    {
    10371037        if (!$this->running) {
     
    10761076     * FIXME: url garbage collection?
    10771077     */
    1078     function setBoomerangURL($url=null, $id=null)
     1078    public function setBoomerangURL($url=null, $id=null)
    10791079    {
    10801080        if (!$this->running) {
     
    11151115     * @param string  $id     An identification tag for this url.
    11161116     */
    1117     function getBoomerangURL($id=null)
     1117    public function getBoomerangURL($id=null)
    11181118    {
    11191119        if (!$this->running) {
     
    11401140     * @param string  $id     An identification tag for this url.
    11411141     */
    1142     function deleteBoomerangURL($id=null)
     1142    public function deleteBoomerangURL($id=null)
    11431143    {
    11441144        if (!$this->running) {
     
    11621162     * @return bool  True if it is set and valid, false otherwise.
    11631163     */
    1164     function validBoomerangURL($id=null, $use_nonspecificboomerang=false)
     1164    public function validBoomerangURL($id=null, $use_nonspecificboomerang=false)
    11651165    {
    11661166        if (!$this->running) {
     
    12121212     * the same page but with https.
    12131213     */
    1214     function sslOn()
     1214    public function sslOn()
    12151215    {
    12161216        if (function_exists('apache_get_modules')) {
     
    12331233     * a http version of the current url.
    12341234     */
    1235     function sslOff()
     1235    public function sslOff()
    12361236    {
    12371237        if ('' != getenv('HTTPS')) {
     
    12421242
    12431243} // End.
    1244 
    1245 ?>
  • branches/eli_branch/lib/Auth_File.inc.php

    r396 r439  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    3030 * @version 1.2
    3131 */
    32  
     32
    3333// Usage example:
    3434// $auth = new Auth_File();
     
    4747
    4848class Auth_File {
    49    
     49
    5050    // Namespace of this auth object.
    51     var $_ns;
    52    
     51    private $_ns;
     52
    5353    // Parameters to be specified by setParam().
    54     var $_params = array();
    55     var $_default_params = array(
    56        
    57         // Full path to htpasswd file.
    58         'htpasswd_file' => null,
    59 
    60         // The type of encryption to use for passwords stored in the db_table. Use one of the AUTH_ENCRYPT_* types specified above.
    61         'encryption_type' => AUTH_ENCRYPT_CRYPT,
    62 
    63         // The URL to the login script.
    64         'login_url' => '/',
    65 
    66         // The maximum amount of time a user is allowed to be logged in. They will be forced to login again if they expire.
    67         // This applies to admins and users. In seconds. 21600 seconds = 6 hours.
    68         'login_timeout' => 21600,
    69 
    70         // The maximum amount of time a user is allowed to be idle before their session expires. They will be forced to login again if they expire.
    71         // This applies to admins and users. In seconds. 3600 seconds = 1 hour.
    72         'idle_timeout' => 3600,
    73 
    74         // An array of IP blocks that are bypass the remote_ip comparison check. Useful for dynamic IPs or those behind proxy servers.
    75         'trusted_networks' => array(),
    76     );
     54    private $_params = array();
     55    private $_default_params = array(
     56
     57    // Full path to htpasswd file.
     58    'htpasswd_file' => null,
     59
     60    // The type of encryption to use for passwords stored in the db_table. Use one of the AUTH_ENCRYPT_* types specified above.
     61    'encryption_type' => AUTH_ENCRYPT_CRYPT,
     62
     63    // The URL to the login script.
     64    'login_url' => '/',
     65
     66    // The maximum amount of time a user is allowed to be logged in. They will be forced to login again if they expire.
     67    // This applies to admins and users. In seconds. 21600 seconds = 6 hours.
     68    'login_timeout' => 21600,
     69
     70    // The maximum amount of time a user is allowed to be idle before their session expires. They will be forced to login again if they expire.
     71    // This applies to admins and users. In seconds. 3600 seconds = 1 hour.
     72    'idle_timeout' => 3600,
     73
     74    // An array of IP blocks that are bypass the remote_ip comparison check. Useful for dynamic IPs or those behind proxy servers.
     75    'trusted_networks' => array(), );
    7776
    7877    // Associative array of usernames to hashed passwords.
    79     var $_users = array();
     78    private $_users = array();
    8079
    8180    /**
     
    8685     * @param optional array $params  A hash containing parameters.
    8786     */
    88     function Auth_File($namespace='')
    89     {
    90         $this->_ns = $namespace;
     87    public function __construct($namespace = '') {
     88        $this -> _ns = $namespace;
    9189
    9290        // Initialize default parameters.
    93         $this->setParam($this->_default_params);
     91        $this -> setParam($this -> _default_params);
    9492    }
    9593
     
    10098     * @return bool true on success, false on failure
    10199     */
    102     function setParam($params)
    103     {
     100    public function setParam($params) {
    104101        if (isset($params) && is_array($params)) {
    105102            // Merge new parameters with old overriding only those passed.
    106             $this->_params = array_merge($this->_params, $params);
     103            $this -> _params = array_merge($this -> _params, $params);
    107104        }
    108105    }
     
    115112     * @return mixed               Configured parameter value.
    116113     */
    117     function getParam($param)
    118     {
    119         $app =& App::getInstance();
    120    
    121         if (isset($this->_params[$param])) {
    122             return $this->_params[$param];
     114    public function getParam($param) {
     115        $app = &App::getInstance();
     116
     117        if (isset($this -> _params[$param])) {
     118            return $this -> _params[$param];
    123119        } else {
    124             $app->logMsg(sprintf('Parameter is not set: %s', $param), LOG_DEBUG, __FILE__, __LINE__);
     120            $app -> logMsg(sprintf('Parameter is not set: %s', $param), LOG_DEBUG, __FILE__, __LINE__);
    125121            return null;
    126122        }
     
    132128     * @access public
    133129     */
    134     function clear()
    135     {
    136         $_SESSION['_auth_file'][$this->_ns] = array('authenticated' => false);
    137     }
    138 
     130    public function clear() {
     131        $_SESSION['_auth_file'][$this -> _ns] = array('authenticated' => false);
     132    }
    139133
    140134    /**
     
    145139     * @param mixed $val      Value to set variable to.
    146140     */
    147     function set($key, $val)
    148     {
    149         if (!isset($_SESSION['_auth_file'][$this->_ns]['user_data'])) {
    150             $_SESSION['_auth_file'][$this->_ns]['user_data'] = array();
    151         }
    152         $_SESSION['_auth_file'][$this->_ns]['user_data'][$key] = $val;
     141    public function set($key, $val) {
     142        if (!isset($_SESSION['_auth_file'][$this -> _ns]['user_data'])) {
     143            $_SESSION['_auth_file'][$this -> _ns]['user_data'] = array();
     144        }
     145        $_SESSION['_auth_file'][$this -> _ns]['user_data'][$key] = $val;
    153146    }
    154147
     
    161154     * @return mixed          Value stored in session.
    162155     */
    163     function get($key, $default='')
    164     {
    165         if (isset($_SESSION['_auth_file'][$this->_ns][$key])) {
    166             return $_SESSION['_auth_file'][$this->_ns][$key];
    167         } else if (isset($_SESSION['_auth_file'][$this->_ns]['user_data'][$key])) {
    168             return $_SESSION['_auth_file'][$this->_ns]['user_data'][$key];
     156    public function get($key, $default = '') {
     157        if (isset($_SESSION['_auth_file'][$this -> _ns][$key])) {
     158            return $_SESSION['_auth_file'][$this -> _ns][$key];
     159        } else if (isset($_SESSION['_auth_file'][$this -> _ns]['user_data'][$key])) {
     160            return $_SESSION['_auth_file'][$this -> _ns]['user_data'][$key];
    169161        } else {
    170162            return $default;
    171163        }
    172164    }
     165
    173166    /**
    174167     * Find out if a set of login credentials are valid. Only supports
     
    182175     * @return boolean  Whether or not the credentials are valid.
    183176     */
    184     function authenticate($username, $password)
    185     {
    186         $app =& App::getInstance();
    187    
     177    public function authenticate($username, $password) {
     178        $app = &App::getInstance();
     179
    188180        if ('' == trim($password)) {
    189             $app->logMsg(_("No password provided for authentication."), LOG_INFO, __FILE__, __LINE__);
    190             return false;
    191         }
    192        
     181            $app -> logMsg(_("No password provided for authentication."), LOG_INFO, __FILE__, __LINE__);
     182            return false;
     183        }
     184
    193185        // Load users file.
    194         $this->_loadHTPasswdFile();
    195 
    196         if (!isset($this->_users[$username])) {
    197             $app->logMsg(_("User ID provided does not exist."), LOG_INFO, __FILE__, __LINE__);
    198             return false;
    199         }
    200 
    201         if ($this->_encrypt($password, $this->_users[$username]) != $this->_users[$username]) {
    202             $app->logMsg(sprintf('Authentication failed for user %s', $username), LOG_INFO, __FILE__, __LINE__);
    203             return false;
    204         }
    205        
     186        $this -> _loadHTPasswdFile();
     187
     188        if (!isset($this -> _users[$username])) {
     189            $app -> logMsg(_("User ID provided does not exist."), LOG_INFO, __FILE__, __LINE__);
     190            return false;
     191        }
     192
     193        if ($this -> _encrypt($password, $this -> _users[$username]) != $this -> _users[$username]) {
     194            $app -> logMsg(sprintf('Authentication failed for user %s', $username), LOG_INFO, __FILE__, __LINE__);
     195            return false;
     196        }
     197
    206198        // Authentication successful!
    207199        return true;
     
    218210     * @return boolean  Whether or not the credentials are valid.
    219211     */
    220     function login($username, $password)
    221     {
     212    public function login($username, $password) {
    222213        $username = mb_strtolower(trim($username));
    223214
    224         $this->clear();
    225 
    226         if (!$this->authenticate($username, $password)) {
     215        $this -> clear();
     216
     217        if (!$this -> authenticate($username, $password)) {
    227218            // No login: failed authentication!
    228219            return false;
    229220        }
    230        
    231         $_SESSION['_auth_file'][$this->_ns] = array(
    232             'authenticated' => true,
    233             'username' => $username,
    234             'login_datetime' => date('Y-m-d H:i:s'),
    235             'last_access_datetime' => date('Y-m-d H:i:s'),
    236             'remote_ip' => getRemoteAddr()
    237         );
     221
     222        $_SESSION['_auth_file'][$this -> _ns] = array('authenticated' => true, 'username' => $username, 'login_datetime' => date('Y-m-d H:i:s'), 'last_access_datetime' => date('Y-m-d H:i:s'), 'remote_ip' => getRemoteAddr());
    238223
    239224        // We're logged-in!
     
    251236     * @access public
    252237     */
    253     function isLoggedIn()
    254     {
    255         $app =& App::getInstance();
    256    
     238    public function isLoggedIn() {
     239        $app = &App::getInstance();
     240
    257241        // Some users will access from networks with a changing IP number (i.e. behind a proxy server). These users must be allowed entry by adding their IP to the list of trusted_networks.
    258         if ($trusted_net = ipInRange(getRemoteAddr(), $this->_params['trusted_networks'])) {
     242        if ($trusted_net = ipInRange(getRemoteAddr(), $this -> _params['trusted_networks'])) {
    259243            $user_in_trusted_network = true;
    260             $app->logMsg(sprintf('User %s accessing from trusted network %s', $_SESSION['_auth_file'][$this->_ns]['username'], $trusted_net), LOG_DEBUG, __FILE__, __LINE__);
     244            $app -> logMsg(sprintf('User %s accessing from trusted network %s', $_SESSION['_auth_file'][$this -> _ns]['username'], $trusted_net), LOG_DEBUG, __FILE__, __LINE__);
    261245        } else if (preg_match('/proxy.aol.com$/i', getRemoteAddr(true))) {
    262246            $user_in_trusted_network = true;
    263             $app->logMsg(sprintf('User %s accessing from trusted network proxy.aol.com', $_SESSION['_auth_file'][$this->_ns]['username']), LOG_DEBUG, __FILE__, __LINE__);
     247            $app -> logMsg(sprintf('User %s accessing from trusted network proxy.aol.com', $_SESSION['_auth_file'][$this -> _ns]['username']), LOG_DEBUG, __FILE__, __LINE__);
    264248        } else {
    265249            $user_in_trusted_network = false;
     
    267251
    268252        // Test login with information stored in session. Skip IP matching for users from trusted networks.
    269         if (isset($_SESSION['_auth_file'][$this->_ns])
    270             && true === $_SESSION['_auth_file'][$this->_ns]['authenticated']
    271             && !empty($_SESSION['_auth_file'][$this->_ns]['username'])
    272             && strtotime($_SESSION['_auth_file'][$this->_ns]['login_datetime']) > time() - $this->_params['login_timeout']
    273             && strtotime($_SESSION['_auth_file'][$this->_ns]['last_access_datetime']) > time() - $this->_params['idle_timeout']
    274             && ($_SESSION['_auth_file'][$this->_ns]['remote_ip'] == getRemoteAddr() || $user_in_trusted_network)
    275         ) {
     253        if (isset($_SESSION['_auth_file'][$this -> _ns]) && true === $_SESSION['_auth_file'][$this -> _ns]['authenticated'] && !empty($_SESSION['_auth_file'][$this -> _ns]['username']) && strtotime($_SESSION['_auth_file'][$this -> _ns]['login_datetime']) > time() - $this -> _params['login_timeout'] && strtotime($_SESSION['_auth_file'][$this -> _ns]['last_access_datetime']) > time() - $this -> _params['idle_timeout'] && ($_SESSION['_auth_file'][$this -> _ns]['remote_ip'] == getRemoteAddr() || $user_in_trusted_network)) {
    276254            // User is authenticated!
    277             $_SESSION['_auth_file'][$this->_ns]['last_access_datetime'] = date('Y-m-d H:i:s');
     255            $_SESSION['_auth_file'][$this -> _ns]['last_access_datetime'] = date('Y-m-d H:i:s');
    278256            return true;
    279         } else if (isset($_SESSION['_auth_file'][$this->_ns]) && true === $_SESSION['_auth_file'][$this->_ns]['authenticated']) {
    280             if (strtotime($_SESSION['_auth_file'][$this->_ns]['last_access_datetime']) > time() - 43200) {
     257        } else if (isset($_SESSION['_auth_file'][$this -> _ns]) && true === $_SESSION['_auth_file'][$this -> _ns]['authenticated']) {
     258            if (strtotime($_SESSION['_auth_file'][$this -> _ns]['last_access_datetime']) > time() - 43200) {
    281259                // Only raise message if last session is less than 12 hours old.
    282                 $app->raiseMsg(_("Your session has closed. You need to log-in again."), MSG_NOTICE, __FILE__, __LINE__);
     260                $app -> raiseMsg(_("Your session has closed. You need to log-in again."), MSG_NOTICE, __FILE__, __LINE__);
    283261            }
    284262
    285263            // Log the reason for login expiration.
    286264            $expire_reasons = array();
    287             if (empty($_SESSION['_auth_file'][$this->_ns]['username'])) {
     265            if (empty($_SESSION['_auth_file'][$this -> _ns]['username'])) {
    288266                $expire_reasons[] = 'username not found';
    289267            }
    290             if (strtotime($_SESSION['_auth_file'][$this->_ns]['login_datetime']) <= time() - $this->_params['login_timeout']) {
     268            if (strtotime($_SESSION['_auth_file'][$this -> _ns]['login_datetime']) <= time() - $this -> _params['login_timeout']) {
    291269                $expire_reasons[] = 'login_timeout expired';
    292270            }
    293             if (strtotime($_SESSION['_auth_file'][$this->_ns]['last_access_datetime']) <= time() - $this->_params['idle_timeout']) {
     271            if (strtotime($_SESSION['_auth_file'][$this -> _ns]['last_access_datetime']) <= time() - $this -> _params['idle_timeout']) {
    294272                $expire_reasons[] = 'idle_timeout expired';
    295273            }
    296             if ($_SESSION['_auth_file'][$this->_ns]['remote_ip'] != getRemoteAddr() && !$user_in_trusted_network) {
    297                 $expire_reasons[] = sprintf('remote_ip not matched (%s != %s)', $_SESSION['_auth_file'][$this->_ns]['remote_ip'], getRemoteAddr());
    298             }
    299             $app->logMsg(sprintf('User %s session expired: %s', $_SESSION['_auth_file'][$this->_ns]['username'], join(', ', $expire_reasons)), LOG_INFO, __FILE__, __LINE__);
     274            if ($_SESSION['_auth_file'][$this -> _ns]['remote_ip'] != getRemoteAddr() && !$user_in_trusted_network) {
     275                $expire_reasons[] = sprintf('remote_ip not matched (%s != %s)', $_SESSION['_auth_file'][$this -> _ns]['remote_ip'], getRemoteAddr());
     276            }
     277            $app -> logMsg(sprintf('User %s session expired: %s', $_SESSION['_auth_file'][$this -> _ns]['username'], join(', ', $expire_reasons)), LOG_INFO, __FILE__, __LINE__);
    300278        }
    301279
     
    313291     * @access public
    314292     */
    315     function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null)
    316     {
    317         $app =& App::getInstance();
    318    
    319         if (!$this->isLoggedIn()) {
     293    public function requireLogin($message = '', $type = MSG_NOTICE, $file = null, $line = null) {
     294        $app = &App::getInstance();
     295
     296        if (!$this -> isLoggedIn()) {
    320297            // Display message for requiring login. (RaiseMsg will ignore empty strings.)
    321             $app->raiseMsg($message, $type, $file, $line);
     298            $app -> raiseMsg($message, $type, $file, $line);
    322299
    323300            // Login scripts must have the same 'login' tag for boomerangURL verification/manipulation.
    324             $app->setBoomerangURL(absoluteMe(), 'login');
    325             $app->dieURL($this->_params['login_url']);
    326         }
    327     }
    328    
     301            $app -> setBoomerangURL(absoluteMe(), 'login');
     302            $app -> dieURL($this -> _params['login_url']);
     303        }
     304    }
     305
    329306    /**
    330307     * Wrapper function for compatibility with lib/Lock.inc.php.
     
    333310     * @return string               Username, or false if none found.
    334311     */
    335     function getUsername($username)
    336     {
     312    public function getUsername($username) {
    337313        if ('' != $username) {
    338314            return $username;
     
    343319
    344320    /*
    345     * Reads the configured htpasswd file into the _users array.
    346     *
    347     * @access   public
    348     * @return   false on error, true on success.
    349     * @author   Quinn Comendant <quinn@strangecode.com>
    350     * @version  1.0
    351     * @since    18 Apr 2006 18:17:48
    352     */
    353     function _loadHTPasswdFile()
    354     {
    355         $app =& App::getInstance();
    356    
     321     * Reads the configured htpasswd file into the _users array.
     322     *
     323     * @access   public
     324     * @return   false on error, true on success.
     325     * @author   Quinn Comendant <quinn@strangecode.com>
     326     * @version  1.0
     327     * @since    18 Apr 2006 18:17:48
     328     */
     329    private function _loadHTPasswdFile() {
     330        $app = &App::getInstance();
     331
    357332        static $users = null;
    358        
    359         if (!file_exists($this->_params['htpasswd_file'])) {
    360             $app->logMsg(sprintf('htpasswd file missing or not specified: %s', $this->_params['htpasswd_file']), LOG_ERR, __FILE__, __LINE__);
    361             return false;
    362         }
    363        
     333
     334        if (!file_exists($this -> _params['htpasswd_file'])) {
     335            $app -> logMsg(sprintf('htpasswd file missing or not specified: %s', $this -> _params['htpasswd_file']), LOG_ERR, __FILE__, __LINE__);
     336            return false;
     337        }
     338
    364339        if (!isset($users)) {
    365             if (false === ($users = file($this->_params['htpasswd_file']))) {
    366                 $app->logMsg(sprintf('Could not read htpasswd file: %s', $this->_params['htpasswd_file']), LOG_ERR, __FILE__, __LINE__);
     340            if (false === ($users = file($this -> _params['htpasswd_file']))) {
     341                $app -> logMsg(sprintf('Could not read htpasswd file: %s', $this -> _params['htpasswd_file']), LOG_ERR, __FILE__, __LINE__);
    367342                return false;
    368343            }
     
    372347            foreach ($users as $u) {
    373348                list($user, $pass) = explode(':', $u, 2);
    374                 $this->_users[trim($user)] = trim($pass);
     349                $this -> _users[trim($user)] = trim($pass);
    375350            }
    376351            return true;
     
    388363     * @return string  The hashed password.
    389364     */
    390     function _encrypt($password, $encrypted_password=null)
    391     {
     365    private function _encrypt($password, $encrypted_password = null) {
    392366        switch ($this->_params['encryption_type']) {
    393         case AUTH_ENCRYPT_PLAINTEXT :
    394             return $password;
    395             break;
    396 
    397         case AUTH_ENCRYPT_SHA1 :
    398             return sha1($password);
    399             break;
    400 
    401         case AUTH_ENCRYPT_MD5 :
    402             return md5($password);
    403             break;
    404 
    405         case AUTH_ENCRYPT_CRYPT :
    406         default :
    407             return crypt($password, $encrypted_password);
    408             break;
     367            case AUTH_ENCRYPT_PLAINTEXT :
     368                return $password;
     369                break;
     370
     371            case AUTH_ENCRYPT_SHA1 :
     372                return sha1($password);
     373                break;
     374
     375            case AUTH_ENCRYPT_MD5 :
     376                return md5($password);
     377                break;
     378
     379            case AUTH_ENCRYPT_CRYPT :
     380            default :
     381                return crypt($password, $encrypted_password);
     382                break;
    409383        }
    410384    }
    411385
    412386} // end class
    413 ?>
  • branches/eli_branch/lib/Auth_SQL.inc.php

    r432 r439  
    4141       
    4242    // Namespace of this auth object.
    43     var $_ns;
     43    private $_ns;
    4444   
    4545    // Static var for test.
    46     var $_authentication_tested;
     46    private $_authentication_tested;
    4747
    4848    // Parameters to be configured by setParam.
    49     var $_params = array();
    50     var $_default_params = array(
     49    private $_params = array();
     50    private $_default_params = array(
    5151
    5252        // Automatically create table and verify columns. Better set to false after site launch.
     
    127127     * @param optional array $params  A hash containing parameters.
    128128     */
    129     function Auth_SQL($namespace='')
     129    public function __construct($namespace='')
    130130    {
    131131        $app =& App::getInstance();
     
    153153     * @since   26 Aug 2005 17:09:36
    154154     */
    155     function initDB($recreate_db=false)
     155    public function initDB($recreate_db=false)
    156156    {
    157157        $app =& App::getInstance();
     
    253253     * @return bool true on success, false on failure
    254254     */
    255     function setParam($params)
     255    public function setParam($params)
    256256    {
    257257        if (isset($params['match_remote_ip_exempt_usernames'])) {
     
    274274     * @return mixed               Configured parameter value.
    275275     */
    276     function getParam($param)
     276    public function getParam($param)
    277277    {
    278278        $app =& App::getInstance();
     
    291291     * @access public
    292292     */
    293     function clear()
     293    public function clear()
    294294    {
    295295        $db =& DB::getInstance();
     
    326326     * @param mixed $val      Value to set variable to.
    327327     */
    328     function set($key, $val)
     328    public function set($key, $val)
    329329    {
    330330        if (!isset($_SESSION['_auth_sql'][$this->_ns]['user_data'])) {
     
    342342     * @return mixed          Value stored in session.
    343343     */
    344     function get($key, $default='')
     344    public function get($key, $default='')
    345345    {
    346346        if (isset($_SESSION['_auth_sql'][$this->_ns][$key])) {
     
    361361     * @return mixed  False if credentials not found in DB, or returns DB row matching credentials.
    362362     */
    363     function authenticate($username, $password)
     363    public function authenticate($username, $password)
    364364    {
    365365        $app =& App::getInstance();
     
    412412     * @return boolean  Whether or not the credentials are valid.
    413413     */
    414     function login($username, $password)
     414    public function login($username, $password)
    415415    {
    416416        $app =& App::getInstance();
     
    534534     * @access public
    535535     */
    536     function isLoggedIn($user_id=null)
     536    public function isLoggedIn($user_id=null)
    537537    {
    538538        $app =& App::getInstance();
     
    668668     * @access public
    669669     */
    670     function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null)
     670    public function requireLogin($message='', $type=MSG_NOTICE, $file=null, $line=null)
    671671    {
    672672        $app =& App::getInstance();
     
    690690     * @param  string   $reason      The reason for blocking the account.
    691691     */
    692     function blockAccount($user_id=null, $reason='')
     692    public function blockAccount($user_id=null, $reason='')
    693693    {
    694694        $app =& App::getInstance();
     
    720720     * @return boolean              True if the user is blocked, false otherwise.
    721721     */
    722     function isBlocked($user_id=null)
     722    public function isBlocked($user_id=null)
    723723    {
    724724        $db =& DB::getInstance();
     
    742742     * Unblocks a user in the db_table, and clears any blocked_reason.
    743743     */
    744     function unblockAccount($user_id=null)
     744    public function unblockAccount($user_id=null)
    745745    {
    746746        $db =& DB::getInstance();
     
    766766     * @return bool                 True if username exists.
    767767     */
    768     function usernameExists($username)
     768    public function usernameExists($username)
    769769    {
    770770        $db =& DB::getInstance();
     
    786786     * @return string               Username, or false if none found.
    787787     */
    788     function getUsername($user_id)
     788    public function getUsername($user_id)
    789789    {
    790790        $db =& DB::getInstance();
     
    820820     * @return string           a password
    821821     */
    822     function generatePassword($pattern='CvcdCvc')
     822    public function generatePassword($pattern='CvcdCvc')
    823823    {
    824824        $app =& App::getInstance();
     
    843843     *
    844844     */
    845     function encryptPassword($password, $salt=null)
     845    public function encryptPassword($password, $salt=null)
    846846    {
    847847        $app =& App::getInstance();
     
    898898     *
    899899     */
    900     function setPassword($user_id=null, $password)
     900    public function setPassword($user_id=null, $password)
    901901    {
    902902        $app =& App::getInstance();
     
    948948     * @return string            The user's new password.
    949949     */
    950     function resetPassword($user_id=null, $reason='')
     950    public function resetPassword($user_id=null, $reason='')
    951951    {
    952952        $app =& App::getInstance();
     
    10131013     * @return bool     true if user is a member of security zone, false otherwise
    10141014     */
    1015     function inClearanceZone($security_zone, $user_type='')
     1015    public function inClearanceZone($security_zone, $user_type='')
    10161016    {
    10171017        // return true; /// WTF?
     
    10361036     * @param  constant $security_zone   string of comma delimited privileges for the zone
    10371037     */
    1038     function requireAccessClearance($security_zone, $message='')
     1038    public function requireAccessClearance($security_zone, $message='')
    10391039    {
    10401040        $app =& App::getInstance();
     
    10941094// 128.0.0.0        10000000.00000000.00000000.00000000  /1
    10951095// 0.0.0.0          00000000.00000000.00000000.00000000  /0   IP space
    1096 ?>
  • branches/eli_branch/lib/AuthorizeNet.inc.php

    r438 r439  
    6161class AuthorizeNet {
    6262
    63     var $post_url = ''; // The URL to post data to.
    64     var $_results = array();
    65     var $_params = array();
    66     var $_default_params = array(
     63    public $post_url = ''; // The URL to post data to.
     64    private $_results = array();
     65    private $_params = array();
     66    private $_default_params = array(
    6767        'x_version'         => '3.1',
    6868        'x_relay_response'  => 'FALSE',
     
    8080
    8181    // Array of response names. Used in the results array.
    82     var $_result_fields = Array(
     82    private $_result_fields = Array(
    8383        'x_response_code',
    8484        'x_response_subcode',
     
    129129     * @param optional array $_params  A hash containing parameters.
    130130     */
    131     function AuthorizeNet($params = array())
     131    public function __construct($params = array())
    132132    {
    133133        $app =& App::getInstance();
     
    153153     * @param  array    $params     Array of parameters (key => val pairs).
    154154     */
    155     function setParam($params)
     155    public function setParam($params)
    156156    {
    157157        $app =& App::getInstance();
     
    172172     * @return mixed               Configured parameter value.
    173173     */
    174     function getParam($param)
     174    public function getParam($param)
    175175    {
    176176        $app =& App::getInstance();
     
    192192     * @return mixed      False or x_response_code: false = error, 1 = accepted, 2 = declined, 3 = error
    193193     */
    194     function process()
     194    public function process()
    195195    {
    196196        $app =& App::getInstance();
     
    245245     * @return array             Returns the results array.
    246246     */
    247     function getResult($key=null)
     247    public function getResult($key=null)
    248248    {
    249249        if (isset($key)) {
     
    265265     * @return bool             True if the hash is valid, false otherwise.
    266266     */
    267     function validMD5Hash()
     267    public function validMD5Hash()
    268268    {
    269269        return (
     
    282282     * @access public
    283283     */
    284     function reset()
     284    public function reset()
    285285    {
    286286        $this->_results = Array();
     
    297297     * @return integer      Transaction result code.
    298298     */
    299     function _processResult($result)
     299    private function _processResult($result)
    300300    {
    301301        $this->_results = Array();
  • branches/eli_branch/lib/CSS.inc.php

    r396 r439  
    3232
    3333    // Include these style sheets.
    34     var $_css_files = array('default' => array());
     34    private $_css_files = array('default' => array());
    3535
    3636    // CSS object parameters.
    37     var $_params = array(
     37    private $_params = array(
    3838        'character_set' => 'utf-8',
    3939        'cache_css' => false,
     
    4848     * @param  array    $params     Array of parameters (key => val pairs).
    4949     */
    50     function setParam($params)
     50    public function setParam($params)
    5151    {
    5252        $app =& App::getInstance();
     
    6767     * @return mixed               Configured parameter value.
    6868     */
    69     function getParam($param)
     69    public function getParam($param)
    7070    {
    7171        $app =& App::getInstance();
     
    8787     * @return  bool    True on success, false on failure.
    8888     */
    89     function setFile($file, $realms='')
     89    public function setFile($file, $realms='')
    9090    {
    9191        $app =& App::getInstance();
     
    115115     * @return  bool    False if no files have been set.
    116116     */
    117     function headers($realm='')
     117    public function headers($realm='')
    118118    {
    119119        $app =& App::getInstance();
     
    157157     * @return  bool    False if no files have been set.
    158158     */
    159     function output($realm='')
     159    public function output($realm='')
    160160    {
    161161        $realm = '' == $realm ? 'default' : $realm;
     
    181181    }
    182182}
    183 ?>
  • branches/eli_branch/lib/Cache.inc.php

    r438 r439  
    3838
    3939    // Namespace of this instance of Prefs.
    40     var $_ns;
     40    private $_ns;
    4141
    4242    // Configuration parameters for this object.
    43     var $_params = array(
     43    private $_params = array(
    4444       
    4545        // If false nothing will be cached or retrieved. Useful for testing realtime data requests.
     
    6565    * @since    05 Jun 2006 23:14:21
    6666    */
    67     function Cache($namespace='')
     67    function __construct($namespace='')
    6868    {
    6969        $app =& App::getInstance();
     
    8888     * @static
    8989     */
    90     static function &getInstance($namespace='')
     90    public static function &getInstance($namespace='')
    9191    {
    9292        static $instances = array();
     
    105105     * @param  array    $params     Array of parameters (key => val pairs).
    106106     */
    107     function setParam($params)
     107    public function setParam($params)
    108108    {
    109109        $app =& App::getInstance();
     
    124124     * @return mixed               Configured parameter value.
    125125     */
    126     function getParam($param)
     126    public function getParam($param)
    127127    {
    128128        $app =& App::getInstance();
     
    148148     * @return bool             True on success, false otherwise.
    149149     */
    150     function set($key, $var, $flags=0)
     150    public function set($key, $var, $flags=0)
    151151    {
    152152        $app =& App::getInstance();
     
    197197     * @return mixed          The requested datum, or false on failure.
    198198     */
    199     function get($key)
     199    public function get($key)
    200200    {
    201201        $app =& App::getInstance();
     
    226226     * @return bool         True if a value exists for the given key.
    227227     */
    228     function exists($key)
     228    public function exists($key)
    229229    {
    230230        $app =& App::getInstance();
     
    244244     * @return bool         True if the value existed before being unset.
    245245     */
    246     function delete($key)
     246    public function delete($key)
    247247    {
    248248        if (array_key_exists($key, $_SESSION['_cache'][$this->_ns])) {
     
    262262    * @since    05 Jun 2006 23:51:34
    263263    */
    264     function clear()
     264    public function clear()
    265265    {
    266266        $_SESSION['_cache'][$this->_ns] = array();
  • branches/eli_branch/lib/Captcha.inc.php

    r396 r439  
    5454class Captcha {
    5555
    56     var $secret_key = 'some random seed text for the md5';
    57     var $random_number;
    58     var $ascii_numbers = array(
     56    public $secret_key = 'some random seed text for the md5';
     57    public $random_number;
     58    public $ascii_numbers = array(
    5959        array(
    6060            '  #####   ',
     
    147147     * @since   20 Jan 2006 13:08:22
    148148     */
    149     function Captcha()
     149    public function __construct()
    150150    {
    151151        $app =& App::getInstance();
     
    164164     * @since   07 Dec 2005 21:59:25
    165165     */
    166     function getAsciiNumber($num=null)
     166    public function getAsciiNumber($num=null)
    167167    {
    168168        $app =& App::getInstance();
     
    200200     * @since   07 Dec 2005 22:09:04
    201201     */
    202     function printAsciiNumber()
     202    public function printAsciiNumber()
    203203    {
    204204        $ascii = $this->getAsciiNumber($this->random_number);
     
    213213     * @since   07 Dec 2005 22:09:04
    214214     */
    215     function printForm()
     215    public function printForm()
    216216    {
    217217        $hash = $this->_getMD5key($this->random_number);
     
    231231     * @since   07 Dec 2005 22:19:33
    232232     */
    233     function valid()
     233    public function valid()
    234234    {
    235235        $number = getFormData('sc-captcha-input');
     
    251251     * @since   07 Dec 2005 21:40:25
    252252     */
    253     function _getRandomNumber()
     253    public function _getRandomNumber()
    254254    {
    255255        return mb_substr(strval(rand(10000, 99999)), 0, rand(3, 5));
     
    265265     * @since   07 Dec 2005 21:53:35
    266266     */
    267     function _getMD5key($input)
     267    public function _getMD5key($input)
    268268    {
    269269        return md5($this->secret_key . $input);
     
    272272}
    273273
    274 ?>
  • branches/eli_branch/lib/Cart.inc.php

    r396 r439  
    7171
    7272    // Namespace of this instance.
    73     var $_ns;
     73    private $_ns;
    7474
    7575    // Configuration parameters for this object.
    76     var $_params = array(
     76    private $_params = array(
    7777    );
    7878
     
    8080     * Cart constructor.
    8181     */
    82     function Cart($namespace='')
     82    public function __construct($namespace='')
    8383    {
    8484        $app =& App::getInstance();
     
    9797     * @param  array $params   Array of param keys and values to set.
    9898     */
    99     function setParam($params=null)
     99    public function setParam($params=null)
    100100    {
    101101        if (isset($params) && is_array($params)) {
     
    112112     * @return mixed               Configured parameter value.
    113113     */
    114     function getParam($param)
     114    public function getParam($param)
    115115    {
    116116        $app =& App::getInstance();
     
    137137    * @since    11 Mar 2008 18:59:37
    138138    */
    139     function add($item_id, $price, $quantity=1, $specs=array())
     139    public function add($item_id, $price, $quantity=1, $specs=array())
    140140    {
    141141        $app =& App::getInstance();
     
    166166    * @since    10 May 2008 16:42:25
    167167    */
    168     function setQty($item_id, $quantity)
     168    public function setQty($item_id, $quantity)
    169169    {
    170170        if ($quantity <= 0) {
     
    195195    * @since    10 May 2008 16:42:25
    196196    */
    197     function setPrice($item_id, $price)
     197    public function setPrice($item_id, $price)
    198198    {
    199199        if (isset($_SESSION['_cart'][$this->_ns]['items'][$item_id])) {
     
    218218    * @since    11 Mar 2008 18:59:48
    219219    */
    220     function remove($item_id)
     220    public function remove($item_id)
    221221    {
    222222        $app =& App::getInstance();
     
    242242    * @since    11 Mar 2008 18:59:55
    243243    */
    244     function get($item_id, $spec_key)
     244    public function get($item_id, $spec_key)
    245245    {
    246246        if (isset($_SESSION['_cart'][$this->_ns]['items'][$item_id][$spec_key])) {
     
    259259    * @since    11 Mar 2008 18:59:55
    260260    */
    261     function getList()
     261    public function getList()
    262262    {
    263263        return $_SESSION['_cart'][$this->_ns]['items'];
     
    277277    * @since    11 Mar 2008 19:00:12
    278278    */
    279     function sum($key='extended_price')
     279    public function sum($key='extended_price')
    280280    {
    281281        $sum = 0;
     
    306306     * as $auth->clear(), such as when logging out.
    307307     */
    308     function clear()
     308    public function clear()
    309309    {
    310310        $_SESSION['_cart'][$this->_ns] = array(
     
    313313    }
    314314}
    315 
    316 
    317 ?>
  • branches/eli_branch/lib/Currency.inc.php

    r438 r439  
    4141
    4242    // Configuration parameters for this object.
    43     var $_params = array(
     43    private $_params = array(
    4444        'cache_result' => true,
    4545        'cache_dir' => '',
     
    5252     * Cart constructor.
    5353     */
    54     function Currency($params=array())
     54    public function __construct($params=array())
    5555    {
    5656        $app =& App::getInstance();
     
    7979     * @param  array $params   Array of param keys and values to set.
    8080     */
    81     function setParam($params=null)
     81    public function setParam($params=null)
    8282    {
    8383        if (isset($params) && is_array($params)) {
     
    9494     * @return mixed               Configured parameter value.
    9595     */
    96     function getParam($param)
     96    public function getParam($param)
    9797    {
    9898        $app =& App::getInstance();
     
    118118    * @since    05 May 2008 23:50:59
    119119    */
    120     function getValue($amount, $base, $target)
     120    public function getValue($amount, $base, $target)
    121121    {
    122122        if (false !== $rate = $this->getRate($base, $target)) {
     
    138138    * @since    25 May 2011 01:26:24
    139139    */
    140     function getRate($base, $target)
     140    public function getRate($base, $target)
    141141    {
    142142        $app =& App::getInstance();
     
    180180     * @access private
    181181     */
    182     function _performAPICall($parameters=null)
     182    private function _performAPICall($parameters=null)
    183183    {
    184184        $app =& App::getInstance();
  • branches/eli_branch/lib/DB.inc.php

    r438 r439  
    3333
    3434    // If $db->connect has successfully opened a db connection.
    35     var $_connected = false;
     35    private $_connected = false;
    3636
    3737    // Database handle.
    38     var $dbh;
     38    public $dbh;
    3939   
    4040    // Count how many queries run during the whole instance.
    41     var $_query_count = 0;
     41    private $_query_count = 0;
    4242
    4343    // Hash of DB parameters.
    44     var $_params = array();
     44    private $_params = array();
    4545
    4646    // Default parameters.
    47     var $_param_defaults = array(
     47    private $_param_defaults = array(
    4848
    4949        // DB passwords should be set as apache environment variables in httpd.conf, readable only by root.
     
    6464
    6565    // Translate between HTML and MySQL character set names.
    66     var $mysql_character_sets = array(
     66    public $mysql_character_sets = array(
    6767        'utf-8' => 'utf8',
    6868        'iso-8859-1' => 'latin1',
     
    7070
    7171    // Caches.
    72     var $existing_tables;
    73     var $table_columns;
     72    public $existing_tables;
     73    public $table_columns;
    7474
    7575    /**
     
    8080     * @static
    8181     */
    82     static function &getInstance()
     82    public static function &getInstance()
    8383    {
    8484        static $instance = null;
     
    9898     * @param  array    $params     Array of parameters (key => val pairs).
    9999     */
    100     function setParam($params)
     100    public function setParam($params)
    101101    {
    102102        $app =& App::getInstance();
     
    117117     * @return mixed               Configured parameter value.
    118118     */
    119     function getParam($param)
     119    public function getParam($param)
    120120    {
    121121        $app =& App::getInstance();
     
    136136     * @since   28 Aug 2005 14:02:49
    137137     */
    138     function connect()
     138    public function connect()
    139139    {
    140140        $app =& App::getInstance();
     
    185185     * @since   28 Aug 2005 14:32:01
    186186     */
    187     function close()
     187    public function close()
    188188    {
    189189        if (!$this->_connected) {
     
    204204    * @since    03 Jul 2013 14:50:23
    205205    */
    206     function reconnect()
     206    public function reconnect()
    207207    {
    208208        $this->close();
     
    221221    * @since    15 Jan 2007 15:59:00
    222222    */
    223     function _fail()
     223    private function _fail()
    224224    {
    225225        if ($this->getParam('db_die_on_failure')) {
     
    240240     * @since   20 Aug 2005 13:50:36
    241241     */
    242     function getDBH()
     242    public function getDBH()
    243243    {
    244244        if (!$this->_connected) {
     
    256256     * @since   28 Aug 2005 14:58:09
    257257     */
    258     function isConnected()
     258    public function isConnected()
    259259    {
    260260        return (true === $this->_connected);
     
    270270     * @since   06 Mar 2006 16:41:32
    271271     */
    272     function escapeString($string)
     272    public function escapeString($string)
    273273    {
    274274        if (!$this->_connected) {
     
    287287     * @return resource         Query identifier
    288288     */
    289     function query($query, $debug=false)
     289    public function query($query, $debug=false)
    290290    {   
    291291        $app =& App::getInstance();
     
    336336     * @return bool                         true if given $table exists.
    337337     */
    338     function tableExists($table, $use_cached_results=true)
     338    public function tableExists($table, $use_cached_results=true)
    339339    {
    340340        $app =& App::getInstance();
     
    368368     * @return bool                         true if column(s) exist.
    369369     */
    370     function columnExists($table, $columns, $strict=true, $use_cached_results=true)
     370    public function columnExists($table, $columns, $strict=true, $use_cached_results=true)
    371371    {
    372372        if (!$this->_connected) {
     
    416416    * @since    15 Jun 2006 11:46:05
    417417    */
    418     function numQueries()
     418    public function numQueries()
    419419    {
    420420        return $this->_query_count;
     
    428428     * @since   28 Aug 2005 22:10:50
    429429     */
    430     function resetCache()
     430    public function resetCache()
    431431    {
    432432        $this->existing_tables = null;
  • branches/eli_branch/lib/DBSessionHandler.inc.php

    r438 r439  
    3232class DBSessionHandler {
    3333
    34     var $db; // DB object.
     34    public $db; // DB object.
    3535
    36     var $_params = array(
     36    private $_params = array(
    3737        'db_table' => 'session_tbl',
    3838
     
    5151     * @since   18 Jul 2005 11:02:50
    5252     */
    53     function DBSessionHandler($db, $params=array())
     53    public function __construct($db, $params=array())
    5454    {
    5555        $app =& App::getInstance();
     
    9494     * @since   26 Aug 2005 17:09:36
    9595     */
    96     function initDB($recreate_db=false)
     96    public function initDB($recreate_db=false)
    9797    {
    9898        $app =& App::getInstance();
     
    121121    }
    122122
    123     function dbSessionOpen($save_path, $sess_name)
     123    public function dbSessionOpen($save_path, $sess_name)
    124124    {
    125125        return true;
    126126    }
    127127
    128     function dbSessionClose()
     128    public function dbSessionClose()
    129129    {       
    130130        return true;
    131131    }
    132132
    133     function dbSessionRead($session_id)
     133    public function dbSessionRead($session_id)
    134134    {
    135135        // Select the data belonging to session $session_id from the session table
     
    146146    }
    147147
    148     function dbSessionWrite($session_id, $session_data)
     148    public function dbSessionWrite($session_id, $session_data)
    149149    {
    150150        // Write the serialized session data ($session_data) to the session table
     
    154154    }
    155155
    156     function dbSessionDestroy($session_id)
     156    public function dbSessionDestroy($session_id)
    157157    {
    158158        // Delete from the table all data for the session $session_id
     
    162162    }
    163163
    164     function dbSessionGarbage($max_lifetime=72000)
     164    public function dbSessionGarbage($max_lifetime=72000)
    165165    {
    166166        // Delete old values from the session table.
  • branches/eli_branch/lib/Email.inc.php

    r438 r439  
    5555
    5656    // Default parameters, to be overwritten by setParam() and read with getParam()
    57     var $_params = array(
     57    private $_params = array(
    5858        'to' => null,
    5959        'from' => null,
     
    7373
    7474    // String that contains the email body.
    75     var $_template;
     75    private $_template;
    7676
    7777    // String that contains the email body after replacements.
    78     var $_template_replaced;
     78    private $_template_replaced;
    7979
    8080    /**
     
    8686     * @since   28 Nov 2005 12:59:41
    8787     */
    88     function Email($params=null)
     88    public function __construct($params=null)
    8989    {
    9090        // The regex used in validEmail(). Set here instead of in the default _params above so we can use the concatenation . dot.
     
    117117     * @param  array    $params     Array of parameters (key => val pairs).
    118118     */
    119     function setParam($params)
     119    public function setParam($params)
    120120    {
    121121        $app =& App::getInstance();
     
    144144     * @return mixed               Configured parameter value.
    145145     */
    146     function getParam($param)
     146    public function getParam($param)
    147147    {
    148148        $app =& App::getInstance();
     
    164164     * @since   28 Nov 2005 12:56:23
    165165     */
    166     function setTemplate($template)
     166    public function setTemplate($template)
    167167    {
    168168        $app =& App::getInstance();
     
    188188     * @since   28 Nov 2005 12:56:23
    189189     */
    190     function setString($string)
     190    public function setString($string)
    191191    {
    192192        $app =& App::getInstance();
     
    212212     * @since   28 Nov 2005 13:08:51
    213213     */
    214     function replace($replacements)
     214    public function replace($replacements)
    215215    {
    216216        $app =& App::getInstance();
     
    249249     * @since   28 Nov 2005 12:56:09
    250250     */
    251     function send($to=null, $from=null, $subject=null, $headers=null)
     251    public function send($to=null, $from=null, $subject=null, $headers=null)
    252252    {
    253253        $app =& App::getInstance();
     
    363363     * @since   30 Nov 2005 22:00:50
    364364     */
    365     function validEmail($email)
     365    public function validEmail($email)
    366366    {
    367367        $app =& App::getInstance();
  • branches/eli_branch/lib/FormValidator.inc.php

    r438 r439  
    6161
    6262    // Class parameters.
    63     var $_params = array(
     63    private $_params = array(
    6464        'error' => ' sc-msg-error ',
    6565        'warning' => ' sc-msg-warning ',
     
    6969
    7070    // Array filling with error messages.
    71     var $errors = array();
     71    public $errors = array();
    7272   
    7373    /**
     
    7777     * @param  array    $params     Array of parameters (key => val pairs).
    7878     */
    79     function setParam($params)
     79    public function setParam($params)
    8080    {
    8181        $app =& App::getInstance();
     
    9696     * @return mixed               Configured parameter value.
    9797     */
    98     function getParam($param)
     98    public function getParam($param)
    9999    {
    100100        $app =& App::getInstance();
     
    115115     *                  vals: the message to display for that error
    116116     */
    117     function getErrorList()
     117    public function getErrorList()
    118118    {
    119119        return $this->errors;
     
    130130     * @param   string $line        __LINE__.
    131131     */
    132     function addError($form_name, $msg='', $type=MSG_ERR, $file=null, $line=null)
     132    public function addError($form_name, $msg='', $type=MSG_ERR, $file=null, $line=null)
    133133    {
    134134        $this->errors[] = array(
     
    149149     *                a variable of $form_name, false otherwise
    150150     */
    151     function anyErrors($form_name=null)
     151    public function anyErrors($form_name=null)
    152152    {
    153153        if (isset($form_name)) {
     
    166166     * Reset the error list.
    167167     */
    168     function resetErrorList()
     168    public function resetErrorList()
    169169    {
    170170        $this->errors = array();
     
    182182     * @since   15 Jul 2005 01:39:14
    183183     */
    184     function printErrorMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg-formvalidator')
     184    public function printErrorMessages($above='', $below='', $print_gotohash_js=false, $hash='sc-msg-formvalidator')
    185185    {
    186186        $app =& App::getInstance();
     
    238238     *                           not provided, use default.
    239239     */
    240     function err($form_name, $marker=null)
     240    public function err($form_name, $marker=null)
    241241    {
    242242        if (false !== ($type = $this->anyErrors($form_name))) {
     
    274274     * @return bool   true if form is not empty, false otherwise.
    275275     */
    276     function notEmpty($form_name, $msg='')
     276    public function notEmpty($form_name, $msg='')
    277277    {
    278278        if (parent::notEmpty(getFormData($form_name))) {
     
    290290    * @since    03 Jun 2006 22:56:46
    291291    */
    292     function isEmpty($form_name, $msg='')
     292    public function isEmpty($form_name, $msg='')
    293293    {
    294294        $this->notEmpty($form_name, $msg);
     
    303303     * @return bool   true if form is a string, false otherwise.
    304304     */
    305     function isString($form_name, $msg='')
     305    public function isString($form_name, $msg='')
    306306    {
    307307        if (parent::isString(getFormData($form_name))) {
     
    321321     * @return bool   true if no errors found, false otherwise
    322322     */
    323     function isNumber($form_name, $msg='')
     323    public function isNumber($form_name, $msg='')
    324324    {
    325325        if (parent::isNumber(getFormData($form_name))) {
     
    340340     * @return bool   true if value is an integer
    341341     */
    342     function isInteger($form_name, $msg='', $negative_ok=false)
     342    public function isInteger($form_name, $msg='', $negative_ok=false)
    343343    {
    344344        if (parent::isInteger(getFormData($form_name), $negative_ok)) {
     
    360360     * @return bool   true if value is a float
    361361     */
    362     function isFloat($form_name, $msg='', $negative_ok=false)
     362    public function isFloat($form_name, $msg='', $negative_ok=false)
    363363    {
    364364        if (parent::isFloat(getFormData($form_name), $negative_ok)) {
     
    378378     * @return bool   true if value is a float
    379379     */
    380     function isArray($form_name, $msg='')
     380    public function isArray($form_name, $msg='')
    381381    {
    382382        if (parent::isArray(getFormData($form_name))) {
     
    399399     * @return bool   true if value passes regex test
    400400     */
    401     function checkRegex($form_name, $regex, $valid_on_match, $msg='')
     401    public function checkRegex($form_name, $regex, $valid_on_match, $msg='')
    402402    {
    403403        if (parent::checkRegex(getFormData($form_name), $regex, $valid_on_match)) {
     
    419419     * @return bool   true if string length is within given boundaries
    420420     */
    421     function stringLength($form_name, $min, $max, $msg='')
     421    public function stringLength($form_name, $min, $max, $msg='')
    422422    {
    423423        if (parent::stringLength(getFormData($form_name), $min, $max)) {
     
    439439     * @return bool   true if no errors found, false otherwise
    440440     */
    441     function numericRange($form_name, $min, $max, $msg='')
     441    public function numericRange($form_name, $min, $max, $msg='')
    442442    {
    443443        if (parent::numericRange(getFormData($form_name), $min, $max)) {
     
    463463     * @author  Quinn Comendant <quinn@strangecode.com>
    464464     */
    465     function validateEmail($form_name)
     465    public function validateEmail($form_name)
    466466    {
    467467        $app =& App::getInstance();
     
    513513     * @return bool    true if no errors found, false otherwise
    514514     */
    515     function validatePhone($form_name)
     515    public function validatePhone($form_name)
    516516    {
    517517        $phone = getFormData($form_name);
     
    531531     * @return bool    true if no errors found, false otherwise
    532532     */
    533     function validateStrDate($form_name, $msg='')
     533    public function validateStrDate($form_name, $msg='')
    534534    {
    535535        $app =& App::getInstance();
     
    554554     * @return bool    true if no errors found, false otherwise
    555555     */
    556     function validateCCNumber($form_name, $cc_type=null)
     556    public function validateCCNumber($form_name, $cc_type=null)
    557557    {
    558558        $cc_num = getFormData($form_name);
     
    574574     * @return bool   true if no errors found, false otherwise
    575575     */
    576     function fileUploaded($form_name, $msg='')
     576    public function fileUploaded($form_name, $msg='')
    577577    {
    578578        if (parent::fileUploaded($form_name)) {
  • branches/eli_branch/lib/Google_API.inc.php

    r396 r439  
    5353     * @access private
    5454     */
    55     var $_licenseKey = '';
     55    private $_licenseKey = '';
    5656
    5757    /**
     
    5959     * @access private
    6060     */
    61     var $_soapClient = NULL;
     61    private $_soapClient = NULL;
    6262
    6363    /**
     
    6767     * @access public
    6868     */
    69     function Google_API($licenseKey)
     69    public function __construct($licenseKey)
    7070    {
    7171        $this->_licenseKey = $licenseKey;
     
    8282     * @access public
    8383     */
    84     function getCachedPage($url)
     84    public function getCachedPage($url)
    8585    {
    8686        $result = $this->_performAPICall(
     
    104104     * @access public
    105105     */
    106     function getSpellingSuggestion($phrase)
     106    public function getSpellingSuggestion($phrase)
    107107    {
    108108        return $this->_performAPICall(
     
    122122     * @access public
    123123     */
    124     function search($parameters = array())
     124    public function search($parameters = array())
    125125    {
    126126        if (!isset($parameters['query'])) {
     
    150150     * @access private
    151151     */
    152     function _performAPICall($apiCall, $parameters)
     152    private function _performAPICall($apiCall, $parameters)
    153153    {
    154154        $app =& App::getInstance();
     
    167167    }
    168168}
    169 ?>
    170 
    171 
  • branches/eli_branch/lib/Hierarchy.inc.php

    r438 r439  
    5252     *
    5353     */
    54     var $params = array();
     54    public $params = array();
    5555
    5656
     
    5959     * @var string $child_type
    6060     */
    61     var $child_type;
     61    public $child_type;
    6262
    6363    /**
     
    6565     * @var string $child_id
    6666     */
    67     var $child_id;
     67    public $child_id;
    6868
    6969    /**
     
    7272     * @var bool $node_init
    7373     */
    74     var $node_init = false;
     74    public $node_init = false;
    7575
    7676    /**
     
    8080     *                          configuration or connection parameters.
    8181     */
    82     function Hierarchy($params=array())
     82    function __construct($params=array())
    8383    {
    8484        $this->params = $params;
     
    9292     *                      if no new ones are specified.
    9393     */
    94     function currentNode($child_type=null, $child_id=null)
     94    public function currentNode($child_type=null, $child_id=null)
    9595    {
    9696        $old_type = isset($this->child_type) ? $this->child_type : $child_type;
     
    113113     *                  otherwise if an array is provided, an array of identifiers is returned.
    114114     */
    115     function toStringID($child_type=null, $child_id=null)
     115    public function toStringID($child_type=null, $child_id=null)
    116116    {
    117117            $app =& App::getInstance();
     
    122122                $child_id =& $this->child_id;
    123123            } else {
    124                 $app->logMsg('toStringID failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     124                $app->logMsg('toStringID failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    125125                return false;
    126126            }
     
    147147     * @return mixed    Array of node type and id on success, false on failure.
    148148     */
    149     function toArrayID(&$node)
     149    public function toArrayID(&$node)
    150150    {
    151151            $app =& App::getInstance();
     
    154154            return array('node_type' => $node_parts[1], 'node_id' => $node_parts[2]);
    155155        } else {
    156             $app->logMsg('Cannot parse node identifier, not formated correctly.'), LOG_ERR, __FILE__, __LINE__);
     156            $app->logMsg('Cannot parse node identifier, not formated correctly.', LOG_ERR, __FILE__, __LINE__);
    157157            return false;
    158158        }
     
    167167     * @return bool     true on success, false on error.
    168168     */
    169     function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='')
     169    public function insertNode($parents, $child_type=null, $child_id=null, $relationship_type=null, $title='')
    170170    {
    171171        $app =& App::getInstance();
     
    177177                $child_id =& $this->child_id;
    178178            } else {
    179                 $app->logMsg('insertNode failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     179                $app->logMsg('insertNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    180180                return false;
    181181            }
     
    246246     * @return bool      false on error, true otherwise.
    247247     */
    248     function deleteNode($child_type=null, $child_id=null)
     248    public function deleteNode($child_type=null, $child_id=null)
    249249    {
    250250        $app =& App::getInstance();
     
    256256                $child_id =& $this->child_id;
    257257            } else {
    258                 $app->logMsg('deleteNode failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     258                $app->logMsg('deleteNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    259259                return false;
    260260            }
     
    296296     * @return bool      false on error, true otherwise.
    297297     */
    298     function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='')
     298    public function moveNode($new_parents=null, $child_type=null, $child_id=null, $relationship_type=null, $title='')
    299299    {
    300300            $app =& App::getInstance();
     
    306306                $child_id =& $this->child_id;
    307307            } else {
    308                 $app->logMsg('moveNode failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     308                $app->logMsg('moveNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    309309                return false;
    310310            }
     
    373373     * @return string   The parents as an array of serialized node identifiers.
    374374     */
    375     function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='')
     375    public function getParents($child_type=null, $child_id=null, $type_constraint=null, $order='')
    376376    {
    377377        $app =& App::getInstance();
     
    383383                $child_id =& $this->child_id;
    384384            } else {
    385                 $app->logMsg('getParents failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     385                $app->logMsg('getParents failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    386386                return false;
    387387            }
     
    424424     * @return array   type, id, title, subnode_quantity.
    425425     */
    426     function getNode($child_type=null, $child_id=null)
     426    public function getNode($child_type=null, $child_id=null)
    427427    {
    428428        $app =& App::getInstance();
     
    434434                $child_id =& $this->child_id;
    435435            } else {
    436                 $app->logMsg('getNode failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     436                $app->logMsg('getNode failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    437437                return false;
    438438            }
     
    468468     * @return string  The children as an array of serialized node identifiers.
    469469     */
    470     function getChildren($child_type=null, $child_id=null, $type_constraint=null, $order='')
     470    public function getChildren($child_type=null, $child_id=null, $type_constraint=null, $order='')
    471471    {
    472472        $app =& App::getInstance();
     
    478478                $child_id =& $this->child_id;
    479479            } else {
    480                 $app->logMsg('getChildren failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     480                $app->logMsg('getChildren failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    481481                return false;
    482482            }
     
    520520     * @return integer
    521521     */
    522     function getNumberChildren($child_type=null, $child_id=null, $type_constraint=null)
     522    public function getNumberChildren($child_type=null, $child_id=null, $type_constraint=null)
    523523    {
    524524        $app =& App::getInstance();
     
    530530                $child_id =& $this->child_id;
    531531            } else {
    532                 $app->logMsg('getNumberChildren failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     532                $app->logMsg('getNumberChildren failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    533533                return false;
    534534            }
     
    561561     * @return bool      true if a leaf, or false if not or an error
    562562     */
    563     function isLeaf($child_type=null, $child_id=null)
     563    public function isLeaf($child_type=null, $child_id=null)
    564564    {
    565565        $app =& App::getInstance();
     
    570570                $child_id =& $this->child_id;
    571571            } else {
    572                 $app->logMsg('isLeaf failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     572                $app->logMsg('isLeaf failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    573573                return false;
    574574            }
     
    595595     *                   parent, or false otherwise, or in case of failure.
    596596     */
    597     function isAncestor($child_type, $child_id, $considered_parent_type, $considered_parent_id)
     597    public function isAncestor($child_type, $child_id, $considered_parent_type, $considered_parent_id)
    598598    {
    599599        $family_tree = $this->getAllAncestors($considered_parent_type, $considered_parent_id);
     
    622622     * @return array     Array of serialized node identifiers.
    623623     */
    624     function getAllAncestors($child_type, $child_id, $go_linear=false, $_return_flag=true)
     624    public function getAllAncestors($child_type, $child_id, $go_linear=false, $_return_flag=true)
    625625    {
    626626        $db =& DB::getInstance();
     
    676676     * @return bool      true if a leaf, or false if not or an error
    677677     */
    678     function nodeExists($child_type=null, $child_id=null, $parent_type=null, $parent_id=null, $relationship_type=null)
     678    public function nodeExists($child_type=null, $child_id=null, $parent_type=null, $parent_id=null, $relationship_type=null)
    679679    {
    680680        $app =& App::getInstance();
     
    686686                $child_id =& $this->child_id;
    687687            } else {
    688                 $app->logMsg('nodeExists failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     688                $app->logMsg('nodeExists failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    689689                return false;
    690690            }
     
    728728     *                specified node: (type, id, title, indent level, selected status)
    729729     */
    730     function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true)
     730    public function &getNodeList($preselected=null, $child_type=null, $child_id=null, $type_constraint=null, $include_curr=false, $order='', $_indent=0, $_return_flag=true)
    731731    {
    732732        $app =& App::getInstance();
     
    740740                $child_id =& $this->child_id;
    741741            } else {
    742                 $app->logMsg('getNodeList failed. Arguments not specified properly.'), LOG_ERR, __FILE__, __LINE__);
     742                $app->logMsg('getNodeList failed. Arguments not specified properly.', LOG_ERR, __FILE__, __LINE__);
    743743                return false;
    744744            }
     
    801801     * @param  string  $type_constraint  An array of node types to restrict the search to.
    802802     */
    803     function rebuildSubnodeQty($type_constraint=null)
     803    public function rebuildSubnodeQty($type_constraint=null)
    804804    {
    805805        $db =& DB::getInstance();
     
    825825     * all parents recursively.
    826826     */
    827     function setSubnodeQtyToParents($child_type, $child_id, $num_children)
     827    public function setSubnodeQtyToParents($child_type, $child_id, $num_children)
    828828    {
    829829        $db =& DB::getInstance();
     
    848848// THE END
    849849}
    850 
    851 
    852 
    853 
  • branches/eli_branch/lib/Image.inc.php

    r396 r439  
    3131
    3232    // Object parameters.
    33     var $_params = array();
     33    private $_params = array();
    3434
    3535    /**
     
    4141     * @since   26 Jan 2005 01:54:50
    4242     */
    43     function Image($params=array())
     43    public function __construct($params=array())
    4444    {
    4545        if (!is_array($params)) {
     
    7272     * @since   26 Jan 2005 01:54:50
    7373      */
    74     function exists($id)
     74    public function exists($id)
    7575    {
    7676        $src = $this->oSrc($id);
     
    9595     * @since   26 Jan 2005 01:54:50
    9696     */
    97     function size($id, $key)
     97    public function size($id, $key)
    9898    {
    9999        $src = $this->oSrc($id);
     
    113113     * @since   26 Jan 2005 01:56:35
    114114     */
    115     function oSrc($id)
     115    public function oSrc($id)
    116116    {
    117117        $file_name = '';
     
    138138     * @since   26 Jan 2005 01:57:33
    139139     */
    140     function oImg($id, $alt='', $extra='')
     140    public function oImg($id, $alt='', $extra='')
    141141    {
    142142        $src = $this->oSrc($id);
     
    157157    }
    158158} // End class
    159 
    160 ?>
  • branches/eli_branch/lib/ImageThumb.inc.php

    r438 r439  
    4343   
    4444    // General object parameters.
    45     var $_params = array(
     45    private $_params = array(
    4646        // The location for images to create thumbnails from.
    4747        'source_dir' => null,
     
    7272   
    7373    // Default image size specs.
    74     var $_default_image_specs = array(
     74    private $_default_image_specs = array(
    7575        // The destination for an image thumbnail size.
    7676        // Use initial / to specify absolute paths, leave off to specify a path relative to source_dir (eg: ../thumbs).
     
    108108
    109109    // Final specifications for image sizes, set with setSpec().
    110     var $_image_specs = array();
     110    private $_image_specs = array();
    111111
    112112    /**
     
    116116     * @param  array    $params     Array of parameters (key => val pairs).
    117117     */
    118     function setParam($params)
     118    public function setParam($params)
    119119    {
    120120        $app =& App::getInstance();
     
    160160     * @return mixed               Configured parameter value.
    161161     */
    162     function getParam($param)
     162    public function getParam($param)
    163163    {
    164164        $app =& App::getInstance();
     
    180180     *                          Use to overwrite existing spec array values.
    181181     */
    182     function setSpec($spec, $index=null)
     182    public function setSpec($spec, $index=null)
    183183    {
    184184        $app =& App::getInstance();
     
    259259    * @since    08 May 2007 15:26:39
    260260    */
    261     function getSpec($key, $index=null)
     261    public function getSpec($key, $index=null)
    262262    {
    263263        $index = isset($index) ? $index : 0;
     
    271271     * @return  bool true on success, false on failure.
    272272     */
    273     function processAll($runtime_specs=null)
     273    public function processAll($runtime_specs=null)
    274274    {
    275275        $app =& App::getInstance();
     
    313313     * @return  bool true on success, false on failure.
    314314     */
    315     function processFile($file_name, $runtime_specs=null)
     315    public function processFile($file_name, $runtime_specs=null)
    316316    {
    317317        $app =& App::getInstance();
     
    452452    * @since    19 May 2006 13:55:46
    453453    */
    454     function _resizeWithNetpbm($source_file, $dest_file, $spec)
     454    private function _resizeWithNetpbm($source_file, $dest_file, $spec)
    455455    {
    456456        $app =& App::getInstance();
     
    521521    * @since    19 May 2006 15:46:02
    522522    */
    523     function _resizeWithGD($source_file, $dest_file, $spec)
     523    private function _resizeWithGD($source_file, $dest_file, $spec)
    524524    {
    525525        $app =& App::getInstance();
     
    662662     * @return  bool true on success, false on failure.
    663663     */
    664     function deleteThumbs($file_name, $use_glob=false)
     664    public function deleteThumbs($file_name, $use_glob=false)
    665665    {
    666666        $app =& App::getInstance();
     
    700700     * @return  bool true on success, false on failure.
    701701     */
    702     function deleteOriginal($file_name)
     702    public function deleteOriginal($file_name)
    703703    {
    704704        $app =& App::getInstance();
     
    733733     * @return  bool true on success, false on failure.
    734734     */
    735     function exists($file_name)
     735    public function exists($file_name)
    736736    {
    737737        $app =& App::getInstance();
     
    754754     * @return  bool    True on success, false on failure.
    755755     */
    756     function _validFileExtension($file_name)
     756    private function _validFileExtension($file_name)
    757757    {
    758758        preg_match('/.*?\.(\w+)$/i', $file_name, $ext);
     
    766766     * @return  bool true on success, false on failure.
    767767     */
    768     function _createDestDirs($filename=null)
     768    private function _createDestDirs($filename=null)
    769769    {
    770770        $app =& App::getInstance();
     
    844844     * @param string $line    __LINE__.
    845845     */
    846     function _raiseMsg($message, $type, $file, $line)
     846    private function _raiseMsg($message, $type, $file, $line)
    847847    {
    848848        $app =& App::getInstance();
     
    864864     * @since   15 Nov 2005 20:55:22
    865865     */
    866     function _glob($pattern, $directory)
     866    private function _glob($pattern, $directory)
    867867    {
    868868        $file_list = glob(sprintf('%s/%s', $directory, $pattern));
  • branches/eli_branch/lib/Lock.inc.php

    r438 r439  
    3232
    3333    // Configuration of this object.
    34     var $_params = array(
     34    private $_params = array(
    3535        'timeout' => 600,
    3636        'auto_timeout' => 1800,
     
    4444
    4545    // Store lock data from DB.
    46     var $data = array();
     46    private $data = array();
    4747
    4848    // Auth_SQL object from which to access a current user_id.
    49     var $_auth;
     49    private $_auth;
    5050
    5151    /**
     
    5656     * @static
    5757     */
    58     static function &getInstance($auth_object)
     58    public static function &getInstance($auth_object)
    5959    {
    6060        static $instance = null;
     
    7272     * @param mixed  $auth_object  An Auth_SQL or Auth_FILE object.
    7373     */
    74     function Lock($auth_object)
     74    public function __construct($auth_object)
    7575    {
    7676        $app =& App::getInstance();
     
    9595     * @since   26 Aug 2005 17:09:36
    9696     */
    97     function initDB($recreate_db=false)
     97    public function initDB($recreate_db=false)
    9898    {
    9999        $app =& App::getInstance();
     
    142142     * @param  array $params   Array of param keys and values to set.
    143143     */
    144     function setParam($params=null)
     144    public function setParam($params=null)
    145145    {
    146146        if (isset($params) && is_array($params)) {
     
    157157     * @return mixed               Configured parameter value.
    158158     */
    159     function getParam($param)
     159    public function getParam($param)
    160160    {
    161161        $app =& App::getInstance();
     
    178178     * @param string $title       A title to apply to the lock, for display purposes.
    179179     */
    180     function select($record_table_or_lock_id, $record_key=null, $record_val=null)
     180    public function select($record_table_or_lock_id, $record_key=null, $record_val=null)
    181181    {
    182182        $app =& App::getInstance();
     
    219219     * @return bool            True if locked.
    220220     */
    221     function isLocked()
     221    public function isLocked()
    222222    {
    223223        return isset($this->data['lock_id']);
     
    230230     * @return bool            True if current user set the lock.
    231231     */
    232     function isMine()
     232    public function isMine()
    233233    {
    234234        $db =& DB::getInstance();
     
    258258     * @return int            The id for the lock (mysql last insert id).
    259259     */
    260     function set($record_table, $record_key, $record_val, $title='')
     260    public function set($record_table, $record_key, $record_val, $title='')
    261261    {
    262262        $db =& DB::getInstance();
     
    304304     * Unlock the currently selected record.
    305305     */
    306     function remove()
     306    public function remove()
    307307    {
    308308        $app =& App::getInstance();
     
    326326     * Unlock all records, or all records for a specified user.
    327327     */
    328     function removeAll($user_id=null)
     328    public function removeAll($user_id=null)
    329329    {
    330330        $app =& App::getInstance();
     
    350350     * Deletes all locks that are older than auto_timeout.
    351351     */
    352     function _auto_timeout()
     352    private function _auto_timeout()
    353353    {
    354354        $db =& DB::getInstance();
     
    371371     * Redirect to record lock error page.
    372372     */
    373     function dieErrorPage()
     373    public function dieErrorPage()
    374374    {
    375375        $app =& App::getInstance();
     
    381381     * Print error page.
    382382     */
    383     function printErrorHTML()
     383    public function printErrorHTML()
    384384    {
    385385        $app =& App::getInstance();
     
    416416     * Return lock_id of locked record.
    417417     */
    418     function getID()
     418    public function getID()
    419419    {
    420420        return $this->data['lock_id'];
     
    424424     * Return title of locked record.
    425425     */
    426     function getTitle()
     426    public function getTitle()
    427427    {
    428428        return $this->data['title'];
     
    432432     * Return administrator username for locked record.
    433433     */
    434     function getEditor()
     434    public function getEditor()
    435435    {
    436436        return $this->data['editor'];
     
    440440     * Return total seconds since the record was locked.
    441441     */
    442     function getSecondsElapsed()
     442    public function getSecondsElapsed()
    443443    {
    444444        if (isset($this->data['lock_datetime']) && strtotime($this->data['lock_datetime']) < time()) {
  • branches/eli_branch/lib/Navigation.inc.php

    r396 r439  
    3737
    3838    // Configuration parameters for this object.
    39     var $_params = array(       
     39    private $_params = array(       
    4040        'head_title' => true,
    4141        'body_title' => true,
     
    4848        'last_crumb_format' => '%s',
    4949    );
    50     var $pages = array();
     50    public $pages = array();
    5151
    5252    /**
    5353     * Navigation constructor.
    5454     */
    55     function Navigation($params=null)
     55    public function __construct($params=null)
    5656    {
    5757        $app =& App::getInstance();
     
    7474     * @param   array   $vars       Additional page variables.
    7575     */
    76     function add($title, $url=null, $vars=array())
     76    public function add($title, $url=null, $vars=array())
    7777    {
    7878        $page = array(
     
    9191     * @param  array    $params     Array of parameters (key => val pairs).
    9292     */
    93     function setParam($params)
     93    public function setParam($params)
    9494    {
    9595        $app =& App::getInstance();
     
    110110     * @return mixed               Configured parameter value.
    111111     */
    112     function getParam($param)
     112    public function getParam($param)
    113113    {
    114114        $app =& App::getInstance();
     
    127127     * @access  public
    128128     */
    129     function clear()
     129    public function clear()
    130130    {
    131131        $this->pages = array();
     
    139139     * @param mixed $val      Value to set variable to.
    140140     */
    141     function set($key, $val)
     141    public function set($key, $val)
    142142    {
    143143        // Set params of current page.
     
    154154     * @return mixed          Value stored in session.
    155155     */
    156     function get($key, $default='')
     156    public function get($key, $default='')
    157157    {
    158158        $curr_page =& $this->pages[sizeof($this->pages) - 1];
     
    205205     * @return  mixed           Path (string) or false if path param is not set.
    206206     */
    207     function getPath($key='title')
     207    public function getPath($key='title')
    208208    {
    209209        if ($this->getParam('path')) {
     
    227227     * @return  string   Breadcrumbs or empty string if breadcrumbs param not set.
    228228     */
    229     function getBreadcrumbs()
     229    public function getBreadcrumbs()
    230230    {
    231231        $app =& App::getInstance();
     
    279279     * @return  mixed   The value set for $return, TRUE by default.
    280280     */
    281     function currentPage($page_uri, $return=true)
     281    public function currentPage($page_uri, $return=true)
    282282    {
    283283        if (preg_match('/^' . preg_quote(urldecode($page_uri), '/') . '/i', $_SERVER['PHP_SELF'])) {
     
    288288}
    289289// End of class.
    290 
    291 ?>
  • branches/eli_branch/lib/PEdit.inc.php

    r421 r439  
    7070
    7171    // PEdit object parameters.
    72     var $_params = array(
     72    private $_params = array(
    7373        'data_dir' => '',
    7474        'character_set' => 'utf-8',
     
    7777    );
    7878
    79     var $_data = array(); // Array to store loaded data.
    80     var $_data_file = ''; // Full file path to the pedit data file.
    81     var $_authorized = false; // User is authenticated to see extended functions.
    82     var $_data_loaded = false;
    83     var $op = '';
     79    private $_data = array(); // Array to store loaded data.
     80    private $_data_file = ''; // Full file path to the pedit data file.
     81    private $_authorized = false; // User is authenticated to see extended functions.
     82    private $_data_loaded = false;
     83    public $op = '';
    8484
    8585    /**
     
    9393     * @param optional array $params  A hash containing connection parameters.
    9494     */
    95     function PEdit($params)
     95    public function __construct($params)
    9696    {
    9797        $this->setParam($params);
     
    121121     * @param  array    $params     Array of parameters (key => val pairs).
    122122     */
    123     function setParam($params)
     123    public function setParam($params)
    124124    {
    125125        $app =& App::getInstance();
     
    140140     * @return mixed               Configured parameter value.
    141141     */
    142     function getParam($param)
     142    public function getParam($param)
    143143    {
    144144        $app =& App::getInstance();
     
    159159    * @since    12 Apr 2006 12:43:47
    160160    */
    161     function start($initialize_data_file=false)
     161    public function start($initialize_data_file=false)
    162162    {
    163163        $app =& App::getInstance();
     
    217217     * @param array     $options         Additional options to store with this data.
    218218     */
    219     function set($name, $options=array())
     219    public function set($name, $options=array())
    220220    {
    221221        $app =& App::getInstance();
     
    236236     * @return string        The trimmed content of the named data.
    237237     */
    238     function get($name)
     238    public function get($name)
    239239    {
    240240        $name = preg_replace('/\s/', '_', $name);
     
    251251     * @return bool  False if unauthorized or current page is a version.
    252252     */
    253     function formBegin()
     253    public function formBegin()
    254254    {
    255255        $app =& App::getInstance();
     
    288288     * @access public
    289289     */
    290     function printAllForms()
     290    public function printAllForms()
    291291    {
    292292        if ($this->_authorized && $this->op == 'Edit' && is_array($this->_data) && $this->_data_loaded) {
     
    305305     * @param string $type      Type of form to print. Currently only 'text' and 'textarea' supported.
    306306     */
    307     function printForm($name, $type='text')
     307    public function printForm($name, $type='text')
    308308    {
    309309        if ($this->_authorized && $this->op == 'Edit' && $this->_data_loaded) {       
     
    345345     * @return bool  False if unauthorized or current page is a version.
    346346     */
    347     function formEnd()
     347    public function formEnd()
    348348    {
    349349        if (!$this->_authorized || empty($this->_data)) {
     
    399399     * @access public
    400400     */
    401     function printVersions()
     401    public function printVersions()
    402402    {
    403403        $app =& App::getInstance();
     
    442442    * @since    12 Apr 2006 10:52:35
    443443    */
    444     function _fileHash()
     444    private function _fileHash()
    445445    {
    446446        $app =& App::getInstance();
     
    457457    * @since    11 Apr 2006 20:36:26
    458458    */
    459     function _loadDataFile()
     459    private function _loadDataFile()
    460460    {
    461461        $app =& App::getInstance();
     
    496496    * @since    11 Apr 2006 20:53:42
    497497    */
    498     function _initializeDataFile()
     498    private function _initializeDataFile()
    499499    {
    500500        $app =& App::getInstance();
     
    512512     * @return bool  False if unauthorized or on failure. True on success.
    513513     */
    514     function _writeData()
     514    private function _writeData()
    515515    {
    516516        $app =& App::getInstance();
     
    560560    * @since    11 Apr 2006 22:48:30
    561561    */
    562     function _filePutContents($filename, $content)
     562    private function _filePutContents($filename, $content)
    563563    {
    564564        $app =& App::getInstance();
     
    610610     * @return bool  False on failure. True on success.
    611611     */
    612     function _createVersion()
     612    private function _createVersion()
    613613    {
    614614        $app =& App::getInstance();
     
    648648    * @since    12 Apr 2006 11:08:11
    649649    */
    650     function _deleteOldVersions()
     650    private function _deleteOldVersions()
    651651    {
    652652        $app =& App::getInstance();
     
    676676     * @return array  Array of versions.
    677677     */
    678     function _getVersions()
     678    private function _getVersions()
    679679    {
    680680        $version_files = array();
     
    707707     * @return bool  False on failure. True on success.
    708708     */
    709     function _restoreVersion($version)
     709    private function _restoreVersion($version)
    710710    {
    711711        $app =& App::getInstance();
     
    742742
    743743} // End class.
    744 
    745 ?>
  • branches/eli_branch/lib/PageNumbers.inc.php

    r396 r439  
    3939class PageNumbers {
    4040
    41     var $total_items;       // Total quantity of items.
    42     var $total_pages;       // The total number of pages.
    43     var $current_page = 1;  // Current page number.
    44     var $first_item;        // The counter for the first item on this page (zero index).
    45     var $last_item;         // The counter for the last item on this page (zero index).
    46     var $max_num_links = 9; // The max number of links to show on page (odd numbers look best).
    47     var $_num_links;        // The number of links to show on page.
    48     var $_per_page = 25;    // Items per page.
     41    public $total_items;       // Total quantity of items.
     42    public $total_pages;       // The total number of pages.
     43    public $current_page = 1;  // Current page number.
     44    public $first_item;        // The counter for the first item on this page (zero index).
     45    public $last_item;         // The counter for the last item on this page (zero index).
     46    public $max_num_links = 9; // The max number of links to show on page (odd numbers look best).
     47    private $_num_links;        // The number of links to show on page.
     48    private $_per_page = 25;    // Items per page.
    4949
    5050    // Flags to ensure all necessary values have been set before calling calculate().
    51     var $set_per_page_initialized = false;
    52     var $set_page_number_initialized = false;
    53     var $set_total_items_initialized = false;
     51    public $set_per_page_initialized = false;
     52    public $set_page_number_initialized = false;
     53    public $set_total_items_initialized = false;
    5454
    5555    // These are initialized in the constructor.
    56     var $per_page_options;
    57     var $left_arrow;
    58     var $left_arrow_disabled;
    59     var $left_dbl_arrow;
    60     var $left_dbl_arrow_disabled;
    61     var $right_arrow;
    62     var $right_arrow_disabled;
    63     var $right_dbl_arrow;
    64     var $right_dbl_arrow_disabled;
     56    public $per_page_options;
     57    public $left_arrow;
     58    public $left_arrow_disabled;
     59    public $left_dbl_arrow;
     60    public $left_dbl_arrow_disabled;
     61    public $right_arrow;
     62    public $right_arrow_disabled;
     63    public $right_dbl_arrow;
     64    public $right_dbl_arrow_disabled;
    6565
    6666    /**
    6767     * PageNumbers constructor. All arguments are depreciated. Use set* functions instead.
    6868     */
    69     function PageNumbers()
     69    public function __construct()
    7070    {
    7171        // Default options for the quantity per page links.
     
    9393     * Set the number of items per page.
    9494     */
    95     function setPerPage($per_page, $default=25, $save_value=true)
     95    public function setPerPage($per_page, $default=25, $save_value=true)
    9696    {
    9797        // (1) By provided argument, if valid.
     
    115115     * Set the current page number.
    116116     */
    117     function setPageNumber($page_number, $save_value=true)
     117    public function setPageNumber($page_number, $save_value=true)
    118118    {
    119119        // (1) By provided argument, if valid.
     
    139139     * Set the total number of items.
    140140     */
    141     function setTotalItems($total_items)
     141    public function setTotalItems($total_items)
    142142    {
    143143        if (is_numeric($total_items) && $total_items > 0) {
     
    158158     * @access public
    159159     */
    160     function calculate()
     160    public function calculate()
    161161    {
    162162        $app =& App::getInstance();
     
    212212     * Returns the SQL code to limit query to items that are on current page.
    213213     */
    214     function getLimitSQL()
     214    public function getLimitSQL()
    215215    {
    216216        $app =& App::getInstance();
     
    230230     * @access public
    231231     */
    232     function printPerPageLinks($query_key='per_page')
     232    public function printPerPageLinks($query_key='per_page')
    233233    {
    234234        $app =& App::getInstance();
     
    260260     * @access public
    261261     */
    262     function getPageNumURL($page_number, $carry_args=null)
     262    public function getPageNumURL($page_number, $carry_args=null)
    263263    {
    264264        $app =& App::getInstance();
     
    266266        return $app->oHREF($this->url_base . $page_number, $carry_args);
    267267    }
    268     function printPageNumURL($page_number, $carry_args=null)
     268    public function printPageNumURL($page_number, $carry_args=null)
    269269    {
    270270        echo $this->getPageNumURL($page_number, $carry_args);
     
    276276     * @access public
    277277     */
    278     function getPageNumbersArray($carry_args=null)
     278    public function getPageNumbersArray($carry_args=null)
    279279    {
    280280        $page_numbers = array();
     
    296296     * @access public
    297297     */
    298     function getPageNumbers($carry_args=null)
     298    public function getPageNumbers($carry_args=null)
    299299    {
    300300        $page_numbers_string = '';
     
    361361    }
    362362
    363     function printPageNumbers($carry_args=null)
     363    public function printPageNumbers($carry_args=null)
    364364    {
    365365        echo $this->getPageNumbers($carry_args);
     
    368368}
    369369
    370 ?>
  • branches/eli_branch/lib/PageSequence.inc.php

    r396 r439  
    3535class PageSequence
    3636{
    37     var $current_step_id = 0;
    38     var $start_url;
    39     var $sequence_title = '';
    40     var $seq = '_sequence_';
    41     var $idle_timeout;
     37    public $current_step_id = 0;
     38    public $start_url;
     39    public $sequence_title = '';
     40    public $seq = '_sequence_';
     41    public $idle_timeout;
    4242
    4343    /**
     
    4747     * @access public
    4848     */
    49     function PageSequence($params)
     49    public function __construct($params)
    5050    {
    5151        if (isset($params['sequence_title'])) {
     
    8484     * @access public
    8585     */
    86     function addStep($step_id, $params)
     86    public function addStep($step_id, $params)
    8787    {
    8888        // Keys for the steps array cannot be numeric.
     
    114114     * @return bool true on success, false on failure
    115115     */
    116     function setFeature($step_id=null, $features)
     116    public function setFeature($step_id=null, $features)
    117117    {
    118118        $pos = isset($step_id) ? $this->getPosition($step_id) : $this->getPosition();
     
    134134     * @return mixed          Value stored in session.
    135135     */
    136     function getFeature($step_id, $key, $default='')
     136    public function getFeature($step_id, $key, $default='')
    137137    {
    138138        $pos = isset($step_id) ? $this->getPosition($step_id) : $this->getPosition();
     
    151151     * @access public
    152152     */
    153     function setCurrent($step_id)
     153    public function setCurrent($step_id)
    154154    {
    155155        $app =& App::getInstance();
     
    171171     * @access public
    172172     */
    173     function getID($pos=null)
     173    public function getID($pos=null)
    174174    {
    175175        if (isset($pos)) {
     
    188188     * @access public
    189189     */
    190     function getPosition($step_id=null)
     190    public function getPosition($step_id=null)
    191191    {
    192192        // Get current step id if step not provided.
     
    217217     * @access public
    218218     */
    219     function getRequiredID($curr_step_id)
     219    public function getRequiredID($curr_step_id)
    220220    {
    221221        if ('' === $curr_step_id) {
     
    242242     * @access public
    243243     */
    244     function getNextID()
     244    public function getNextID()
    245245    {
    246246        // Loop through all steps.
     
    263263     * @access public
    264264     */
    265     function complete($step_id=null)
     265    public function complete($step_id=null)
    266266    {
    267267        $pos = isset($step_id) ? $this->getPosition($step_id) : $this->getPosition();
     
    277277     * @access public
    278278     */
    279     function printEditLink($step_id=null)
     279    public function printEditLink($step_id=null)
    280280    {
    281281        $app =& App::getInstance();
     
    296296     * @access public
    297297     */
    298     function setDataDefault($data_key, $data_val)
     298    public function setDataDefault($data_key, $data_val)
    299299    {
    300300        if (!isset($_SESSION[$this->seq]['data'][$data_key])) {
     
    310310     * @access public
    311311     */
    312     function getData($data_key=null)
     312    public function getData($data_key=null)
    313313    {
    314314        if (!isset($data_key)) {
     
    328328     * @access public
    329329     */
    330     function clearData($data_key=null)
     330    public function clearData($data_key=null)
    331331    {
    332332        if (isset($data_key)) {
     
    342342     * Deletes all data that are older than auto_timeout. Set current time if not not expired or not set.
    343343     */
    344     function _auto_timeout()
     344    private function _auto_timeout()
    345345    {
    346346        $app =& App::getInstance();
     
    363363     * @access public
    364364     */
    365     function registerData($step_data)
     365    public function registerData($step_data)
    366366    {
    367367        $_SESSION[$this->seq]['data'] = array_merge($_SESSION[$this->seq]['data'], $step_data);
     
    372372     *
    373373     */
    374     function startOver()
     374    public function startOver()
    375375    {
    376376        $this->current_step_id = 0;
     
    383383} // END CLASS
    384384
    385 ?>
  • branches/eli_branch/lib/PayPal.inc.php

    r396 r439  
    3333
    3434    // General object parameters.
    35     var $_params = array(
     35    private $_params = array(
    3636        'paypal_url' => 'https://www.paypal.com/cgi-bin/webscr',
    3737        'test_mode' => false,
     
    3939
    4040    // Options used for specific buttons and links.
    41     var $_default_button_options = array();
     41    private $_default_button_options = array();
    4242
    4343    // Array of buttons created by newButton().
    44     var $_buttons = array();
     44    private $_buttons = array();
    4545
    4646    // Store the response from the last IPN.
    47     var $_ipn_response;
     47    private $_ipn_response;
    4848
    4949    /**
     
    5252     * @param   bool    $test_mode  Use PayPal sandbox for testing.
    5353     */
    54     function PayPal($test_mode=false)
     54    public function __construct($test_mode=false)
    5555    {
    5656        if ($test_mode) {
     
    9595     * @return  bool    True on success, false on failure.
    9696     */
    97     function setButtonDefaults($type, $options)
     97    public function setButtonDefaults($type, $options)
    9898    {
    9999        $app =& App::getInstance();
     
    127127     * @return  bool    True on success, false on failure.
    128128     */
    129     function newButton($type, $name, $options=null)
     129    public function newButton($type, $name, $options=null)
    130130    {
    131131        $app =& App::getInstance();
     
    162162     * @return  mixed   Link of button, or false on failure.
    163163     */
    164     function getLink($name)
     164    public function getLink($name)
    165165    {
    166166        $app =& App::getInstance();
     
    196196     * @param   string  $name   Name of button for which to generate link.
    197197     */
    198     function printLink($name)
     198    public function printLink($name)
    199199    {
    200200        echo $this->getLink($name);
     
    208208     * @param   string  $name   Name of button to print.
    209209     */
    210     function printButton($name)
     210    public function printButton($name)
    211211    {
    212212        ?>
     
    234234     * @param  array    $params     Array of parameters (key => val pairs).
    235235     */
    236     function setParam($params)
     236    public function setParam($params)
    237237    {
    238238        $app =& App::getInstance();
     
    253253     * @return mixed               Configured parameter value.
    254254     */
    255     function getParam($param)
     255    public function getParam($param)
    256256    {
    257257        $app =& App::getInstance();
     
    272272     * @return  bool    True if valid, false if invalid.
    273273     */
    274     function incomingIPNRequest()
     274    public function incomingIPNRequest()
    275275    {
    276276        if ($_SERVER['REQUEST_METHOD'] == 'POST'
     
    290290     * @return  bool    True on success, false on failure.
    291291     */
    292     function processIPN()
     292    public function processIPN()
    293293    {
    294294        $app =& App::getInstance();
     
    351351     * @return  bool    True if response contains VERIFIED, false otherwise.
    352352     */
    353     function verifiedIPN()
     353    public function verifiedIPN()
    354354    {
    355355        $app =& App::getInstance();
     
    380380} // End of class.
    381381
    382 ?>
  • branches/eli_branch/lib/ScriptTimer.inc.php

    r396 r439  
    2626class ScriptTimer {
    2727
    28     var $time_format = '%.3f';
    29     var $_timing_start_times = array();
    30     var $_timing_stop_times = array();
    31     var $_timing_cumulative_times = array();
     28    public $time_format = '%.3f';
     29    private $_timing_start_times = array();
     30    private $_timing_stop_times = array();
     31    private $_timing_cumulative_times = array();
    3232   
    33     function start($name='default')
     33    public function start($name='default')
    3434    {
    3535        $this->_timing_start_times[$name] = explode(' ', microtime());
    3636    }
    3737   
    38     function stop($name='default')
     38    public function stop($name='default')
    3939    {
    4040        if (!isset($this->_timing_stop_times[$name]) || !isset($this->_timing_cumulative_times[$name])) {
     
    4646    }
    4747   
    48     function getTime($name='default')
     48    public function getTime($name='default')
    4949    {
    5050        if (!isset($this->_timing_start_times[$name])) {
     
    6262    }
    6363   
    64     function printAll($sort_by_time=false)
     64    public function printAll($sort_by_time=false)
    6565    {
    6666        $names = array_map('strlen', array_keys($this->_timing_start_times));
     
    8181    }
    8282}
    83 
    84 ?>
  • branches/eli_branch/lib/SortOrder.inc.php

    r396 r439  
    3737class SortOrder {
    3838
    39     var $_columns;
    40     var $sort_by;
    41     var $order;
    42     var $asc_widget;
    43     var $desc_widget;
    44     var $default_sort;
    45     var $default_order;
     39    private $_columns;
     40    public $sort_by;
     41    public $order;
     42    public $asc_widget;
     43    public $desc_widget;
     44    public $default_sort;
     45    public $default_order;
    4646
    4747    /**
     
    5353     *                               current order.
    5454     */
    55     function SortOrder($default_sort = '', $default_order = '')
     55    public function __construct($default_sort = '', $default_order = '')
    5656    {
    5757        $app =& App::getInstance();
     
    8181     * @param string $desc_sql  The sort SQL if $this->order is descending.
    8282     */
    83     function setColumn($name, $asc_sql, $desc_sql)
     83    public function setColumn($name, $asc_sql, $desc_sql)
    8484    {
    8585        $this->_columns[$name] = array(
     
    9999     *                               current order.
    100100     */
    101     function setDefault($default_sort = '', $default_order = '')
     101    public function setDefault($default_sort = '', $default_order = '')
    102102    {
    103103        // Which column to sort by?
     
    139139     *                               for example, for an alphabetical sort)
    140140     */
    141     function set($sort = null, $order = null)
     141    public function set($sort = null, $order = null)
    142142    {
    143143        // Set new sort value.
     
    158158     * Returns the SQL code to sort by set column and set order.
    159159     */
    160     function getSortOrderSQL()
     160    public function getSortOrderSQL()
    161161    {
    162162        $app =& App::getInstance();
     
    189189     *                               for example, for an alphabetical sort)
    190190     */
    191     function printSortHeader($col, $col_name, $default_order='ASC')
     191    public function printSortHeader($col, $col_name, $default_order='ASC')
    192192    {
    193193        $app =& App::getInstance();
     
    210210}
    211211
    212 ?>
  • branches/eli_branch/lib/SpellCheck.inc.php

    r425 r439  
    6161class SpellCheck {
    6262
    63     var $_params = array(
     63    private $_params = array(
    6464        'language' => 'en',
    6565        'personal_wordlist' => '', // Text file to save custom words to.
     
    7070    );
    7171
    72     var $_pspell_cfg_handle;
    73     var $_pspell_handle;
    74     var $_use_personal_wordlist = false;
    75     var $_errors = array();
     72    private $_pspell_cfg_handle;
     73    private $_pspell_handle;
     74    private $_use_personal_wordlist = false;
     75    private $_errors = array();
    7676
    7777    /**
     
    8080     * @param  array    $params     Array of parameters (key => val pairs).
    8181     */
    82     function SpellCheck($params)
     82    public function __construct($params)
    8383    {
    8484        $app =& App::getInstance();
     
    118118     * @param  array    $params     Array of parameters (key => val pairs).
    119119     */
    120     function setParam($params)
     120    public function setParam($params)
    121121    {
    122122        $app =& App::getInstance();
     
    137137     * @return mixed               Configured parameter value.
    138138     */
    139     function getParam($param)
     139    public function getParam($param)
    140140    {
    141141        $app =& App::getInstance();
     
    154154     * @return bool   True if any errors were found, false otherwise.
    155155     */
    156     function anyErrors()
     156    public function anyErrors()
    157157    {
    158158        return (sizeof($this->_errors) > 0);
     
    162162     * Reset the error list.
    163163     */
    164     function resetErrorList()
     164    public function resetErrorList()
    165165    {
    166166        $this->_errors = array();
     
    177177     * @since   09 Jun 2005 18:23:51
    178178     */
    179     function check($word)
     179    public function check($word)
    180180    {
    181181        if (pspell_check($this->_pspell_handle, $word)) {
     
    197197     * @since   09 Jun 2005 18:23:51
    198198     */
    199     function suggest($word)
     199    public function suggest($word)
    200200    {
    201201        return pspell_suggest($this->_pspell_handle, $word);
     
    212212     * @since   09 Jun 2005 18:23:51
    213213     */
    214     function add($word)
     214    public function add($word)
    215215    {
    216216        $app =& App::getInstance();
     
    237237     * @since   09 Jun 2005 18:23:51
    238238     */
    239     function save()
     239    public function save()
    240240    {
    241241        $app =& App::getInstance();
     
    263263     * @since   09 Jun 2005 21:29:49
    264264     */
    265     function getStringSuggestions($string)
     265    public function getStringSuggestions($string)
    266266    {
    267267        $corrections = array();
     
    299299     * @since   09 Jun 2005 22:11:27
    300300     */
    301     function checkString($string)
     301    public function checkString($string)
    302302    {
    303303        $errors = array();
     
    331331     * @since   09 Jun 2005 21:29:49
    332332     */
    333     function getStringHighlighted($string, $show_footnote=false)
     333    public function getStringHighlighted($string, $show_footnote=false)
    334334    {
    335335        $words = preg_split('/([\W]+?)/', $string, -1, PREG_SPLIT_DELIM_CAPTURE);
     
    357357     * @since   09 Jun 2005 21:29:49
    358358     */
    359     function printCorrectionForm($form_name)
     359    public function printCorrectionForm($form_name)
    360360    {
    361361        ?>
     
    402402     * @since   09 Jun 2005 23:15:35
    403403     */
    404     function anyFormCorrections()
     404    public function anyFormCorrections()
    405405    {
    406406        return (false !== getFormData('spelling_suggestions', false)) || (false !== getFormData('spelling_corrections', false));
     
    417417     * @since   09 Jun 2005 23:18:51
    418418     */
    419     function applyFormCorrections($form_name)
     419    public function applyFormCorrections($form_name)
    420420    {
    421421        $form_words = preg_split('/([\W]+?)/', getFormData($form_name), -1, PREG_SPLIT_DELIM_CAPTURE);
     
    445445} // End.
    446446
    447 ?>
  • branches/eli_branch/lib/TemplateGlue.inc.php

    r407 r439  
    501501    }
    502502}
    503 
    504 ?>
  • branches/eli_branch/lib/Upload.inc.php

    r415 r439  
    4141
    4242    // General object parameters.
    43     var $_params = array(
     43    private $_params = array(
    4444
    4545        // Which messages do we pass to raiseMsg?
     
    6363
    6464    // Array of files with errors.
    65     var $errors = array();
     65    public $errors = array();
    6666
    6767    // Array of file name extensions and corresponding mime-types.
    68     var $mime_extension_map = array( 'ez' => 'application/andrew-inset', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'doc' => 'application/msword', 'bin' => 'application/octet-stream', 'class' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'dms' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', 'so' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'mif' => 'application/vnd.mif', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'sxc' => 'application/vnd.sun.xml.calc', 'stc' => 'application/vnd.sun.xml.calc.template', 'sxd' => 'application/vnd.sun.xml.draw', 'std' => 'application/vnd.sun.xml.draw.template', 'sxi' => 'application/vnd.sun.xml.impress', 'sti' => 'application/vnd.sun.xml.impress.template', 'sxm' => 'application/vnd.sun.xml.math', 'sxw' => 'application/vnd.sun.xml.writer', 'sxg' => 'application/vnd.sun.xml.writer.global', 'stw' => 'application/vnd.sun.xml.writer.template', 'vsd' => 'application/vnd.visio', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'wmlsc' => 'application/vnd.wap.wmlscriptc', 'bcpio' => 'application/x-bcpio', 'vcd' => 'application/x-cdlink', 'pgn' => 'application/x-chess-pgn', 'Z' => 'application/x-compress', 'cpio' => 'application/x-cpio', 'csh' => 'application/x-csh', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'spl' => 'application/x-futuresplash', 'gtar' => 'application/x-gtar', 'tgz' => 'application/x-gtar', 'gz' => 'application/x-gzip', 'hdf' => 'application/x-hdf', 'php' => 'application/x-httpd-php', 'php3' => 'application/x-httpd-php3', 'js' => 'application/x-javascript', 'skd' => 'application/x-koan', 'skm' => 'application/x-koan', 'skp' => 'application/x-koan', 'skt' => 'application/x-koan', 'latex' => 'application/x-latex', 'wmd' => 'application/x-ms-wmd', 'wmz' => 'application/x-ms-wmz', 'cdf' => 'application/x-netcdf', 'nc' => 'application/x-netcdf', 'pl' => 'application/x-perl', 'pm' => 'application/x-perl', 'psd' => 'application/x-photoshop', 'sh' => 'application/x-sh', 'shar' => 'application/x-shar', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'sv4cpio' => 'application/x-sv4cpio', 'sv4crc' => 'application/x-sv4crc', 'tar' => 'application/x-tar', 'tcl' => 'application/x-tcl', 'tex' => 'application/x-tex', 'texi' => 'application/x-texinfo', 'texinfo' => 'application/x-texinfo', 'roff' => 'application/x-troff', 't' => 'application/x-troff', 'tr' => 'application/x-troff', 'man' => 'application/x-troff-man', 'me' => 'application/x-troff-me', 'ms' => 'application/x-troff-ms', 'ustar' => 'application/x-ustar', 'src' => 'application/x-wais-source', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'xml' => 'application/xml', 'zip' => 'application/zip', 'au' => 'audio/basic', 'snd' => 'audio/basic', 'kar' => 'audio/midi', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'mpga' => 'audio/mpeg', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'm3u' => 'audio/x-mpegurl', 'wax' => 'audio/x-ms-wax', 'wma' => 'audio/x-ms-wma', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', 'wav' => 'audio/x-wav', 'pdb' => 'chemical/x-pdb', 'xyz' => 'chemical/x-xyz', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'ief' => 'image/ief', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'wbmp' => 'image/vnd.wap.wbmp', 'ras' => 'image/x-cmu-raster', 'pnm' => 'image/x-portable-anymap', 'pbm' => 'image/x-portable-bitmap', 'pgm' => 'image/x-portable-graymap', 'ppm' => 'image/x-portable-pixmap', 'rgb' => 'image/x-rgb', 'xbm' => 'image/x-xbitmap', 'xpm' => 'image/x-xpixmap', 'xwd' => 'image/x-xwindowdump', 'iges' => 'model/iges', 'igs' => 'model/iges', 'mesh' => 'model/mesh', 'msh' => 'model/mesh', 'silo' => 'model/mesh', 'vrml' => 'model/vrml', 'wrl' => 'model/vrml', 'ics' => 'text/calendar', 'ifb' => 'text/calendar', 'vcs' => 'text/calendar', 'vfb' => 'text/calendar', 'css' => 'text/css', 'csv' => 'text/csv', 'diff' => 'text/diff', 'patch' => 'text/diff', 'htm' => 'text/html', 'html' => 'text/html', 'shtml' => 'text/html', 'asc' => 'text/plain', 'log' => 'text/plain', 'po' => 'text/plain', 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'tsv' => 'text/tab-separated-values', 'wml' => 'text/vnd.wap.wml', 'wmls' => 'text/vnd.wap.wmlscript', 'etx' => 'text/x-setext', 'vcf' => 'text/x-vcard', 'xsl' => 'text/xml', 'mp4' => 'video/mp4', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', 'qt' => 'video/quicktime', 'mxu' => 'video/vnd.mpegurl', 'asf' => 'video/x-ms-asf', 'asx' => 'video/x-ms-asf', 'wm' => 'video/x-ms-wm', 'wmv' => 'video/x-ms-wmv', 'wmx' => 'video/x-ms-wmx', 'wvx' => 'video/x-ms-wvx', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie', 'ice' => 'x-conference/x-cooltalk', );
     68    public $mime_extension_map = array( 'ez' => 'application/andrew-inset', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'doc' => 'application/msword', 'bin' => 'application/octet-stream', 'class' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'dms' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', 'so' => 'application/octet-stream', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'mif' => 'application/vnd.mif', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'sxc' => 'application/vnd.sun.xml.calc', 'stc' => 'application/vnd.sun.xml.calc.template', 'sxd' => 'application/vnd.sun.xml.draw', 'std' => 'application/vnd.sun.xml.draw.template', 'sxi' => 'application/vnd.sun.xml.impress', 'sti' => 'application/vnd.sun.xml.impress.template', 'sxm' => 'application/vnd.sun.xml.math', 'sxw' => 'application/vnd.sun.xml.writer', 'sxg' => 'application/vnd.sun.xml.writer.global', 'stw' => 'application/vnd.sun.xml.writer.template', 'vsd' => 'application/vnd.visio', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'wmlsc' => 'application/vnd.wap.wmlscriptc', 'bcpio' => 'application/x-bcpio', 'vcd' => 'application/x-cdlink', 'pgn' => 'application/x-chess-pgn', 'Z' => 'application/x-compress', 'cpio' => 'application/x-cpio', 'csh' => 'application/x-csh', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'spl' => 'application/x-futuresplash', 'gtar' => 'application/x-gtar', 'tgz' => 'application/x-gtar', 'gz' => 'application/x-gzip', 'hdf' => 'application/x-hdf', 'php' => 'application/x-httpd-php', 'php3' => 'application/x-httpd-php3', 'js' => 'application/x-javascript', 'skd' => 'application/x-koan', 'skm' => 'application/x-koan', 'skp' => 'application/x-koan', 'skt' => 'application/x-koan', 'latex' => 'application/x-latex', 'wmd' => 'application/x-ms-wmd', 'wmz' => 'application/x-ms-wmz', 'cdf' => 'application/x-netcdf', 'nc' => 'application/x-netcdf', 'pl' => 'application/x-perl', 'pm' => 'application/x-perl', 'psd' => 'application/x-photoshop', 'sh' => 'application/x-sh', 'shar' => 'application/x-shar', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'sv4cpio' => 'application/x-sv4cpio', 'sv4crc' => 'application/x-sv4crc', 'tar' => 'application/x-tar', 'tcl' => 'application/x-tcl', 'tex' => 'application/x-tex', 'texi' => 'application/x-texinfo', 'texinfo' => 'application/x-texinfo', 'roff' => 'application/x-troff', 't' => 'application/x-troff', 'tr' => 'application/x-troff', 'man' => 'application/x-troff-man', 'me' => 'application/x-troff-me', 'ms' => 'application/x-troff-ms', 'ustar' => 'application/x-ustar', 'src' => 'application/x-wais-source', 'xht' => 'application/xhtml+xml', 'xhtml' => 'application/xhtml+xml', 'xml' => 'application/xml', 'zip' => 'application/zip', 'au' => 'audio/basic', 'snd' => 'audio/basic', 'kar' => 'audio/midi', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'mpga' => 'audio/mpeg', 'aif' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'm3u' => 'audio/x-mpegurl', 'wax' => 'audio/x-ms-wax', 'wma' => 'audio/x-ms-wma', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', 'wav' => 'audio/x-wav', 'pdb' => 'chemical/x-pdb', 'xyz' => 'chemical/x-xyz', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'ief' => 'image/ief', 'jpe' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'wbmp' => 'image/vnd.wap.wbmp', 'ras' => 'image/x-cmu-raster', 'pnm' => 'image/x-portable-anymap', 'pbm' => 'image/x-portable-bitmap', 'pgm' => 'image/x-portable-graymap', 'ppm' => 'image/x-portable-pixmap', 'rgb' => 'image/x-rgb', 'xbm' => 'image/x-xbitmap', 'xpm' => 'image/x-xpixmap', 'xwd' => 'image/x-xwindowdump', 'iges' => 'model/iges', 'igs' => 'model/iges', 'mesh' => 'model/mesh', 'msh' => 'model/mesh', 'silo' => 'model/mesh', 'vrml' => 'model/vrml', 'wrl' => 'model/vrml', 'ics' => 'text/calendar', 'ifb' => 'text/calendar', 'vcs' => 'text/calendar', 'vfb' => 'text/calendar', 'css' => 'text/css', 'csv' => 'text/csv', 'diff' => 'text/diff', 'patch' => 'text/diff', 'htm' => 'text/html', 'html' => 'text/html', 'shtml' => 'text/html', 'asc' => 'text/plain', 'log' => 'text/plain', 'po' => 'text/plain', 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'sgm' => 'text/sgml', 'sgml' => 'text/sgml', 'tsv' => 'text/tab-separated-values', 'wml' => 'text/vnd.wap.wml', 'wmls' => 'text/vnd.wap.wmlscript', 'etx' => 'text/x-setext', 'vcf' => 'text/x-vcard', 'xsl' => 'text/xml', 'mp4' => 'video/mp4', 'mpe' => 'video/mpeg', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', 'qt' => 'video/quicktime', 'mxu' => 'video/vnd.mpegurl', 'asf' => 'video/x-ms-asf', 'asx' => 'video/x-ms-asf', 'wm' => 'video/x-ms-wm', 'wmv' => 'video/x-ms-wmv', 'wmx' => 'video/x-ms-wmx', 'wvx' => 'video/x-ms-wvx', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie', 'ice' => 'x-conference/x-cooltalk', );
    6969
    7070    /**
     
    7474     * @param  array    $params     Array of parameters (key => val pairs).
    7575     */
    76     function setParam($params)
     76    public function setParam($params)
    7777    {
    7878        $app =& App::getInstance();
     
    118118     * @return mixed               Configured parameter value.
    119119     */
    120     function getParam($param)
     120    public function getParam($param)
    121121    {
    122122        $app =& App::getInstance();
     
    144144     *                        In this case it is necessary to check the Upload::anyErrors method to discover if any did fail.
    145145     */
    146     function process($form_name, $custom_file_name=null)
     146    public function process($form_name, $custom_file_name=null)
    147147    {
    148148        $app =& App::getInstance();
     
    351351     * @return  bool                Success of operation.
    352352     */
    353     function deleteFile($file_name, $use_glob=false)
     353    public function deleteFile($file_name, $use_glob=false)
    354354    {
    355355        $app =& App::getInstance();
     
    384384     * @return  bool                Success of operation.
    385385     */
    386     function moveFile($old_name, $new_name)
     386    public function moveFile($old_name, $new_name)
    387387    {
    388388        $app =& App::getInstance();
     
    419419     * @return  bool                Existence of file.
    420420     */
    421     function exists($file_name)
     421    public function exists($file_name)
    422422    {
    423423        $app =& App::getInstance();
     
    442442     * @since   15 Nov 2005 20:55:22
    443443     */
    444     function getFilenameGlob($pattern)
     444    public function getFilenameGlob($pattern)
    445445    {
    446446        $file_list = glob(sprintf('%s/%s', $this->getParam('upload_path'), $pattern));
     
    458458     * @return  array   List of file names.
    459459     */
    460     function getErrors()
     460    public function getErrors()
    461461    {
    462462        return $this->errors;
     
    468468     * @access  public
    469469     */
    470     function anyErrors()
     470    public function anyErrors()
    471471    {
    472472        return sizeof($this->errors) > 0;
     
    480480     * @return  string              The same name, but cleaned.
    481481     */
    482     function cleanFileName($file_name)
     482    public function cleanFileName($file_name)
    483483    {
    484484        $bad  = 'áéíóúàÚìòùÀëïöÌÁÉÍÓÚÀÈÌÒÙÄËÏÖÜâêîÎûÂÊÎÔÛñçÇ@';
     
    499499     * @return  string              The value found after the dot
    500500     */
    501     function getFilenameExtension($file_name)
     501    public function getFilenameExtension($file_name)
    502502    {
    503503        preg_match('/.*?\.(\w+)$/i', trim($file_name), $ext);
     
    516516     * @param string $line    __LINE__.
    517517     */
    518     function _raiseMsg($message, $type, $file, $line)
     518    public function _raiseMsg($message, $type, $file, $line)
    519519    {
    520520        $app =& App::getInstance();
     
    526526}
    527527
    528 ?>
  • branches/eli_branch/lib/Utilities.inc.php

    r419 r439  
    10881088    }
    10891089}
    1090 
    1091 
    1092 ?>
  • branches/eli_branch/lib/Validator.inc.php

    r415 r439  
    5353     * @return bool   true if form is not empty, false otherwise.
    5454     */
    55     function notEmpty($val)
     55    public function notEmpty($val)
    5656    {
    5757        return '' != trim((string)$val);
     
    6464     * @return bool   true if form is empty, false otherwise.
    6565     */
    66     function isEmpty($val)
     66    public function isEmpty($val)
    6767    {
    6868        return '' == trim((string)$val);
     
    7575     * @return bool   true if form is a string, false otherwise.
    7676     */
    77     function isString($val)
     77    public function isString($val)
    7878    {
    7979        return '' == trim((string)$val) || is_string($val);
     
    8686     * @return bool   True if no errors found, false otherwise.
    8787     */
    88     function isNumber($val)
     88    public function isNumber($val)
    8989    {
    9090        return '' == trim((string)$val) || is_numeric($val);
     
    9898     * @return bool   true if value is an integer
    9999     */
    100     function isInteger($val, $negative_ok=false)
     100    public function isInteger($val, $negative_ok=false)
    101101    {
    102102        $pattern = $negative_ok ? '/^-?[[:digit:]]+$/' : '/^[[:digit:]]+$/';
     
    112112     * @return bool   true if value is a float
    113113     */
    114     function isFloat($val, $negative_ok=false)
     114    public function isFloat($val, $negative_ok=false)
    115115    {
    116116        $pattern = $negative_ok ? '/^-?[[:digit:]]*(?:\.?[[:digit:]]+)$/' : '/^[[:digit:]]*(?:\.?[[:digit:]]+)$/';
     
    124124     * @return bool   true if value is a float
    125125     */
    126     function isArray($val)
     126    public function isArray($val)
    127127    {
    128128        return (is_string($val) && '' == trim((string)$val)) || is_array($val);
     
    138138     * @return bool   true if value passes regex test
    139139     */
    140     function checkRegex($val, $regex, $valid_on_match=true)
     140    public function checkRegex($val, $regex, $valid_on_match=true)
    141141    {
    142142        return $valid_on_match ? preg_match($regex, $val) : !preg_match($regex, $val);
     
    151151     * @return bool   true if string length is within given boundaries
    152152     */
    153     function stringLength($val, $min, $max)
     153    public function stringLength($val, $min, $max)
    154154    {
    155155        return mb_strlen(trim((string)$val)) >= $min && mb_strlen($val) <= $max;
     
    164164     * @return bool   True if no errors found, false otherwise.
    165165     */
    166     function numericRange($val, $min, $max)
     166    public function numericRange($val, $min, $max)
    167167    {
    168168        return '' == trim((string)$val) || (is_numeric($val) && $val >= $min && $val <= $max);
     
    183183     * @author  Quinn Comendant <quinn@strangecode.com>
    184184     */
    185     function validateEmail($val)
     185    public function validateEmail($val)
    186186    {
    187187        require_once 'codebase/lib/Email.inc.php';
     
    222222     * @return bool    True if no errors found, false otherwise.
    223223     */
    224     function validateStrDate($val)
     224    public function validateStrDate($val)
    225225    {
    226226        $app =& App::getInstance();
     
    250250     * @return bool    True if no errors found, false otherwise.
    251251     */
    252      function validateCCNumber($val, $cc_type=null)
     252     public function validateCCNumber($val, $cc_type=null)
    253253     {
    254254         // Get rid of any non-digits
     
    319319     * @return bool   True if no errors found, false otherwise.
    320320     */
    321     function fileUploaded($form_name)
     321    public function fileUploaded($form_name)
    322322    {
    323323        if (!isset($_FILES[$form_name]['name']) || empty($_FILES[$form_name]['name'])) {
     
    342342} // THE END
    343343
    344 ?>
  • branches/eli_branch/lib/Version.inc.php

    r396 r439  
    4040
    4141    // Configuration of this object.
    42     var $_params = array(
     42    private $_params = array(
    4343        'max_qty' => 100, // Never have more than this many versions of each record.
    4444        'min_qty' => 25, // Keep at least this many versions of each record.
     
    5454
    5555    // Auth_SQL object from which to access a current user_id.
    56     var $_auth;
     56    private $_auth;
    5757
    5858    /**
     
    6363     * @static
    6464     */
    65     static function &getInstance($auth_object)
     65    public static function &getInstance($auth_object)
    6666    {
    6767        static $instance = null;
     
    7979     * @param mixed  $auth_object  An Auth_SQL object.
    8080     */
    81     function Version($auth_object)
     81    public function __construct($auth_object)
    8282    {
    8383        $app =& App::getInstance();
     
    102102     * @since   26 Aug 2005 17:09:36
    103103     */
    104     function initDB($recreate_db=false)
     104    public function initDB($recreate_db=false)
    105105    {
    106106        $app =& App::getInstance();
     
    155155     * @param  array $params   Array of param keys and values to set.
    156156     */
    157     function setParam($params=null)
     157    public function setParam($params=null)
    158158    {
    159159        if (isset($params) && is_array($params)) {
     
    170170     * @return mixed               Configured parameter value.
    171171     */
    172     function getParam($param)
     172    public function getParam($param)
    173173    {
    174174        $app =& App::getInstance();
     
    192192     * @return int                  The id for the version (mysql last insert id).
    193193     */
    194     function create($record_table, $record_key, $record_val, $title='', $notes='')
     194    public function create($record_table, $record_key, $record_val, $title='', $notes='')
    195195    {
    196196        $app =& App::getInstance();
     
    253253     * @return int                  The id for the version (mysql last insert id).
    254254     */
    255     function restore($version_id)
     255    public function restore($version_id)
    256256    {
    257257        $app =& App::getInstance();
     
    314314     * @return mixed                Array of versions, or false if none.
    315315     */
    316     function deleteOld($record_table, $record_key, $record_val)
     316    public function deleteOld($record_table, $record_key, $record_val)
    317317    {
    318318        $db =& DB::getInstance();
     
    381381     * @return mixed                Array of versions, or false if none.
    382382     */
    383     function getList($record_table, $record_key, $record_val)
     383    public function getList($record_table, $record_key, $record_val)
    384384    {
    385385        $db =& DB::getInstance();
     
    418418     * @return mixed                Array of data saved in version, or false if none.
    419419     */
    420     function getVerson($version_id)
     420    public function getVerson($version_id)
    421421    {
    422422        $db =& DB::getInstance();
     
    439439     * @return mixed                Array of data saved in version, or false if none.
    440440     */
    441     function getData($version_id)
     441    public function getData($version_id)
    442442    {
    443443        $db =& DB::getInstance();
     
    465465     * @return mixed                Array of data saved in version, or false if none.
    466466     */
    467     function getCurrent($record_table, $record_key, $record_val)
     467    public function getCurrent($record_table, $record_key, $record_val)
    468468    {
    469469        $db =& DB::getInstance();
     
    484484
    485485} // End of class.
    486 ?>
  • branches/eli_branch/services/reset_password.php

    r396 r439  
    8787include 'footer.ihtml';
    8888
    89 ?>
Note: See TracChangeset for help on using the changeset viewer.