[phpMP-CVS] CVS: phpMP/includes auth.php,1.25,1.26 constants.php,1.11,1.12 core.php,1.38,1.39 functi
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2002-12-05 00:33:45
|
Update of /cvsroot/phpmp/phpMP/includes In directory sc8-pr-cvs1:/tmp/cvs-serv15643/includes Modified Files: auth.php constants.php core.php functions.php language.php template.php user.php Log Message: Added 'C_' to config constants not pertaining to the DB connection. Call me anal retentive if you want. I don't care. Index: auth.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/auth.php,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** auth.php 4 Dec 2002 00:18:52 -0000 1.25 --- auth.php 5 Dec 2002 00:33:42 -0000 1.26 *************** *** 15,19 **** if( isset( $_GET['SESSID'] ) { ! define("SESSID_LOC", 1); $session_id = $_GET['SESSID']; --- 15,19 ---- if( isset( $_GET['SESSID'] ) { ! define("C_SESSID_LOC", 1); $session_id = $_GET['SESSID']; *************** *** 21,34 **** } // We're using the cookie set by the previous session. ! elseif( isset( $_COOKIE[COOKIE_NAME] ) { ! define("SESSID_LOC", 2); ! $session_id = $_COOKIE[COOKIE_NAME]; } ! $sql = "SELECT * FROM " . SESSIONS_TABLE . " WHERE sessid=" . $session_id . " AND expiry<" . time(); $result = $DB->query($sql); --- 21,34 ---- } // We're using the cookie set by the previous session. ! elseif( isset( $_COOKIE[C_COOKIE_NAME] ) { ! define("C_SESSID_LOC", 2); ! $session_id = $_COOKIE[C_COOKIE_NAME]; } ! $sql = "SELECT * FROM " . C_SESSIONS_TABLE . " WHERE sessid=" . $session_id . " AND expiry<" . time(); $result = $DB->query($sql); *************** *** 48,52 **** } ! if( SESSID_LOC == 2 ) // We need to set up the cookie. { --- 48,52 ---- } ! if( C_SESSID_LOC == 2 ) // We need to set up the cookie. { Index: constants.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/constants.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** constants.php 3 Dec 2002 11:17:42 -0000 1.11 --- constants.php 5 Dec 2002 00:33:42 -0000 1.12 *************** *** 1,5 **** <? ! define("TIME_NOW", date( DATE_FORMAT ) ); define("ACTIVATE_DISABLED", 0); --- 1,5 ---- <? ! define("TIME_NOW", date( C_DATE_FORMAT ) ); define("ACTIVATE_DISABLED", 0); Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/core.php,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** core.php 3 Dec 2002 11:17:42 -0000 1.38 --- core.php 5 Dec 2002 00:33:42 -0000 1.39 *************** *** 11,23 **** { ! define("CONFIG_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'config'); ! define("USERS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'users'); ! define("SESSIONS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'sessions'); ! define("MODULES_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'modules'); ! define("BLOCK_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'blocks'); global $DB; ! $result = $DB->query( "SELECT * FROM " . CONFIG_TABLE ); // Loop through all config values from DB. --- 11,23 ---- { ! define("C_CONFIG_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'config'); ! define("C_USERS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'users'); ! define("C_SESSIONS_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'sessions'); ! define("C_MODULES_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'modules'); ! define("C_BLOCK_TABLE", DB_NAME . '.' . DB_TABLE_PREFIX . 'blocks'); global $DB; ! $result = $DB->query( "SELECT * FROM " . C_CONFIG_TABLE ); // Loop through all config values from DB. *************** *** 36,47 **** function init ( $optional_files = array() ) { ! include_once( PHPMP_ROOT . 'config.php' ); ! include_once( PHPMP_ROOT . 'includes/debug.php' ); $Debug = new Debug(); global $DB; ! include_once( PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); $DB = new DB(); $DB->connect(); --- 36,47 ---- function init ( $optional_files = array() ) { ! include_once( C_PHPMP_ROOT . 'config.php' ); ! include_once( C_PHPMP_ROOT . 'includes/debug.php' ); $Debug = new Debug(); global $DB; ! include_once( C_PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); $DB = new DB(); $DB->connect(); *************** *** 49,64 **** $this->_initConfig(); // Grab DB-stored config values. ! include_once(PHPMP_ROOT . 'includes/functions.php'); ! include_once(PHPMP_ROOT . 'includes/user.php'); $User = new User(); // Create an instance of User. ! include_once(PHPMP_ROOT . 'includes/language.php'); $Language = new Language(); createConstants(); ! include_once(PHPMP_ROOT . 'includes/constants.php'); ! include_once(PHPMP_ROOT . 'includes/mpcode.php'); // This while() statement will loop through the --- 49,64 ---- $this->_initConfig(); // Grab DB-stored config values. ! include_once(C_PHPMP_ROOT . 'includes/functions.php'); ! include_once(C_PHPMP_ROOT . 'includes/user.php'); $User = new User(); // Create an instance of User. ! include_once(C_PHPMP_ROOT . 'includes/language.php'); $Language = new Language(); createConstants(); ! include_once(C_PHPMP_ROOT . 'includes/constants.php'); ! include_once(C_PHPMP_ROOT . 'includes/mpcode.php'); // This while() statement will loop through the *************** *** 68,78 **** { ! include_once(PHPMP_ROOT . 'includes/' . $my_file . '.php'); $i++; } ! include_once(PHPMP_ROOT . 'includes/Smarty.class.php'); ! include_once(PHPMP_ROOT . 'includes/template.php'); $Template = new Template(); // Create an instance of Template. --- 68,78 ---- { ! include_once(C_PHPMP_ROOT . 'includes/' . $my_file . '.php'); $i++; } ! include_once(C_PHPMP_ROOT . 'includes/Smarty.class.php'); ! include_once(C_PHPMP_ROOT . 'includes/template.php'); $Template = new Template(); // Create an instance of Template. Index: functions.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/functions.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** functions.php 3 Dec 2002 11:43:47 -0000 1.15 --- functions.php 5 Dec 2002 00:33:42 -0000 1.16 *************** *** 10,18 **** if( defined( "U_DATE_FORMAT" ) ) { ! define( "DATE_FORMAT", U_DATE_FORMAT ); } else { ! define( "DATE_FORMAT", DEFAULT_DATE_FORMAT ); } --- 10,18 ---- if( defined( "U_DATE_FORMAT" ) ) { ! define( "C_DATE_FORMAT", U_DATE_FORMAT ); } else { ! define( "C_DATE_FORMAT", C_DEFAULT_DATE_FORMAT ); } Index: language.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/language.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** language.php 3 Dec 2002 11:17:42 -0000 1.4 --- language.php 5 Dec 2002 00:33:42 -0000 1.5 *************** *** 9,21 **** if( defined("U_LANGUAGE") ) { ! define( "LANGUAGE", U_LANGUAGE ); } else { ! define( "LANGUAGE", DEFAULT_LANG ); } global $Local; ! include_once( PHPMP_ROOT . 'languages/' . LANGUAGE . '/lang_main.php' ); $Local = new Localization(); --- 9,21 ---- if( defined("U_LANGUAGE") ) { ! define( "C_LANGUAGE", U_LANGUAGE ); } else { ! define( "C_LANGUAGE", DEFAULT_LANG ); } global $Local; ! include_once( C_PHPMP_ROOT . 'languages/' . C_LANGUAGE . '/lang_main.php' ); $Local = new Localization(); Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/template.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** template.php 3 Dec 2002 11:17:42 -0000 1.23 --- template.php 5 Dec 2002 00:33:42 -0000 1.24 *************** *** 17,25 **** $this->assign( array( ! "SITE_ADDR" => SITE_ADDR, ! "SITE_NAME" => SITE_NAME, ! "REL_PATH" => REL_PATH, ! "TIME_NOW" => TIME_NOW, ! "TEMPLATE" => TEMPLATE ) ); --- 17,25 ---- $this->assign( array( ! "C_SITE_ADDR" => SITE_ADDR, ! "C_SITE_NAME" => SITE_NAME, ! "C_REL_PATH" => REL_PATH, ! "C_TIME_NOW" => TIME_NOW, ! "C_TEMPLATE" => TEMPLATE ) ); *************** *** 47,62 **** { ! if( defined( "USR_TPL" ) && ( OVERRIDE_USR_TPL == 0 ) ) { ! define( "TEMPLATE", U_TEMPLATE ); } else { ! define( "TEMPLATE", DEFAULT_TPL ); } // Set up the directories for Smarty. ! $this->template_dir = './templates/' . TEMPLATE; ! $this->compile_dir = './templates/' . TEMPLATE . '/compile'; ! $this->config_dir = './templates/' . TEMPLATE . '/configs'; $this->cache_dir = ''; --- 47,62 ---- { ! if( defined( "U_USR_TPL" ) && ( C_OVERRIDE_USR_TPL == 0 ) ) { ! define( "C_TEMPLATE", U_TEMPLATE ); } else { ! define( "C_TEMPLATE", C_DEFAULT_TPL ); } // Set up the directories for Smarty. ! $this->template_dir = './templates/' . C_TEMPLATE; ! $this->compile_dir = './templates/' . C_TEMPLATE . '/compile'; ! $this->config_dir = './templates/' . C_TEMPLATE . '/configs'; $this->cache_dir = ''; Index: user.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/includes/user.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** user.php 4 Dec 2002 00:18:52 -0000 1.5 --- user.php 5 Dec 2002 00:33:42 -0000 1.6 *************** *** 10,14 **** global $DB; ! $sql = "SELECT * FROM " . USERS_TABLE . " WHERE userid=$user"; $qry = $DB->query($sql); --- 10,14 ---- global $DB; ! $sql = "SELECT * FROM " . C_USERS_TABLE . " WHERE userid=$user"; $qry = $DB->query($sql); *************** *** 35,39 **** { ! $sql = "DELETE FROM " . SESSIONS_TABLE . " WHERE expiry<" . time(); $DB->query($sql); --- 35,39 ---- { ! $sql = "DELETE FROM " . C_SESSIONS_TABLE . " WHERE expiry<" . time(); $DB->query($sql); *************** *** 49,53 **** // Must decide is this is an anonymous user or a registered user. ! if( USE_PERMS == 1 ) { --- 49,53 ---- // Must decide is this is an anonymous user or a registered user. ! if( C_USE_PERMS == 1 ) { *************** *** 56,60 **** global $Auth; ! include_once( PHPMP_ROOT . 'includes/auth.php' ); $Auth = new Auth(); --- 56,60 ---- global $Auth; ! include_once( C_PHPMP_ROOT . 'includes/auth.php' ); $Auth = new Auth(); |