phpmp-commits Mailing List for phpMyPublications (Page 5)
Status: Pre-Alpha
Brought to you by:
heimidal
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(69) |
May
(1) |
Jun
|
Jul
(53) |
Aug
(27) |
Sep
|
Oct
|
Nov
(35) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(5) |
Feb
(65) |
Mar
|
Apr
(15) |
May
(40) |
Jun
(72) |
Jul
|
Aug
(2) |
Sep
(95) |
Oct
(37) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Brian R. <hei...@us...> - 2003-09-14 09:24:29
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv4793 Modified Files: index.php Log Message: core/core.php has been moved to core/main.php. The Core class has been renamed to Portal. Index: index.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/index.php,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** index.php 14 Sep 2003 07:02:09 -0000 1.49 --- index.php 14 Sep 2003 09:24:25 -0000 1.50 *************** *** 24,38 **** define('C_PHPMP_ROOT', './'); ! include_once( C_PHPMP_ROOT . 'includes/core.php' ); ! $Core = new Core(); global $Template; $Template->assign_vars( array( ! 'C_SITE_NAME' => $Core->get('site_name'), ! 'C_SITE_ADDRESS' => $Core->get('site_domain') . $Core->get('rel_path'), ! 'C_VERSION' => $Core->get('version'), ! 'C_REL_PATH' => $Core->get('rel_path'), ! 'C_TEMPLATE' => $Core->get('template'), 'U_USERNAME' => $User->get('user_name') ) ); --- 24,38 ---- define('C_PHPMP_ROOT', './'); ! include_once( C_PHPMP_ROOT . 'core/main.php' ); ! $Portal = new Portal(); global $Template; $Template->assign_vars( array( ! 'C_SITE_NAME' => $Portal->get('site_name'), ! 'C_SITE_ADDRESS' => $Portal->get('site_domain') . $Portal->get('rel_path'), ! 'C_VERSION' => $Portal->get('version'), ! 'C_REL_PATH' => $Portal->get('rel_path'), ! 'C_TEMPLATE' => $Portal->get('template'), 'U_USERNAME' => $User->get('user_name') ) ); |
From: Brian R. <hei...@us...> - 2003-09-14 09:24:29
|
Update of /cvsroot/phpmp/phpMP/language/en In directory sc8-pr-cvs1:/tmp/cvs-serv4793/language/en Modified Files: lang_main.php Log Message: core/core.php has been moved to core/main.php. The Core class has been renamed to Portal. Index: lang_main.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/language/en/lang_main.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** lang_main.php 14 Sep 2003 06:49:57 -0000 1.1 --- lang_main.php 14 Sep 2003 09:24:25 -0000 1.2 *************** *** 23,27 **** */ ! global $Config; $Language->lang = array( --- 23,27 ---- */ ! global $Portal; $Language->lang = array( *************** *** 69,73 **** // Other various parts of the templates. // ! 'POWERED_BY' => 'Powered by phpMP ' . $Config->get('version') . ' © 2003 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.', 'COPYRIGHT' => 'All content is property of its respective owner. All rights reserved.' --- 69,73 ---- // Other various parts of the templates. // ! 'POWERED_BY' => 'Powered by phpMP ' . $Portal->get('version') . ' © 2003 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.', 'COPYRIGHT' => 'All content is property of its respective owner. All rights reserved.' |
From: Cameron C. <nor...@us...> - 2003-09-14 08:11:58
|
Update of /cvsroot/phpmp/phpMP/core/dba In directory sc8-pr-cvs1:/tmp/cvs-serv25065 Modified Files: mysql.php Log Message: uh... its 4:11am need I say more? Index: mysql.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/dba/mysql.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** mysql.php 14 Sep 2003 07:41:48 -0000 1.4 --- mysql.php 14 Sep 2003 08:11:55 -0000 1.5 *************** *** 143,147 **** } ! if( $this->db_row[$db_query_id] = @mysql_fetch_array($query_id)) { return $this->db_row[$db_query_id]; --- 143,147 ---- } ! if( $this->db_row[$db_query_id] = @mysql_fetch_array($db_query_id)) { return $this->db_row[$db_query_id]; *************** *** 151,154 **** --- 151,175 ---- return false; } + } + + // + // sql_fetch_rowset + // + function sql_fetch_rowset($db_query_id = 0) + { + if(! $db_query_id) + { + $db_query_id = $this->db_query_result; + } + + unset($this->db_row[$this->db_query_result]); + unset($this->db_rowset[$this->db_query_result]); + + while($this->db_rowset[$this->db_query_result] = @mysql_fetch_array($db_query_id)) + { + $rowset[] = $this->db_rowset[$db_query_id]; + } + + return $rowset; } } // End of sql_db |
From: Cameron C. <nor...@us...> - 2003-09-14 07:41:51
|
Update of /cvsroot/phpmp/phpMP/core/dba In directory sc8-pr-cvs1:/tmp/cvs-serv21099 Modified Files: mysql.php Log Message: added sql_fetch_row() and made changes to sql_query() Index: mysql.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/dba/mysql.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** mysql.php 14 Sep 2003 07:20:43 -0000 1.3 --- mysql.php 14 Sep 2003 07:41:48 -0000 1.4 *************** *** 27,32 **** var $db_query_result = 0; var $db_query_count = 0; ! var $row = array(); ! var $rowset = array(); // --- 27,32 ---- var $db_query_result = 0; var $db_query_count = 0; ! var $db_row = array(); ! var $db_rowset = array(); // *************** *** 116,119 **** --- 116,121 ---- if( $this->db_query_result) { + unset($this->db_row[$this->db_query_result]); + unset($this->db_rowset[$this->db_query_result]); return $this->db_query_result; } *************** *** 128,131 **** --- 130,153 ---- return false; } + } + } + + // + // sql_fetch_row + // + function sql_fetch_row($db_query_id = 0) + { + if(! $db_query_id) + { + $db_query_id = $this->db_query_result; + } + + if( $this->db_row[$db_query_id] = @mysql_fetch_array($query_id)) + { + return $this->db_row[$db_query_id]; + } + else + { + return false; } } |
From: Cameron C. <nor...@us...> - 2003-09-14 07:20:55
|
Update of /cvsroot/phpmp/phpMP/core/dba In directory sc8-pr-cvs1:/tmp/cvs-serv17872 Modified Files: mysql.php Log Message: changed sql_db::sql_db() a bit... removing something pointless. Index: mysql.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/dba/mysql.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** mysql.php 14 Sep 2003 07:14:47 -0000 1.2 --- mysql.php 14 Sep 2003 07:20:43 -0000 1.3 *************** *** 53,65 **** if(! $this->db_connection_id) { ! if(ERROR_REPORTING == FALSE) ! { ! return false; ! } ! else ! { ! // something like that :D ! die(mysql_error()); ! } } else --- 53,57 ---- if(! $this->db_connection_id) { ! return false; } else |
From: Cameron C. <nor...@us...> - 2003-09-14 07:14:50
|
Update of /cvsroot/phpmp/phpMP/core/dba In directory sc8-pr-cvs1:/tmp/cvs-serv17058 Modified Files: mysql.php Log Message: Index: mysql.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/dba/mysql.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** mysql.php 14 Sep 2003 07:12:13 -0000 1.1 --- mysql.php 14 Sep 2003 07:14:47 -0000 1.2 *************** *** 1,3 **** --- 1,25 ---- <?php + /* + * phpMP - The PHP Modular Portal System + * Copyright (C) 2002-2003 Brian Rose and the phpMP group + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * + */ + class sql_db { |
From: Brian R. <hei...@us...> - 2003-09-14 07:14:11
|
Update of /cvsroot/phpmp/phpMP/core/dba In directory sc8-pr-cvs1:/tmp/cvs-serv16970 Removed Files: mssql.dba mysql.dba Log Message: Removal of old dba files. --- mssql.dba DELETED --- --- mysql.dba DELETED --- |
From: Cameron C. <nor...@us...> - 2003-09-14 07:12:16
|
Update of /cvsroot/phpmp/phpMP/core/dba In directory sc8-pr-cvs1:/tmp/cvs-serv16640 Added Files: mysql.php Log Message: --- NEW FILE: mysql.php --- <?php class sql_db { var $db_connection_id; var $db_query_result = 0; var $db_query_count = 0; var $row = array(); var $rowset = array(); // // CONSTRUCTOR - sql_connect // function sql_db($hostname, $username, $password, $database, $persistant) { $this->hostname = $hostname; $this->username = $username; $this->password = $password; $this->database = $database; $this->persistant = $persistant; if($this->persistant == TRUE) { $this->db_connection_id = @mysql_pconnect($this->hostname, $this->username, $this->password); } else { $this->db_connection_id = @mysql_connect($this->hostname, $this->username, $this->password); } if(! $this->db_connection_id) { if(ERROR_REPORTING == FALSE) { return false; } else { // something like that :D die(mysql_error()); } } else { if(! empty($this->database)) { $dbselect = @mysql_select_db($this->database); if(! $dbselect) { @mysql_close($this->db_connection_id); $this->db_connection_id = $dbselect; } } return $this->db_connection_id; } } // // DESTRUCTOR - sql_close // - based on sql_close from phpBB 2.0.6 // function sql_close($db_connect_id = 0) { if($db_connect_id == 0) { $db_connect_id = $this->db_connection_id; } if($db_connect_id != FALSE) { if($this->db_query_result) { @mysql_free_result($this->db_query_result); } $result = @mysql_close($db_connect_id); return $result; } else { return false; } } // // OTHER BASE METHODS // // // sql_query // function sql_query($query = '', $return_off = TRUE) { unset($this->db_query_result); // remove previous query result if(! empty($query)) { $this->db_query_count++; $this->db_query_result = @mysql_query($query, $this->db_connection_id); } if( $this->db_query_result) { return $this->db_query_result; } else { if($return_off == TRUE) { die(mysql_error()); } else { return false; } } } } // End of sql_db ?> |
From: Brian R. <hei...@us...> - 2003-09-14 07:09:39
|
Update of /cvsroot/phpmp/phpMP/install In directory sc8-pr-cvs1:/tmp/cvs-serv16275/install Added Files: index.php Log Message: Added the install folder. --- NEW FILE: index.php --- |
From: Brian R. <hei...@us...> - 2003-09-14 07:09:19
|
Update of /cvsroot/phpmp/phpMP/install In directory sc8-pr-cvs1:/tmp/cvs-serv16221/install Log Message: Directory /cvsroot/phpmp/phpMP/install added to the repository |
From: Brian R. <hei...@us...> - 2003-09-14 07:02:14
|
Update of /cvsroot/phpmp/phpMP/core In directory sc8-pr-cvs1:/tmp/cvs-serv14633/core Modified Files: core.php debug.php functions.php language.php session.php template.php Removed Files: config.init.php Log Message: Consolidated the Config class into the Core class Index: core.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/core.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** core.php 14 Sep 2003 06:37:52 -0000 1.1 --- core.php 14 Sep 2003 07:02:10 -0000 1.2 *************** *** 26,29 **** --- 26,31 ---- { + var $_cfgvars; + /** * @return arr array *************** *** 74,78 **** // Globalize all major class-containing variables. ! global $Config, $Debug, $DB, $User, $MPCode, $Template; include_once( C_PHPMP_ROOT . 'includes/debug.php' ); --- 76,80 ---- // Globalize all major class-containing variables. ! global $Debug, $DB, $User, $MPCode, $Template; include_once( C_PHPMP_ROOT . 'includes/debug.php' ); *************** *** 91,95 **** include_once(C_PHPMP_ROOT . 'includes/config.init.php'); ! $Config = new Config(); include_once(C_PHPMP_ROOT . 'includes/constants.php'); --- 93,97 ---- include_once(C_PHPMP_ROOT . 'includes/config.init.php'); ! $this->_cfg_start(); include_once(C_PHPMP_ROOT . 'includes/constants.php'); *************** *** 139,142 **** --- 141,198 ---- $Template->set_template( $Config->get('template'), false, true ); $DB->close(); + } + + /** + * @return void + * @desc Fetches Config vars. + */ + function _cfg_start() + { + global $DB; + + $result = $DB->query( "SELECT * FROM " . DB_CONFIG_TABLE ); + + // Loop through all config values from DB. + // Define each key as its respective value. + while( $row = $DB->fetch_array( $result ) ) + { + $this->_cfgvars[$row['config_key']] = $row['config_value']; + } + } + + /** + * @return unknown + * @param cfgkey unknown + * @param cfgval unknown + * @desc Inserts the value of a given key into the Config array. + */ + function cfg_set($cfgkey, $cfgval) + { + if( (!empty($cfgkey)) && (preg_match('/^[a-z][a-z0-9_-]+/', $cfgkey)) && (!empty($cfgval)) ) + { + $this->_cfgvars[$cfgkey] = $cfgval; + return true; + } + else + { + return false; + } + } + + /** + * @return unknown + * @param cfgkey unknown + * @desc Fetches config array values. + */ + function cfg_get($cfgkey) + { + if( !empty($this->_cfgvars[$cfgkey]) ) + { + return $this->_cfgvars[$cfgkey]; + } + else + { + return false; + } } } Index: debug.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/debug.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** debug.php 14 Sep 2003 06:37:52 -0000 1.1 --- debug.php 14 Sep 2003 07:02:10 -0000 1.2 *************** *** 46,50 **** function msg_display($errno, $msg_text, $errfile, $errline) { ! global $DB, $Config, $User, $Template; switch($errno) --- 46,50 ---- function msg_display($errno, $msg_text, $errfile, $errline) { ! global $DB, $Core, $User, $Template; switch($errno) *************** *** 66,70 **** case E_USER_NOTICE: ! echo "A User Notice has been issued. Please notify the <a href=\"mailto: " . $Config['site_contact'] . "\">board administrator</a>."; break; } --- 66,70 ---- case E_USER_NOTICE: ! echo "A User Notice has been issued. Please notify the <a href=\"mailto: " . $Core['site_contact'] . "\">board administrator</a>."; break; } Index: functions.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/functions.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** functions.php 14 Sep 2003 06:37:52 -0000 1.1 --- functions.php 14 Sep 2003 07:02:10 -0000 1.2 *************** *** 29,36 **** function create_vars() { ! global $Config, $User; ! ( $User->get('date_format') != '' ) ? ($Config->set('date_format', $User->get('date_format'))) : ($Config->set('date_format', $Config->get('default_date_format'))); ! $Config->set('time_now', date( $Config->get('date_format') ) ); // This is here...for now. } --- 29,36 ---- function create_vars() { ! global $Core, $User; ! ( $User->get('date_format') != '' ) ? ($Core->set('date_format', $User->get('date_format'))) : ($Core->set('date_format', $Core->get('default_date_format'))); ! $Core->set('time_now', date( $Core->get('date_format') ) ); // This is here...for now. } Index: language.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/language.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** language.php 14 Sep 2003 06:37:52 -0000 1.1 --- language.php 14 Sep 2003 07:02:10 -0000 1.2 *************** *** 33,39 **** function Language() { ! global $Config, $User, $Local; ! $cfg_lang = $Config->get('default_lang'); $usr_lang = $User->get('language'); $lang = ''; --- 33,39 ---- function Language() { ! global $Core, $User, $Local; ! $cfg_lang = $Core->get('default_lang'); $usr_lang = $User->get('language'); $lang = ''; *************** *** 41,45 **** (empty($usr_lang)) ? $lang = $cfg_lang : $lang = $usr_lang; ! $Config->set('language', $lang); $lang_file = C_PHPMP_ROOT . 'languages/' . $lang . '/lang_main.php'; --- 41,45 ---- (empty($usr_lang)) ? $lang = $cfg_lang : $lang = $usr_lang; ! $Core->set('language', $lang); $lang_file = C_PHPMP_ROOT . 'languages/' . $lang . '/lang_main.php'; Index: session.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/session.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** session.php 14 Sep 2003 06:37:52 -0000 1.1 --- session.php 14 Sep 2003 07:02:10 -0000 1.2 *************** *** 57,63 **** function destroy() { ! global $DB, $Config, $SID; ! $exp_time = time() + $Config->get('session_length'); $this->page = basename($_SERVER['REQUEST_URI']); --- 57,63 ---- function destroy() { ! global $DB, $Core, $SID; ! $exp_time = time() + $Core->get('session_length'); $this->page = basename($_SERVER['REQUEST_URI']); *************** *** 74,81 **** $this->session_user_id = ANONYMOUS; ! setcookie($Config->get('cookie_name') . '_auto', '', time() - 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); $cookie_data = urlencode( ANONYMOUS . ':' . $this->session_key ); ! (setcookie($Config->get('cookie_name') . '_data', $cookie_data, $cur_time + $Config->get('session_length'), $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->session_key); } --- 74,81 ---- $this->session_user_id = ANONYMOUS; ! setcookie($Core->get('cookie_name') . '_auto', '', time() - 31536000, $Core->get('cookie_path'), $Core->get('cookie_domain'), $Core->get('cookie_secure')); $cookie_data = urlencode( ANONYMOUS . ':' . $this->session_key ); ! (setcookie($Core->get('cookie_name') . '_data', $cookie_data, $cur_time + $Core->get('session_length'), $Core->get('cookie_path'), $Core->get('cookie_domain'), $Core->get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->session_key); } *************** *** 86,90 **** function login() { ! global $User, $DB, $Config; $this->do_login == true; --- 86,90 ---- function login() { ! global $User, $DB, $Core; $this->do_login == true; *************** *** 116,120 **** { $auto_cookie_data = urlencode( $this->session_user_id . ':' . $passwd_enc . ':' . $User->get('invisible_mode') ); ! setcookie($Config->get('cookie_name') . '_auto', $auto_cookie_data, time() + 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); } } --- 116,120 ---- { $auto_cookie_data = urlencode( $this->session_user_id . ':' . $passwd_enc . ':' . $User->get('invisible_mode') ); ! setcookie($Core->get('cookie_name') . '_auto', $auto_cookie_data, time() + 31536000, $Core->get('cookie_path'), $Core->get('cookie_domain'), $Core->get('cookie_secure')); } } *************** *** 131,135 **** function run() { ! global $User, $DB, $Config, $SID; if( isset($_POST['do_login']) && ($_POST['do_login'] == true) ) --- 131,135 ---- function run() { ! global $User, $DB, $Core, $SID; if( isset($_POST['do_login']) && ($_POST['do_login'] == true) ) *************** *** 149,153 **** $cur_time = time(); // Time as of right now. ! $exp_time = $cur_time + $Config->get('session_length'); // Time at which this session will become invalid. $this->ip = $User->get_ip_encoded(); // Gets the user's IP address. --- 149,153 ---- $cur_time = time(); // Time as of right now. ! $exp_time = $cur_time + $Core->get('session_length'); // Time at which this session will become invalid. $this->ip = $User->get_ip_encoded(); // Gets the user's IP address. *************** *** 219,223 **** $cookie_data = urlencode( $this->session_user_id . ':' . $this->session_key ); ! (setcookie($Config->get('cookie_name') . '_data', $cookie_data, $cur_time + $Config->get('session_length'), $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->session_key); $this->clean(); } --- 219,223 ---- $cookie_data = urlencode( $this->session_user_id . ':' . $this->session_key ); ! (setcookie($Core->get('cookie_name') . '_data', $cookie_data, $cur_time + $Core->get('session_length'), $Core->get('cookie_path'), $Core->get('cookie_domain'), $Core->get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->session_key); $this->clean(); } *************** *** 254,263 **** function get_session_data() { ! global $Config, $DB, $User; // Let's see if we have a standard cookie available. ! if(!empty($_COOKIE[$Config->get('cookie_name') . '_data'])) { ! $cookie_data = $_COOKIE[$Config->get('cookie_name') . '_data']; $cookie_array = explode(':', urldecode( $cookie_data ) ); --- 254,263 ---- function get_session_data() { ! global $Core, $DB, $User; // Let's see if we have a standard cookie available. ! if(!empty($_COOKIE[$Core->get('cookie_name') . '_data'])) { ! $cookie_data = $_COOKIE[$Core->get('cookie_name') . '_data']; $cookie_array = explode(':', urldecode( $cookie_data ) ); *************** *** 284,290 **** if( ($this->session_user_id == ANONYMOUS) || empty($this->session_user_id) ) { ! if( !empty( $_COOKIE[$Config->get('cookie_name') . '_auto'] ) ) // We have an autologin cookie set. { ! $auto_cookie_data = $_COOKIE[$Config->get('cookie_name') . '_auto']; $auto_cookie_array = explode(':', urldecode( $auto_cookie_data ) ); --- 284,290 ---- if( ($this->session_user_id == ANONYMOUS) || empty($this->session_user_id) ) { ! if( !empty( $_COOKIE[$Core->get('cookie_name') . '_auto'] ) ) // We have an autologin cookie set. { ! $auto_cookie_data = $_COOKIE[$Core->get('cookie_name') . '_auto']; $auto_cookie_array = explode(':', urldecode( $auto_cookie_data ) ); *************** *** 306,310 **** { // We'll unset the cookie and continue on like nothing ever happened. ! setcookie($Config->get('cookie_name') . '_auto', '', time() - 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); return false; $this->session_user_id = ANONYMOUS; --- 306,310 ---- { // We'll unset the cookie and continue on like nothing ever happened. ! setcookie($Core->get('cookie_name') . '_auto', '', time() - 31536000, $Core->get('cookie_path'), $Core->get('cookie_domain'), $Core->get('cookie_secure')); return false; $this->session_user_id = ANONYMOUS; Index: template.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/core/template.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** template.php 14 Sep 2003 06:37:52 -0000 1.1 --- template.php 14 Sep 2003 07:02:10 -0000 1.2 *************** *** 119,123 **** function display($handle) { ! global $Config, $Local; if ($filename = $this->_tpl_load($handle)) --- 119,123 ---- function display($handle) { ! global $Core, $Local; if ($filename = $this->_tpl_load($handle)) *************** *** 136,142 **** function _tpl_load(&$handle) { ! global $Config, $user; ! $filename = $this->cachedir . $this->filename[$handle] . '.' . (($this->static_lang) ? $Config->get('language') . '.' : '') . 'php'; // Recompile page if the original template is newer, otherwise load the compiled version --- 136,142 ---- function _tpl_load(&$handle) { ! global $Core, $user; ! $filename = $this->cachedir . $this->filename[$handle] . '.' . (($this->static_lang) ? $Core->get('language') . '.' : '') . 'php'; // Recompile page if the original template is newer, otherwise load the compiled version *************** *** 231,235 **** function _tpl_include($filename, $include = true) { ! global $user, $Config, $Local; $handle = $filename; --- 231,235 ---- function _tpl_include($filename, $include = true) { ! global $user, $Core, $Local; $handle = $filename; *************** *** 257,261 **** function compile($code, $no_echo = false, $echo_var = '') { ! global $Config; error_reporting(E_ERROR | E_WARNING | E_PARSE); --- 257,261 ---- function compile($code, $no_echo = false, $echo_var = '') { ! global $Core; error_reporting(E_ERROR | E_WARNING | E_PARSE); *************** *** 334,338 **** case 'INCLUDEPHP': ! if ($Config->get('tpl_php')) { $temp = ''; --- 334,338 ---- case 'INCLUDEPHP': ! if ($Core->get('tpl_php')) { $temp = ''; *************** *** 343,347 **** case 'PHP': ! if ($Config->get('tpl_php')) { $temp = ''; --- 343,347 ---- case 'PHP': ! if ($Core->get('tpl_php')) { $temp = ''; *************** *** 695,701 **** function compile_write(&$handle, $data) { ! global $user, $Config; ! $filename = $this->cachedir . $this->filename[$handle] . '.' . (($this->static_lang) ? $Config->get('language') . '.' : '') . 'php'; if ($fp = @fopen($filename, 'w+')) --- 695,701 ---- function compile_write(&$handle, $data) { ! global $user, $Core; ! $filename = $this->cachedir . $this->filename[$handle] . '.' . (($this->static_lang) ? $Core->get('language') . '.' : '') . 'php'; if ($fp = @fopen($filename, 'w+')) --- config.init.php DELETED --- |
From: Brian R. <hei...@us...> - 2003-09-14 07:02:13
|
Update of /cvsroot/phpmp/phpMP In directory sc8-pr-cvs1:/tmp/cvs-serv14633 Modified Files: index.php Log Message: Consolidated the Config class into the Core class Index: index.php =================================================================== RCS file: /cvsroot/phpmp/phpMP/index.php,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -r1.48 -r1.49 *** index.php 30 Jun 2003 23:13:47 -0000 1.48 --- index.php 14 Sep 2003 07:02:09 -0000 1.49 *************** *** 30,38 **** $Template->assign_vars( array( ! 'C_SITE_NAME' => $Config->get('site_name'), ! 'C_SITE_ADDRESS' => $Config->get('site_domain') . $Config->get('rel_path'), ! 'C_VERSION' => $Config->get('version'), ! 'C_REL_PATH' => $Config->get('rel_path'), ! 'C_TEMPLATE' => $Config->get('template'), 'U_USERNAME' => $User->get('user_name') ) ); --- 30,38 ---- $Template->assign_vars( array( ! 'C_SITE_NAME' => $Core->get('site_name'), ! 'C_SITE_ADDRESS' => $Core->get('site_domain') . $Core->get('rel_path'), ! 'C_VERSION' => $Core->get('version'), ! 'C_REL_PATH' => $Core->get('rel_path'), ! 'C_TEMPLATE' => $Core->get('template'), 'U_USERNAME' => $User->get('user_name') ) ); |
From: Brian R. <hei...@us...> - 2003-09-14 06:52:30
|
Update of /cvsroot/phpmp/phpMP/docs/sql In directory sc8-pr-cvs1:/tmp/cvs-serv12707/docs/sql Added Files: mysql_default_vals.sql mysql_structure.sql Log Message: Moving the sql dir. --- NEW FILE: mysql_default_vals.sql --- # phpMyAdmin MySQL-Dump # version 2.5.0-rc1 # http://www.phpmyadmin.net/ (download page) # # Host: localhost # Generation Time: Apr 23, 2003 at 01:14 AM # Server version: 4.0.12 # PHP Version: 4.3.0 # Database : `phpmp` # -------------------------------------------------------- # # Dumping data for table `phpmp_config` # INSERT INTO `phpmp_config` VALUES ('site_domain', 'http://localhost'); INSERT INTO `phpmp_config` VALUES ('rel_path', '/phpMP/'); INSERT INTO `phpmp_config` VALUES ('default_tpl', ''); INSERT INTO `phpmp_config` VALUES ('override_usr_tpl', '0'); INSERT INTO `phpmp_config` VALUES ('site_name', 'phpMP'); INSERT INTO `phpmp_config` VALUES ('default_lang', 'english'); INSERT INTO `phpmp_config` VALUES ('default_date_format', 'M j, Y h:ia T'); INSERT INTO `phpmp_config` VALUES ('enable_account_activation', '0'); INSERT INTO `phpmp_config` VALUES ('system_timezone', '-5'); INSERT INTO `phpmp_config` VALUES ('version', '0.1a'); INSERT INTO `phpmp_config` VALUES ('cookie_name', 'phpmp_cookie'); INSERT INTO `phpmp_config` VALUES ('cookie_domain', ''); INSERT INTO `phpmp_config` VALUES ('cookie_path', ''); INSERT INTO `phpmp_config` VALUES ('cookie_secure', '0'); INSERT INTO `phpmp_config` VALUES ('session_length', '3600'); # -------------------------------------------------------- # # Dumping data for table `phpmp_users` # INSERT INTO `phpmp_users` VALUES (1, 'Anonymous', '', 1, '', '', 0, '', '', '', ''); --- NEW FILE: mysql_structure.sql --- # phpMyAdmin MySQL-Dump # version 2.5.0-rc1 # http://www.phpmyadmin.net/ (download page) # # Host: localhost # Generation Time: Apr 23, 2003 at 01:14 AM # Server version: 4.0.12 # PHP Version: 4.3.0 # Database : `phpmp` # -------------------------------------------------------- # # Table structure for table `phpmp_config` # # Creation: Apr 22, 2003 at 08:46 AM # Last update: Apr 22, 2003 at 11:54 PM # CREATE TABLE `phpmp_config` ( `config_key` varchar(255) NOT NULL default '', `config_value` varchar(255) NOT NULL default '', PRIMARY KEY (`config_key`) ) TYPE=MyISAM; # # Table structure for table `phpmp_sessions` # # Creation: Apr 22, 2003 at 05:34 PM # Last update: Apr 23, 2003 at 01:11 AM # CREATE TABLE `phpmp_sessions` ( `session_key` varchar(32) NOT NULL default '', `session_user_id` mediumint(8) NOT NULL default '0', `session_start_time` int(10) NOT NULL default '0', `session_exp_time` int(10) NOT NULL default '0', `session_page` varchar(50) NOT NULL default '', `session_ip` varchar(8) NOT NULL default '', PRIMARY KEY (`session_key`) ) TYPE=Heap; # # Table structure for table `phpmp_users` # # Creation: Apr 23, 2003 at 12:34 AM # Last update: Apr 23, 2003 at 12:37 AM # CREATE TABLE `phpmp_users` ( `user_id` mediumint(8) NOT NULL auto_increment, `user_name` varchar(24) NOT NULL default '', `user_passwd` varchar(32) NOT NULL default '', `active` tinyint(1) NOT NULL default '0', `email` varchar(255) NOT NULL default '', `actkey` varchar(32) NOT NULL default '', `auth_level` tinyint(1) NOT NULL default '0', `language` varchar(32) NOT NULL default '', `date_format` varchar(32) NOT NULL default '', `template` varchar(32) NOT NULL default '', `signature` varchar(255) NOT NULL default '', PRIMARY KEY (`user_id`) ) TYPE=MyISAM AUTO_INCREMENT=3 ; |
From: Brian R. <hei...@us...> - 2003-09-14 06:52:30
|
Update of /cvsroot/phpmp/phpMP/core/dba/sql In directory sc8-pr-cvs1:/tmp/cvs-serv12707/core/dba/sql Removed Files: mysql_default_vals.sql mysql_structure.sql Log Message: Moving the sql dir. --- mysql_default_vals.sql DELETED --- --- mysql_structure.sql DELETED --- |
From: Brian R. <hei...@us...> - 2003-09-14 06:52:03
|
Update of /cvsroot/phpmp/phpMP/docs/sql In directory sc8-pr-cvs1:/tmp/cvs-serv12603/sql Log Message: Directory /cvsroot/phpmp/phpMP/docs/sql added to the repository |
From: Brian R. <hei...@us...> - 2003-09-14 06:50:01
|
Update of /cvsroot/phpmp/phpMP/languages/spanish In directory sc8-pr-cvs1:/tmp/cvs-serv12142/languages/spanish Removed Files: lang_main.php Log Message: Switching folder names (by one letter). --- lang_main.php DELETED --- |
From: Brian R. <hei...@us...> - 2003-09-14 06:50:01
|
Update of /cvsroot/phpmp/phpMP/languages/french In directory sc8-pr-cvs1:/tmp/cvs-serv12142/languages/french Removed Files: lang_main.php Log Message: Switching folder names (by one letter). --- lang_main.php DELETED --- |
From: Brian R. <hei...@us...> - 2003-09-14 06:50:01
|
Update of /cvsroot/phpmp/phpMP/languages/english In directory sc8-pr-cvs1:/tmp/cvs-serv12142/languages/english Removed Files: index.html lang_main.php Log Message: Switching folder names (by one letter). --- index.html DELETED --- --- lang_main.php DELETED --- |
From: Brian R. <hei...@us...> - 2003-09-14 06:50:01
|
Update of /cvsroot/phpmp/phpMP/languages In directory sc8-pr-cvs1:/tmp/cvs-serv12142/languages Removed Files: index.html Log Message: Switching folder names (by one letter). --- index.html DELETED --- |
From: Brian R. <hei...@us...> - 2003-09-14 06:50:01
|
Update of /cvsroot/phpmp/phpMP/language/en In directory sc8-pr-cvs1:/tmp/cvs-serv12142/language/en Added Files: index.html lang_main.php Log Message: Switching folder names (by one letter). --- NEW FILE: index.html --- <html> <head> <title>Sorry...</title> </head> <body> This directory is not directly accessible. </body> </html> --- NEW FILE: lang_main.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: lang_main.php,v 1.1 2003/09/14 06:49:57 heimidal Exp $ * */ global $Config; $Language->lang = array( // // General language used throughout site. // // Note: Always escape single quote characters (') with a backslash (\). // 'WELCOME_TO' => 'Welcome to ', 'HOME' => 'Home', 'PROFILE' => 'Profile', 'MODULES' => 'Modules', 'DOWNLOADS' => 'Downloads', 'USERNAME' => 'Username', 'USER_CP' => 'User CP', 'USER_CONTROL_PANEL' => 'User Control Panel', 'E_MAIL' => 'E-mail', 'PASSWORD' => 'Password', 'CONFIRM' => 'Confirm', 'REAL_NAME' => 'Real Name', 'LOCATION' => 'Location', 'REGISTER' => 'Register', 'MAIN_MENU' => 'Main Menu', 'USER_SETTINGS' => 'User Settings', 'ADMINISTRATION AREA' => 'Administration Area', 'REGISTER_A_USERNAME' => 'Register a Username', // // Below is language used almost specifically for auth. // 'LOGIN' => 'Login', 'LOGOUT' => 'Logout', 'ACCOUNT_ACTIVATED' => 'Your account has been activated. You may now log in.', 'REQUIRED_FIELD' => 'Denotes a Required Field', 'REGISTER_FINISHED' => 'Your registration has been processed. Please check your e-mail for a message explaining how to activate your new account.', 'FORGOT_PASSWORD' => 'Forgot Your Password?', 'NOT_LOGGED_IN' => 'You are not logged in.', // // Other various parts of the templates. // 'POWERED_BY' => 'Powered by phpMP ' . $Config->get('version') . ' © 2003 <a href="http://phpmp.sourceforge.net/">phpMP Dev. Group</a>.', 'COPYRIGHT' => 'All content is property of its respective owner. All rights reserved.' // It is IMPERATIVE that the last array value entered (usually the copyright) // does not end in a comma. ); ?> |
From: Brian R. <hei...@us...> - 2003-09-14 06:50:00
|
Update of /cvsroot/phpmp/phpMP/language In directory sc8-pr-cvs1:/tmp/cvs-serv12142/language Added Files: index.html Log Message: Switching folder names (by one letter). --- NEW FILE: index.html --- <html> <head> <title>Sorry...</title> </head> <body> This directory is not directly accessible. </body> </html> |
From: Brian R. <hei...@us...> - 2003-09-14 06:49:34
|
Update of /cvsroot/phpmp/phpMP/language/en In directory sc8-pr-cvs1:/tmp/cvs-serv12065/en Log Message: Directory /cvsroot/phpmp/phpMP/language/en added to the repository |
From: Brian R. <hei...@us...> - 2003-09-14 06:49:08
|
Update of /cvsroot/phpmp/phpMP/language In directory sc8-pr-cvs1:/tmp/cvs-serv11972/language Log Message: Directory /cvsroot/phpmp/phpMP/language added to the repository |
From: Brian R. <hei...@us...> - 2003-09-14 06:37:58
|
Update of /cvsroot/phpmp/phpMP/core In directory sc8-pr-cvs1:/tmp/cvs-serv9778/core Added Files: admin.php config.init.php constants.php core.php debug.php functions.php index.html language.php mpcode.php mpcode_arrays.php session.php template.php user.php Log Message: This should be fun. --- NEW FILE: admin.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: admin.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ class Admin { var $p_action; // Action desired by the user // Executes the given admin action // Author: Anthony White // Accepts: $action - actions as defined above, used in switch / case // Returns: none. function execute($action) { $this->p_action = $action; switch ($action) { case C_ACTION_SITE: $this->_show_site(); break; case C_ACTION_USER: $this->_show_user(); break; default: break; } } // Shows the general management form // Author: Anthony White // Accepts: none. // Returns: none. function _show_site() { // Print out a form for the user print "<form method=\"post\" action=\"main.php?parse=" . $this->p_action . "\">"; print "Site Name: <input type=\"text\" name=\"sname\" value=\"" . C_SITE_NAME . "\"><br>"; if (C_OVERRIDE_USR_TPL == 1) { $checked = "CHECKED"; } else { $checked = ""; } print "Default Template: <input type=\"text\" name=\"deftpl\" value=\"" . C_DEFAULT_TPL . "\">"; print " <input type=\"checkbox\" name=\"ovrtpl\" value=\"0\" " . $checked . "> Override User Template?<br>"; print "Default Language: <input type=\"text\" name=\"deflang\" value=\"" . C_DEFAULT_LANG . "\"> (french, english)<br>"; // Should / Will be a dropdown list print "Default Date Format: <input type=\"text\" name=\"defdate\" value=\"" . C_DEFAULT_DATE_FORMAT . "\"> (Example: " . date(C_DEFAULT_DATE_FORMAT) . ") [Same syntax as the PHP date function]<br>"; print "Account Activation Level: "; print "<select name=\"accact\">"; if (C_ENABLE_ACCOUNT_ACTIVATION == 0) { $sel0 = "SELECTED"; } if (C_ENABLE_ACCOUNT_ACTIVATION == 1) { $sel1 = "SELECTED"; } if (C_ENABLE_ACCOUNT_ACTIVATION == 2) { $sel2 = "SELECTED"; } print "<option value=\"0\" " . $sel0 . ">No Activation"; print "<option value=\"1\" " . $sel1 . ">User Activation"; print "<option value=\"2\" " . $sel2 . ">Admin Activation"; print "</select><br>"; print "System Timezone: "; print "<select name=\"systime\">"; print "<option value=\"" . GMT_MINUS_12 . "\">GMT -12 (International Dateline West)"; print "<option value=\"" . GMT_MINUS_11 . "\">GMT -11 (Midway Island, Simoa)"; print "<option value=\"" . GMT_MINUS_10 . "\">GMT -10 (Hawaii)"; print "<option value=\"" . GMT_MINUS_9 . "\">GMT -9 (Alaska)"; print "<option value=\"" . GMT_MINUS_8 . "\">GMT -8 (Pacific Time)"; print "<option value=\"" . GMT_MINUS_7 . "\">GMT -7 (Arizona, Mountain Time)"; print "<option value=\"" . GMT_MINUS_6 . "\">GMT -6 (Central Time)"; print "<option value=\"" . GMT_MINUS_5 . "\">GMT -5 (Eastern Time)"; print "<option value=\"" . GMT_MINUS_4 . "\">GMT -4 (Atlantic Time)"; print "<option value=\"" . GMT_MINUS_3_30 . "\">GMT -3.5 (Newfoundland)"; print "<option value=\"" . GMT_MINUS_3 . "\">GMT -3 (Greenland)"; print "<option value=\"" . GMT_MINUS_2 . "\">GMT -2 (Mid-Atlantic)"; print "<option value=\"" . GMT_MINUS_1 . "\">GMT -1 (Cape Verda Islands)"; print "<option value=\"" . GMT . "\">GMT (Greenwich Mean Time)"; print "<option value=\"" . GMT_PLUS_1 . "\">GMT +1 (Paris)"; print "<option value=\"" . GMT_PLUS_2 . "\">GMT +2 (Jerusalem)"; print "<option value=\"" . GMT_PLUS_3 . "\">GMT +3 (Moscow)"; print "<option value=\"" . GMT_PLUS_4 . "\">GMT +4 (Abu Dhabi)"; print "<option value=\"" . GMT_PLUS_4_30 . "\">GMT +4.5 (Kabul)"; print "<option value=\"" . GMT_PLUS_5 . "\">GMT +5 (Karachi)"; print "<option value=\"" . GMT_PLUS_5_30 . "\">GMT +5.5 (New Delhi)"; print "<option value=\"" . GMT_PLUS_5_45 . "\">GMT +5.75 (Kathmandu)"; print "<option value=\"" . GMT_PLUS_6 . "\">GMT +6 (Almaty)"; print "<option value=\"" . GMT_PLUS_6_30 . "\">GMT +6.5 (Rangoon)"; print "<option value=\"" . GMT_PLUS_7 . "\">GMT +7 (Bangkok)"; print "<option value=\"" . GMT_PLUS_8 . "\">GMT +8 (Beijing)"; print "<option value=\"" . GMT_PLUS_9 . "\">GMT +9 (Tokyo)"; print "<option value=\"" . GMT_PLUS_9_30 . "\">GMT +9.5 (Adelaide)"; print "<option value=\"" . GMT_PLUS_10 . "\">GMT +10 (Brisbane)"; print "<option value=\"" . GMT_PLUS_11 . "\">GMT +11 (Solomon Islands)"; print "<option value=\"" . GMT_PLUS_12 . "\">GMT +12 (Auckland)"; print "<option value=\"" . GMT_PLUS_13 . "\">GMT +13 (Nuku'alofa)"; print "</select> (Current: " . C_SYSTEM_TIMEZONE . ")<br>"; if (C_USE_PORTAL_PERMS == 1) { $checked = "CHECKED"; } else { $checked = ""; } print "<input type=\"checkbox\" name=\"portperms\" value=\"1\" " . $checked . "> Use Portal Permissions?<br>"; print "<input type=\"submit\" name=\"submit_general\" value=\"Submit Configuration\">"; print "</form>"; } // Parses the general management form // Author: Anthony White // Accepts: Form values from the site config form // Returns: none. function parse_site($sname, $ovrtpl, $deftpl, $deflang, $defdate, $accact, $systime, $portperms) { include_once( C_PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); $DB = new DB; if ($ovrtpl != 1) { $ovrtpl = 0; } if ($portperms != 1) { $portperms = 0; } // We now go through each config_value and update it accordingly // I dont know if this is the only way, but it works fine for me $DB->query("UPDATE " . DB_CONFIG_TABLE . " SET config_value='" . $sname . "' WHERE config_key='site_name'"); $DB->query("UPDATE " . DB_CONFIG_TABLE . " SET config_value='" . $ovrtpl . "' WHERE config_key='override_usr_tpl'"); $DB->query("UPDATE " . DB_CONFIG_TABLE . " SET config_value='" . $deftpl . "' WHERE config_key='default_tpl'"); $DB->query("UPDATE " . DB_CONFIG_TABLE . " SET config_value='" . $deflang . "' WHERE config_key='default_lang'"); $DB->query("UPDATE " . DB_CONFIG_TABLE . " SET config_value='" . $defdate . "' WHERE config_key='default_date_format'"); $DB->query("UPDATE " . DB_CONFIG_TABLE . " SET config_value='" . $accact . "' WHERE config_key='enable_account_activation'"); $DB->query("UPDATE " . DB_CONFIG_TABLE . " SET config_value='" . $systime . "' WHERE config_key='system_timezone'"); $DB->query("UPDATE " . DB_CONFIG_TABLE . " SET config_value='" . $portperms . "' WHERE config_key='use_portal_perms'"); } // Shows the user selection form // Author: Anthony White // Accepts: none. // Returns: none. function _show_user() { include_once( C_PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); $DB = new DB; print "<form method=\"post\" action=\"main.php?parse=" . $this->p_action . "\">"; print "Select user to edit: <select name=\"userid\">"; $query = $DB->query("SELECT * FROM " . DB_USERS_TABLE); while ($user = $DB->fetchArray($query)) { if ($user[userid] != 1) { print "<option value=\"" . $user[userid] . "\">" . $user[username]; } } print "</select><br>"; print "<input type=\"submit\" name=\"submit_user\" value=\"Edit User\">"; print "</form>"; } // Shows user management form // Author: Anthony White // Accepts: none. // Returns: none. function show_user($userid) { if (!$userid || $userid == 1) { print "Invalid User"; return; } include_once( C_PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); $DB = new DB; $query = $DB->query("SELECT * FROM " . DB_USERS_TABLE . " WHERE userid=" . $userid); $user = $DB->fetchArray($query); // Print out the form for management print "<form method=\"post\" action=\"main.php?parse=" . ($this->p_action + 1) . "\">"; print "Username: <input type=\"text\" name=\"username\" value=\"" . $user[username] . "\"><br>"; print "Password: <input type=\"password\" name=\"passwd\"> (Leave blank to not change)<br>"; print "Email: <input type=\"email\" name=\"email\" value=\"" . $user[email] . "\"><br>"; print "Authentication Level: <select name=\"auth_level\">"; switch ($user[auth_level]) { case AUTH_LVL_MEM: $sel1 = "SELECTED"; break; case AUTH_LVL_CONTRIB: $sel2 = "SELECTED"; break; case AUTH_LVL_MOD: $sel3 = "SELECTED"; break; case AUTH_LVL_ADMIN: $sel4 = "SELECTED"; break; default: break; } print "<option value=\"1\" " . $sel1 . ">Standard Member"; print "<option value=\"2\" " . $sel2 . ">Contributor"; print "<option value=\"3\" " . $sel3 . ">Moderator"; print "<option value=\"4\" " . $sel4 . ">Administrator"; print "</select><br>"; print "Date Format: <input type=\"text\" name=\"date_format\" value=\"" . $user[date_format] . "\"><br>"; print "Template: <input type=\"text\" name=\"template\" value=\"" . $user[template] . "\"><br>"; print "Signature:<br>"; print "<textarea name=\"signature\" rows=\"5\" cols=\"40\">" . $user[signature] . "</textarea><br>"; print "<input type=\"checkbox\" name=\"delete\" value=\"delete\"> Delete User? (WARNING: This deletes the user for good)<br>"; print "<input type=\"submit\" name=\"submit_user_parse\" value=\"Submit User Changes\">"; print "<input type=\"hidden\" name=\"userid\" value=\"" . $user[userid] . "\">"; print "</form>"; } // Parse the user management form // Author: Anthony White // Accepts: The form variables // Returns: none. function parse_user($userid, $username, $passwd, $email, $auth_level, $date_format, $template, $signature, $delete) { include_once( C_PHPMP_ROOT . 'dba/' . DB_TYPE . '.dba' ); $DB = new DB; if ($delete == "delete") { $DB->query("DELETE FROM " . DB_USERS_TABLE . " WHERE userid='" . $userid . "'"); return; } if ($passwd != "") { $DB->query("UPDATE " . DB_USERS_TABLE . " SET passwd='" . $passwd . "' WHERE userid='" . $userid . "'"); } $DB->query("UPDATE " . DB_USERS_TABLE . " SET username='" . $username . "', email='" . $email . "', auth_level='" . $auth_level . "', date_format='" . $date_format . "', template='" . $template . "', signature='" . $signature . "' WHERE userid='" . $userid . "'"); } } ?> --- NEW FILE: config.init.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: config.init.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ class Config { var $_cfgvars; /** * @return void * @desc Fetches Config vars. */ function Config() { global $DB; $result = $DB->query( "SELECT * FROM " . DB_CONFIG_TABLE ); // Loop through all config values from DB. // Define each key as its respective value. while( $row = $DB->fetch_array( $result ) ) { $this->_cfgvars[$row['config_key']] = $row['config_value']; } } /** * @return unknown * @param cfgkey unknown * @param cfgval unknown * @desc Inserts the value of a given key into the Config array. */ function set($cfgkey, $cfgval) { if( (!empty($cfgkey)) && (preg_match('/^[a-z][a-z0-9_-]+/', $cfgkey)) && (!empty($cfgval)) ) { $this->_cfgvars[$cfgkey] = $cfgval; return true; } else { return false; } } /** * @return unknown * @param cfgkey unknown * @desc Fetches config array values. */ function get($cfgkey) { if( !empty($this->_cfgvars[$cfgkey]) ) { return $this->_cfgvars[$cfgkey]; } else { return false; } } } ?> --- NEW FILE: constants.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: constants.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ define('ACTIVATE_DISABLED', 0); define('ACTIVATE_USER', 1); define('ACTIVATE_ADMIN', 2); define('ANONYMOUS', 1); define('AUTH_LVL_GUEST', 0); // Guest. define('AUTH_LVL_MEM', 1); // Standard Member define('AUTH_LVL_CONTRIB', 2); // Contributor define('AUTH_LVL_MOD', 3); // Moderator define('AUTH_LVL_ADMIN', 4); // Administrator define('SESS_LOC_COOKIE', 1); //Sessions stored in cookie. define('SESS_LOC_URL', 2); //Sessions stored in URL. // Timezones according to Windows. Probably wrong, but hey.. define('GMT_MINUS_12', -12); // International Date Line West. define('GMT_MINUS_11', -11); // Midway Island, Simoa. define('GMT_MINUS_10', -10); // Hawaii. define('GMT_MINUS_9', -9); // Alaska. define('GMT_MINUS_8', -8); // Pacific Time. define('GMT_MINUS_7', -7); // Arizona, Mountain Time. define('GMT_MINUS_6', -6); // Central Time. define('GMT_MINUS_5', -5); // Eastern Time. define('GMT_MINUS_4', -4); // Atlantic Time. define('GMT_MINUS_3_30', -3.5); // Newfoundland. define('GMT_MINUS_3', -3); // Greenland. define('GMT_MINUS_2', -2); // Mid-Atlantic. define('GMT_MINUS_1', -1); // Cape Verda Is. define('GMT', 0); // Greenwich Mean Time. define('GMT_PLUS_1', 1); // Paris. define('GMT_PLUS_2', 2); // Jerusalem. define('GMT_PLUS_3', 3); // Moscow. define('GMT_PLUS_4', 4); // Abu Dhabi. define('GMT_PLUS_4_30', 4.5); // Kabul. define('GMT_PLUS_5', 5); // Karachi. define('GMT_PLUS_5_30', 5.5); // New Delhi. define('GMT_PLUS_6', 6); // Almaty. define('GMT_PLUS_6_30', 6.5); // Rangoon. define('GMT_PLUS_7', 7); // Bangkok. define('GMT_PLUS_8', 8); // Beijing. define('GMT_PLUS_9', 9); // Tokyo. define('GMT_PLUS_19_30', 9.5); // Adelaide. define('GMT_PLUS_10', 10); // Brisbane. define('GMT_PLUS_11', 11); // Solomon Is. define('GMT_PLUS_12', 12); // Auckland. define('GMT_PLUS_13', 13); // Nuku'alofa. define('DEBUG_ON', 1); //define('DEBUG_ON', 0); ?> --- NEW FILE: core.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: core.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ class Core // Does, literally, everything. { /** * @return arr array * @param arr array * @desc Strips magic quotes from the * superglobal arrays. */ function strip_magic_quotes($arr) { foreach ($arr as $k => $v) { if (is_array($v)) { $arr[$k] = strip_magic_quotes($v); } else { $arr[$k] = stripslashes($v); } } return $arr; } /** * @return void * @param optional_files array * @desc Initiates all core components. */ function Core( $optional_files = array() ) { // The following code ensures that, no matter what, the dreaded // magic_quotes function will *never* mess with our data. // The addslashes() function *should* be used when necessary. // The stripslashes() function is worthless with these fixes in place. set_magic_quotes_runtime(0); if (get_magic_quotes_gpc()) { if (!empty($_GET)) { $_GET = $this->strip_magic_quotes($_GET); } if (!empty($_POST)) { $_POST = $this->strip_magic_quotes($_POST); } if (!empty($_COOKIE)) { $_COOKIE = $this->strip_magic_quotes($_COOKIE); } } error_reporting(E_ALL); //error_reporting(E_ERROR | E_WARNING | E_PARSE); $blah = include_once( C_PHPMP_ROOT . 'config.php' ); // Globalize all major class-containing variables. global $Config, $Debug, $DB, $User, $MPCode, $Template; include_once( C_PHPMP_ROOT . 'includes/debug.php' ); $Debug = new Debug(); include_once( C_PHPMP_ROOT . 'includes/dba/' . DB_TYPE . '.dba' ); $DB = new DB(); $DB->connect(); define('DB_CONFIG_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'config'); define('DB_USERS_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'users'); define('DB_SESSIONS_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'sessions'); define('DB_MODULES_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'modules'); define('DB_BLOCK_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'blocks'); define('DB_TEMPLATE_VARS_TABLE', DB_NAME . '.' . DB_TABLE_PREFIX . 'template_vars'); include_once(C_PHPMP_ROOT . 'includes/config.init.php'); $Config = new Config(); include_once(C_PHPMP_ROOT . 'includes/constants.php'); include_once(C_PHPMP_ROOT . 'includes/functions.php'); include_once(C_PHPMP_ROOT . 'includes/user.php'); $User = new User(); // Create an instance of User. create_vars(); include_once(C_PHPMP_ROOT . 'includes/session.php'); $Session = new Session(); $Session->start(); $Session->run(); include_once(C_PHPMP_ROOT . 'includes/language.php'); $Language = new Language(); include_once(C_PHPMP_ROOT . 'includes/mpcode.php'); // This while() statement will loop through the // $optional_files and include each file. if(count($optional_files) > 0) { $i = 0; while( $my_file = $optional_files[$i] ) { include_once(C_PHPMP_ROOT . 'includes/' . $my_file . '.php'); $i++; } } include_once(C_PHPMP_ROOT . 'includes/template.php'); $Template = new Template(); if( $User->get('template') == false ) { $Config->set('template', $Config->get('default_tpl')); } else { $Config->set('template', $User->get('template')); } $Template->set_template( $Config->get('template'), false, true ); $DB->close(); } } ?> --- NEW FILE: debug.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: debug.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ class Debug { /** * @return void * @desc Sets the error handler. */ function Debug() { @set_error_handler( array(&$this, 'msg_display') ); } /** * @return void * @param errno int * @param msg_text string * @param errfile string * @param errline int * @desc Error/message handler. Taken from phpBB2. I still don't quite understand it. :P */ function msg_display($errno, $msg_text, $errfile, $errline) { global $DB, $Config, $User, $Template; switch($errno) { case E_WARNING: break; case E_NOTICE: echo "PHP Notice on line <b>$errline</b> in <b>$errfile</b> :: <b>$msg_text</b><br />"; break; case E_USER_ERROR: if(isset($DB)) { $DB->close(); echo $msg_text; } break; case E_USER_NOTICE: echo "A User Notice has been issued. Please notify the <a href=\"mailto: " . $Config['site_contact'] . "\">board administrator</a>."; break; } } } ?> --- NEW FILE: functions.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: functions.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ /** * @return void * @desc Creates vars with no other place. Temporary. */ function create_vars() { global $Config, $User; ( $User->get('date_format') != '' ) ? ($Config->set('date_format', $User->get('date_format'))) : ($Config->set('date_format', $Config->get('default_date_format'))); $Config->set('time_now', date( $Config->get('date_format') ) ); // This is here...for now. } ?> --- NEW FILE: index.html --- <html> <head> <title>Sorry...</title> </head> <body> This directory is not directly accessible. </body> </html> --- NEW FILE: language.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: language.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ class Language { /** * @return void * @desc Discovers the user's language and creates the corresponding Local object. */ function Language() { global $Config, $User, $Local; $cfg_lang = $Config->get('default_lang'); $usr_lang = $User->get('language'); $lang = ''; (empty($usr_lang)) ? $lang = $cfg_lang : $lang = $usr_lang; $Config->set('language', $lang); $lang_file = C_PHPMP_ROOT . 'languages/' . $lang . '/lang_main.php'; if (!file_exists($lang_file)) { trigger_error("localization error - \"$lang_file\" does not exist.", E_USER_ERROR); } include_once( $lang_file ); } } ?> --- NEW FILE: mpcode.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: mpcode.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ // Content parsing functions to be developed here. // These work similarly to BBCode and the like. // Work here done by anthony. If you dont like it feel free to change it. // Deprecated. class mpcode { function parse_string($string) { if ($string == "") return; $split = explode(" ", $string); foreach ($split as $key => $code) { if ($key == count($split) - 1) $final .= $this->_replace($code); else $final .= $this->_replace($code) . " "; } return $final; } // This may not be the best way, but it works function _replace($string) { include (C_PHPMP_ROOT . "includes/mpcode_arrays.php"); foreach ($mpcode as $key => $code) { $string = str_replace($code, $html[$key], $string); } return $string; } } ?> --- NEW FILE: mpcode_arrays.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: mpcode_arrays.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ // Contains the mpcode and corresponding html arrays // Deprecated. $mpcode = array( "[b]", "[/b]", "[i]", "[/i]" ); $html = array( "<b>", "</b>", "<i>", "</i>" ); ?> --- NEW FILE: session.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: session.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ class Session // Creates and maintains sessions for all users. { var $started = false; var $session_data; var $session_key; var $do_login = false; var $is_logged_in = false; var $session_key_new = false; var $session_user_id; var $ip; var $page; /** * @return void * @desc Starts a session. Must be called implicitly. */ function start() { // We'll only start a session if // one hasn't already been started. if($this->started == false) { $this->get_session_data(); $this->started = true; } } /** * @return void * @desc Destroys sessions. Used for logging out. */ function destroy() { global $DB, $Config, $SID; $exp_time = time() + $Config->get('session_length'); $this->page = basename($_SERVER['REQUEST_URI']); // Sets the session as owned by an anonymous user. // Since there's no reason to use a different session key, we'll keep that. $sql = "UPDATE " . DB_SESSIONS_TABLE . " SET session_exp_time=" . $exp_time . " AND session_page='" . $this->page . "' AND session_user_id=" . ANONYMOUS . " WHERE session_key='" . $this->session_key . "'"; $DB->query($sql); $this->session_user_id = ANONYMOUS; setcookie($Config->get('cookie_name') . '_auto', '', time() - 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); $cookie_data = urlencode( ANONYMOUS . ':' . $this->session_key ); (setcookie($Config->get('cookie_name') . '_data', $cookie_data, $cur_time + $Config->get('session_length'), $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->session_key); } /** * @return void * @desc Logs a user in. */ function login() { global $User, $DB, $Config; $this->do_login == true; // We are logging in. Set up variables. $username = addslashes($_POST['login_username']); $passwd_enc = md5($_POST['login_passwd']); $auto_login_set = $_POST['autologin']; $invisible_mode = $_POST['invisible_mode']; $sql = "SELECT * FROM " . DB_USERS_TABLE . " WHERE user_name='" . $username . "' AND user_passwd='" . $passwd_enc . "'"; $result = $DB->query($sql); $num_rows = $DB->num_rows($result); if( $num_rows == 1 ) // We have a user! { $User->set( $DB->fetch_assoc($result) ); $this->session_user_id = $User->get('user_id'); $this->is_logged_in = true; // We'll look into the invisible mode setting and ensure the user's wishes are met. ($invisible_mode == true) ? ( $User->set('invisible_mode', 1) ) : ( $User->set('invisible_mode', 0) ); // We'll set up an autologin cookie if the user wants us to. if( $auto_login_set == true ) { $auto_cookie_data = urlencode( $this->session_user_id . ':' . $passwd_enc . ':' . $User->get('invisible_mode') ); setcookie($Config->get('cookie_name') . '_auto', $auto_cookie_data, time() + 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); } } else // Wrong login information. { die('Sorry. Your username and/or password are incorrect.'); } } /** * @return void * @desc Saves the session data to the database. */ function run() { global $User, $DB, $Config, $SID; if( isset($_POST['do_login']) && ($_POST['do_login'] == true) ) { $this->login(); } // Checks to see if a session has been started. // If not, we'll die because we want to explicitly declare sessions. if( $this->started == false ) { die('You must explicitly declare all $Session->start calls.'); } // Capture the page we're at. //$this->page = basename($_SERVER['REQUEST_URI']); $cur_time = time(); // Time as of right now. $exp_time = $cur_time + $Config->get('session_length'); // Time at which this session will become invalid. $this->ip = $User->get_ip_encoded(); // Gets the user's IP address. $session_exists = false; // We'll assume that no sessions exist yet. // If the ID is new, why bother querying to test for an old one? if( $this->session_key_new == false ) { // Gathers session data from the database. $sql = "SELECT * FROM " . DB_SESSIONS_TABLE . " WHERE session_key='" . $this->session_key . "' ORDER BY session_exp_time DESC"; $result = $DB->query($sql); $num_rows = $DB->num_rows($result); // Checks for a session in the database. ($num_rows >= 1) ? ($session_exists = true) : ($session_exists = false); // If the session is expired, we'll go ahead and create a new one regardless. // The old one *should* be cleaned out by our clean() function later. $this->session_data = $DB->fetch_assoc($result); if( $this->session_data['session_exp_time'] < $cur_time ) { $session_exists = false; } $this->session_user_id = $this->session_data['session_user_id']; } if( $session_exists == true ) // A session exists. Yay. { if( $this->is_logged_in == true ) // Swap out the anonymous user for our new user_id. { $sql = "UPDATE " . DB_SESSIONS_TABLE . " SET session_exp_time=" . $exp_time . ", session_page='" . addslashes($this->page) . "', session_user_id=" . $this->session_user_id . " WHERE session_key='" . $this->session_key . "'"; } else { $sql = "UPDATE " . DB_SESSIONS_TABLE . " SET session_exp_time=" . $exp_time . ", session_page='" . addslashes($this->page) . "' WHERE session_key='" . $this->session_key . "'"; } } else // A session does not exist. We'll create one. { if( $this->is_logged_in == false ) { $this->session_user_id = ANONYMOUS; } $sql = 'INSERT INTO ' . DB_SESSIONS_TABLE . ' (session_key, session_user_id, session_start_time, session_exp_time, session_page, session_ip) VALUES(\'' . $this->session_key . '\', ' . $this->session_user_id . ', ' . $cur_time . ', ' . $exp_time . ', \'' . addslashes($this->page) . '\', \'' . $this->ip . '\')'; } $DB->query($sql); if( $this->is_logged_in == false ) { $sql = 'SELECT * FROM ' . DB_USERS_TABLE . ' WHERE user_id=' . $this->session_user_id; $result = $DB->query($sql); $User->set( $DB->fetch_assoc($result) ); } $cookie_data = urlencode( $this->session_user_id . ':' . $this->session_key ); (setcookie($Config->get('cookie_name') . '_data', $cookie_data, $cur_time + $Config->get('session_length'), $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure'))) ? ($SID = "?sid=") : ($SID = "?sid=" . $this->session_key); $this->clean(); } /** * @return void * @param clean_all boolean * @desc Cleans out old session data. */ function clean($clean_all = false) { global $DB; $rand = rand(0,10); if(($rand <= 1) || ($clean_all == true)) // 1:10 chance of session cleanup. This may later become a setting. { $sql = "DELETE FROM " . DB_SESSIONS_TABLE . " WHERE session_exp_time<" . time(); $DB->query($sql); if((!empty($this->session_user_id)) && ($this->session_user_id != ANONYMOUS) && (!empty($this->session_key))) // Note that, if we reach this point, the following query will remove past sessions for this user which may not have expired. // This is good, but would be better if done for all users or if done during the creation of new sessions. { $sql = "DELETE FROM " . DB_SESSIONS_TABLE . " WHERE session_user_id=" . $this->session_user_id . " AND session_key!='" . $this->session_key . "'"; $DB->query($sql); } } } /** * @return void * @desc Grabs session data for the user. */ function get_session_data() { global $Config, $DB, $User; // Let's see if we have a standard cookie available. if(!empty($_COOKIE[$Config->get('cookie_name') . '_data'])) { $cookie_data = $_COOKIE[$Config->get('cookie_name') . '_data']; $cookie_array = explode(':', urldecode( $cookie_data ) ); // We have a cookie. Let's see if it's valid. if( ( !empty($cookie_array[0]) ) && ( strlen($cookie_array[1]) == 32 ) ) { // Our cookie is valid. Let's set a few vars. $this->session_user_id = $cookie_array[0]; $this->session_key = $cookie_array[1]; } } elseif(!empty($_GET['sid'])) { $this->session_key = $_GET['sid']; } if(empty($this->session_key)) // If we don't have a session key by now, there isn't one saved. { $this->session_key = md5( uniqid (microtime(), 1) ); $this->session_key_new = true; } // The user is currently anonymous, so let's check for auto-login. if( ($this->session_user_id == ANONYMOUS) || empty($this->session_user_id) ) { if( !empty( $_COOKIE[$Config->get('cookie_name') . '_auto'] ) ) // We have an autologin cookie set. { $auto_cookie_data = $_COOKIE[$Config->get('cookie_name') . '_auto']; $auto_cookie_array = explode(':', urldecode( $auto_cookie_data ) ); $sql = "SELECT * FROM " . DB_USERS_TABLE . " WHERE user_id=" . $auto_cookie_array[0] . " AND user_passwd='" . $auto_cookie_array[1] . "'"; $result = $DB->query($sql); $num_rows = $DB->num_rows($result); if( $num_rows == 1 ) // This cookie is valid. { $User->set( $DB->fetch_assoc($result) ); $User->set('invisible_mode', $auto_cookie_array[2]); $this->session_user_id = $auto_cookie_array[0]; $this->is_logged_in = true; } else // The autologin cookie was invalid. { // We'll unset the cookie and continue on like nothing ever happened. setcookie($Config->get('cookie_name') . '_auto', '', time() - 31536000, $Config->get('cookie_path'), $Config->get('cookie_domain'), $Config->get('cookie_secure')); return false; $this->session_user_id = ANONYMOUS; } } } } } ?> --- NEW FILE: template.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either vlersion 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: template.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ /* The following code was taken from or inspired by the guys over at phpBB. Any code resembling that of phpBB is probably their's and therefore they hold the legal rights to it. Since both phpBB and phpMP are released under the GPL, you must abide by said license. */ // Deprecated in favor of the (soon-to-be-started) Fission Template System. class Template { // variable that holds all the data we'll be substituting into // the compiled templates. Takes form: // --> $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value // if it's a root-level variable, it'll be like this: // --> $this->_tpldata[.][0][varname] == value var $_tpldata = array(); // Root dir and hash of filenames for each template handle. var $root = ''; var $cache_root = 'cache/templates/'; var $files = array(); // this will hash handle names to the compiled/uncompiled code for that handle. var $compiled_code = array(); // Various counters and storage arrays var $block_names = array(); var $block_else_level = array(); var $block_nesting_level = 0; var $static_lang; var $force_recompile; function set_template($template = '', $static_lang = false, $force_recompile = false) { $this->root = C_PHPMP_ROOT . 'templates/' . $template; $this->cachedir = C_PHPMP_ROOT . $this->cache_root . $template . '/'; $this->static_lang = $static_lang; $this->force_recompile = $force_recompile; if (!file_exists($this->cachedir)) { @umask(0); mkdir($this->cachedir, 0777); } return true; } // Sets the template filenames for handles. $filename_array // should be a hash of handle => filename pairs. function set_filenames($filename_array) { if (!is_array($filename_array)) { return false; } $template_names = ''; foreach ($filename_array as $handle => $filename) { if (empty($filename)) { trigger_error("template error - Empty filename specified for $handle", E_USER_ERROR); } $this->filename[$handle] = $filename; $this->files[$handle] = $this->make_filename($filename); } return true; } // Generates a full path+filename for the given filename, which can either // be an absolute name, or a name relative to the rootdir for this Template // object. function make_filename($filename) { // Check if it's an absolute or relative path. return (substr($filename, 0, 1) != '/') ? $this->root . '/' . $filename : $filename; } // Destroy template data set function destroy() { $this->_tpldata = array(); } // Methods for loading and evaluating the templates function display($handle) { global $Config, $Local; if ($filename = $this->_tpl_load($handle)) { include($filename); } else { eval(' ?>' . $this->compiled_code[$handle] . '<?php '); } return true; } // Load a compiled template if possible, if not, recompile it function _tpl_load(&$handle) { global $Config, $user; $filename = $this->cachedir . $this->filename[$handle] . '.' . (($this->static_lang) ? $Config->get('language') . '.' : '') . 'php'; // Recompile page if the original template is newer, otherwise load the compiled version if (file_exists($filename) && !$this->force_recompile) { return $filename; } // If the file for this handle is already loaded and compiled, do nothing. if (!empty($this->uncompiled_code[$handle])) { return true; } // If we don't have a file assigned to this handle, die. if (!isset($this->files[$handle])) { trigger_error("template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR); } $str = ''; // Try and open template for read if (!($fp = @fopen($this->files[$handle], 'r'))) { trigger_error("template->_tpl_load(): File $filename does not exist or is empty", E_USER_ERROR); } $str = fread($fp, filesize($this->files[$handle])); @fclose($fp); // Actually compile the code now. $this->compiled_code[$handle] = $this->compile(trim($str)); $this->compile_write($handle, $this->compiled_code[$handle]); return false; } // Assign key variable pairs from an array function assign_vars($vararray) { foreach ($vararray as $key => $val) { $this->_tpldata['.'][0][$key] = $val; } return true; } // Assign a single variable to a single key function assign_var($varname, $varval) { $this->_tpldata['.'][0][$varname] = $varval; return true; } // Assign key variable pairs from an array to a specified block function assign_block_vars($blockname, $vararray) { if (strstr($blockname, '.')) { // Nested block. $blocks = explode('.', $blockname); $blockcount = sizeof($blocks) - 1; $str = &$this->_tpldata; for ($i = 0; $i < $blockcount; $i++) { $str = &$str[$blocks[$i]]; $str = &$str[sizeof($str) - 1]; } // Now we add the block that we're actually assigning to. // We're adding a new iteration to this block with the given // variable assignments. $str[$blocks[$blockcount]][] = $vararray; } else { // Top-level block. // Add a new iteration to this block with the variable assignments // we were given. $this->_tpldata[$blockname][] = $vararray; } return true; } // Include a seperate template function _tpl_include($filename, $include = true) { global $user, $Config, $Local; $handle = $filename; $this->filename[$handle] = $filename; $this->files[$handle] = $this->make_filename($filename); $filename = $this->_tpl_load($handle); if ($include) { // eval($this->compiled_code[$handle]); include($filename); } } // This next set of methods could be seperated off and included since // they deal exclusively with compilation ... which is done infrequently // and would save a fair few kb // The all seeing all doing compile method. Parts are inspired by or directly // from Smarty function compile($code, $no_echo = false, $echo_var = '') { global $Config; error_reporting(E_ERROR | E_WARNING | E_PARSE); // Remove any "loose" php ... we want to give admins the ability // to switch on/off PHP for a given template. Allowing unchecked // php is a no-no. There is a potential issue here in that non-php // content may be removed ... however designers should use entities // if they wish to display < and > $match_php_tags = array('#\<\?php .*?\?\>#is', '#\<\script language="php"\>.*?\<\/script\>#is', '#\<\?.*?\?\>#s', '#\<%.*?%\>#s'); $code = preg_replace($match_php_tags, '', $code); // Pull out all block/statement level elements and seperate // plain text preg_match_all('#<!-- PHP -->(.*?)<!-- ENDPHP -->#s', $code, $matches); $php_blocks = $matches[1]; $code = preg_replace('#<!-- PHP -->(.*?)<!-- ENDPHP -->#s', '<!-- PHP -->', $code); preg_match_all('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\.]+?) -->#', $code, $matches); $include_blocks = $matches[1]; $code = preg_replace('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\.]+?) -->#', '<!-- INCLUDE -->', $code); preg_match_all('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\.\\\\]+?) -->#', $code, $matches); $includephp_blocks = $matches[1]; $code = preg_replace('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\.]+?) -->#', '<!-- INCLUDEPHP -->', $code); preg_match_all('#<!-- (.*?) (.*?)?[ ]?-->#s', $code, $blocks); $text_blocks = preg_split('#<!-- (.*?) (.*?)?[ ]?-->#s', $code); for($i = 0; $i < count($text_blocks); $i++) { $this->compile_var_tags($text_blocks[$i]); } $compile_blocks = array(); /* for ($curr_tb = 0; $curr_tb < count($text_blocks); $curr_tb++) { switch ($blocks[1][$curr_tb]) { case 'BEGIN': $this->block_else_level[] = false; $compile_blocks[] = '<?php ' . $this->compile_tag_block($blocks[2][$curr_tb]) . ' ?>'; break; case 'BEGINELSE': $this->block_else_level[sizeof($this->block_else_level) - 1] = true; $compile_blocks[] = '<?php }} else { ?>'; break; case 'END': array_pop($this->block_names); $compile_blocks[] = '<?php ' . ((array_pop($this->block_else_level)) ? '}' : '}}') . ' ?>'; break; case 'IF': $compile_blocks[] = '<?php ' . $this->compile_tag_if($blocks[2][$curr_tb], false) . ' ?>'; break; case 'ELSE': $compile_blocks[] = '<?php } else { ?>'; break; case 'ELSEIF': $compile_blocks[] = '<?php ' . $this->compile_tag_if($blocks[2][$curr_tb], true) . ' ?>'; break; case 'ENDIF': $compile_blocks[] = '<?php } ?>'; break; case 'INCLUDE': $temp = ''; list(, $temp) = each($include_blocks); $compile_blocks[] = '<?php ' . $this->compile_tag_include($temp) . ' ?>'; $this->_tpl_include($temp, false); break; case 'INCLUDEPHP': if ($Config->get('tpl_php')) { $temp = ''; list(, $temp) = each($includephp_blocks); $compile_blocks[] = '<?php ' . $this->compile_tag_include_php($temp) . ' ?>'; } break; case 'PHP': if ($Config->get('tpl_php')) { $temp = ''; list(, $temp) = each($php_blocks); $compile_blocks[] = '<?php ' . $temp . ' ?>'; } break; default: $this->compile_var_tags($blocks[0][$curr_tb]); $trim_check = trim($blocks[0][$curr_tb]); $compile_blocks[] = (!$no_echo) ? ((!empty($trim_check)) ? $blocks[0][$curr_tb] : '') : ((!empty($trim_check)) ? $blocks[0][$curr_tb] : ''); break; } }*/ $template_php = ''; for ($i = 0; $i < count($text_blocks); $i++) { $trim_check_text = trim($text_blocks[$i]); // $trim_check_block = trim($compile_blocks[$i]); $template_php .= (!$no_echo) ? ((!empty($trim_check_text)) ? $text_blocks[$i] : '') . ((!empty($compile_blocks[$i])) ? $compile_blocks[$i] : '') : ((!empty($trim_check_text)) ? $text_blocks[$i] : '') . ((!empty($compile_blocks[$i])) ? $compile_blocks[$i] : ''); } // There will be a number of occassions where we switch into and out of // PHP mode instantaneously. Rather than "burden" the parser with this // we'll strip out such occurences, minimising such switching $template_php = str_replace(' ?><?php ', '', $template_php); return (!$no_echo) ? $template_php : "\$$echo_var .= '" . $template_php . "'"; } function compile_var_tags(&$text_blocks) { // change template varrefs into PHP varrefs $varrefs = array(); // This one will handle varrefs WITH namespaces preg_match_all('#\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}#is', $text_blocks, $varrefs); for ($j = 0; $j < sizeof($varrefs[1]); $j++) { $namespace = $varrefs[1][$j]; $varname = $varrefs[3][$j]; $new = $this->generate_block_varref($namespace, $varname); $text_blocks = str_replace($varrefs[0][$j], $new, $text_blocks); } // This will handle the remaining root-level varrefs if (!$this->static_lang) { global $Local; $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*?)\}#is', "<?php echo ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$Local->lang['\\1'])) ? \$Local->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $text_blocks); } else { global $Local; $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]*?)\}#e', "'<?php echo ((isset(\$this->_tpldata[\'.\'][0][\'L_\\1\'])) ? \$this->_tpldata[\'.\'][0][\'L_\\1\'] : \'' . ((isset(\$Local->lang['\\1'])) ? \$Local->lang['\\1'] : '') . '\'); ?>'" , $text_blocks); } $text_blocks = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "<?php echo \$this->_tpldata['.'][0]['\\1']; ?>", $text_blocks); return; } function compile_tag_block($tag_args) { $tag_template_php = ''; array_push($this->block_names, $tag_args); if (sizeof($this->block_names) < 2) { // Block is not nested. $tag_template_php = '$_' . $tag_args . "_count = (isset(\$this->_tpldata['$tag_args'])) ? sizeof(\$this->_tpldata['$tag_args']) : 0;"; } else { // This block is nested. // Generate a namespace string for this block. $namespace = implode('.', $this->block_names); // Get a reference to the data array for this block that depends on the // current indices of all parent blocks. $varref = $this->generate_block_data_ref($namespace, false); // Create the for loop code to iterate over this block. $tag_template_php = '$_' . $tag_args . '_count = (isset(' . $varref . ')) ? sizeof(' . $varref . ') : 0;'; } $tag_template_php .= 'if ($_' . $tag_args . '_count) {'; $tag_template_php .= 'for ($this->_' . $tag_args . '_i = 0; $this->_' . $tag_args . '_i < $_' . $tag_args . '_count; $this->_' . $tag_args . '_i++){'; return $tag_template_php; } // // Compile IF tags - much of this is from Smarty with // some adaptions for our block level methods // function compile_tag_if($tag_args, $elseif) { /* Tokenize args for 'if' tag. */ preg_match_all('/(?: "[^"\\\\]*(?:\\\\.[^"\\\\]*)*" | \'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\' | [(),] | [^\s(),]+)/x', $tag_args, $match); $tokens = $match[0]; $is_arg_stack = array(); for ($i = 0; $i < count($tokens); $i++) { $token = &$tokens[$i]; switch (strtolower($token)) { case '!': case '%': case '!==': case '==': case '===': case '>': case '<': case '!=': case '<>': case '<<': case '>>': case '<=': case '>=': case '&&': case '||': case '|': case '^': case '&': case '~': case ')': case ',': case '+': case '-': case '*': case '/': case '@': break; case 'eq': $token = '=='; break; case 'ne': case 'neq': $token = '!='; break; case 'lt': $token = '<'; break; case 'le': case 'lte': $token = '<='; break; case 'gt': $token = '>'; break; case 'ge': case 'gte': $token = '>='; break; case 'and': $token = '&&'; break; case 'or': $token = '||'; break; case 'not': $token = '!'; break; case 'mod': $token = '%'; break; case '(': array_push($is_arg_stack, $i); break; case 'is': $is_arg_start = ($tokens[$i-1] == ')') ? array_pop($is_arg_stack) : $i-1; $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start)); $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1)); array_splice($tokens, $is_arg_start, count($tokens), $new_tokens); $i = $is_arg_start; default: if (preg_match('#^(([a-z0-9\-_]+?\.)+?)?([A-Z]+[A-Z0-9\-_]+?)$#s', $token, $varrefs)) { $token = (!empty($varrefs[1])) ? $this->generate_block_data_ref(substr($varrefs[1], 0, strlen($varrefs[1]) - 1), true) . '[\'' . $varrefs[3] . '\']' : '$this->_tpldata[\'.\'][0][\'' . $varrefs[3] . '\']'; } break; } } return (($elseif) ? '} elseif (' : 'if (') . (implode(' ', $tokens) . ') { '); } function compile_tag_include($tag_args) { return "\$this->_tpl_include('$tag_args');"; } function compile_tag_include_php($tag_args) { return "include('" . $this->root . '/' . $tag_args . "');"; } // This is from Smarty function _parse_is_expr($is_arg, $tokens) { $expr_end = 0; $negate_expr = false; if (($first_token = array_shift($tokens)) == 'not') { $negate_expr = true; $expr_type = array_shift($tokens); } else { $expr_type = $first_token; } switch ($expr_type) { case 'even': if (@$tokens[$expr_end] == 'by') { $expr_end++; $expr_arg = $tokens[$expr_end++]; $expr = "!(($is_arg / $expr_arg) % $expr_arg)"; } else { $expr = "!($is_arg % 2)"; } break; case 'odd': if (@$tokens[$expr_end] == 'by') { $expr_end++; $expr_arg = $tokens[$expr_end++]; $expr = "(($is_arg / $expr_arg) % $expr_arg)"; } else { $expr = "($is_arg % 2)"; } break; case 'div': if (@$tokens[$expr_end] == 'by') { $expr_end++; $expr_arg = $tokens[$expr_end++]; $expr = "!($is_arg % $expr_arg)"; } break; default: break; } if ($negate_expr) { $expr = "!($expr)"; } array_splice($tokens, 0, $expr_end, $expr); return $tokens; } /** * Generates a reference to the given variable inside the given (possibly nested) * block namespace. This is a string of the form: * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' * It's ready to be inserted into an "echo" line in one of the templates. * NOTE: expects a trailing "." on the namespace. */ function generate_block_varref($namespace, $varname) { // Strip the trailing period. $namespace = substr($namespace, 0, strlen($namespace) - 1); // Get a reference to the data block for this namespace. $varref = $this->generate_block_data_ref($namespace, true); // Prepend the necessary code to stick this in an echo line. // Append the variable reference. $varref .= "['$varname']"; $varref = "<?php echo $varref; ?>"; return $varref; } /** * Generates a reference to the array of data values for the given * (possibly nested) block namespace. This is a string of the form: * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] * * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. * NOTE: does not expect a trailing "." on the blockname. */ function generate_block_data_ref($blockname, $include_last_iterator) { // Get an array of the blocks involved. $blocks = explode('.', $blockname); $blockcount = sizeof($blocks) - 1; $varref = '$this->_tpldata'; // Build up the string with everything but the last child. for ($i = 0; $i < $blockcount; $i++) { $varref .= "['" . $blocks[$i] . "'][\$this->_" . $blocks[$i] . '_i]'; } // Add the block reference for the last child. $varref .= "['" . $blocks[$blockcount] . "']"; // Add the iterator for the last child if requried. if ($include_last_iterator) { $varref .= '[$this->_' . $blocks[$blockcount] . '_i]'; } return $varref; } function compile_write(&$handle, $data) { global $user, $Config; $filename = $this->cachedir . $this->filename[$handle] . '.' . (($this->static_lang) ? $Config->get('language') . '.' : '') . 'php'; if ($fp = @fopen($filename, 'w+')) { @flock($fp, LOCK_EX); @fwrite ($fp, $data); @flock($fp, LOCK_UN); @fclose($fp); @umask(0); @chmod($filename, 0644); } return; } } ?> --- NEW FILE: user.php --- <?php /* * phpMP - The PHP Modular Portal System * Copyright (C) 2002-2003 Brian Rose and the phpMP group * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: user.php,v 1.1 2003/09/14 06:37:52 heimidal Exp $ * */ class User { var $_data; /** * @return boolean * @param userkey mixed(string,array) * @param userval string optional * @desc Set a variable in userdata. */ function set($userkey, $userval = false) { if(is_array( $userkey )) { foreach( $userkey as $key => $val ) { if(preg_match('/^[a-z][a-z0-9_-]+/', $key)) { $this->_data[$key] = $val; } } } elseif( (!empty($userkey)) && (preg_match('/^[a-z][a-z0-9_-]+/', $userkey)) && (!empty($userval)) ) { $this->_data[$userkey] = $userval; return true; } else { return false; } } /** * @return string * @param userkey string * @desc Fetches us... [truncated message content] |
From: Brian R. <hei...@us...> - 2003-09-14 06:37:58
|
Update of /cvsroot/phpmp/phpMP/core/dba/sql In directory sc8-pr-cvs1:/tmp/cvs-serv9778/core/dba/sql Added Files: mysql_default_vals.sql mysql_structure.sql Log Message: This should be fun. --- NEW FILE: mysql_default_vals.sql --- # phpMyAdmin MySQL-Dump # version 2.5.0-rc1 # http://www.phpmyadmin.net/ (download page) # # Host: localhost # Generation Time: Apr 23, 2003 at 01:14 AM # Server version: 4.0.12 # PHP Version: 4.3.0 # Database : `phpmp` # -------------------------------------------------------- # # Dumping data for table `phpmp_config` # INSERT INTO `phpmp_config` VALUES ('site_domain', 'http://localhost'); INSERT INTO `phpmp_config` VALUES ('rel_path', '/phpMP/'); INSERT INTO `phpmp_config` VALUES ('default_tpl', ''); INSERT INTO `phpmp_config` VALUES ('override_usr_tpl', '0'); INSERT INTO `phpmp_config` VALUES ('site_name', 'phpMP'); INSERT INTO `phpmp_config` VALUES ('default_lang', 'english'); INSERT INTO `phpmp_config` VALUES ('default_date_format', 'M j, Y h:ia T'); INSERT INTO `phpmp_config` VALUES ('enable_account_activation', '0'); INSERT INTO `phpmp_config` VALUES ('system_timezone', '-5'); INSERT INTO `phpmp_config` VALUES ('version', '0.1a'); INSERT INTO `phpmp_config` VALUES ('cookie_name', 'phpmp_cookie'); INSERT INTO `phpmp_config` VALUES ('cookie_domain', ''); INSERT INTO `phpmp_config` VALUES ('cookie_path', ''); INSERT INTO `phpmp_config` VALUES ('cookie_secure', '0'); INSERT INTO `phpmp_config` VALUES ('session_length', '3600'); # -------------------------------------------------------- # # Dumping data for table `phpmp_users` # INSERT INTO `phpmp_users` VALUES (1, 'Anonymous', '', 1, '', '', 0, '', '', '', ''); --- NEW FILE: mysql_structure.sql --- # phpMyAdmin MySQL-Dump # version 2.5.0-rc1 # http://www.phpmyadmin.net/ (download page) # # Host: localhost # Generation Time: Apr 23, 2003 at 01:14 AM # Server version: 4.0.12 # PHP Version: 4.3.0 # Database : `phpmp` # -------------------------------------------------------- # # Table structure for table `phpmp_config` # # Creation: Apr 22, 2003 at 08:46 AM # Last update: Apr 22, 2003 at 11:54 PM # CREATE TABLE `phpmp_config` ( `config_key` varchar(255) NOT NULL default '', `config_value` varchar(255) NOT NULL default '', PRIMARY KEY (`config_key`) ) TYPE=MyISAM; # # Table structure for table `phpmp_sessions` # # Creation: Apr 22, 2003 at 05:34 PM # Last update: Apr 23, 2003 at 01:11 AM # CREATE TABLE `phpmp_sessions` ( `session_key` varchar(32) NOT NULL default '', `session_user_id` mediumint(8) NOT NULL default '0', `session_start_time` int(10) NOT NULL default '0', `session_exp_time` int(10) NOT NULL default '0', `session_page` varchar(50) NOT NULL default '', `session_ip` varchar(8) NOT NULL default '', PRIMARY KEY (`session_key`) ) TYPE=Heap; # # Table structure for table `phpmp_users` # # Creation: Apr 23, 2003 at 12:34 AM # Last update: Apr 23, 2003 at 12:37 AM # CREATE TABLE `phpmp_users` ( `user_id` mediumint(8) NOT NULL auto_increment, `user_name` varchar(24) NOT NULL default '', `user_passwd` varchar(32) NOT NULL default '', `active` tinyint(1) NOT NULL default '0', `email` varchar(255) NOT NULL default '', `actkey` varchar(32) NOT NULL default '', `auth_level` tinyint(1) NOT NULL default '0', `language` varchar(32) NOT NULL default '', `date_format` varchar(32) NOT NULL default '', `template` varchar(32) NOT NULL default '', `signature` varchar(255) NOT NULL default '', PRIMARY KEY (`user_id`) ) TYPE=MyISAM AUTO_INCREMENT=3 ; |