|
From: Benjamin C. <bc...@us...> - 2001-10-12 04:19:34
|
Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv4700
Modified Files:
attachment.php bug.php config.php include.php newaccount.php
query.php user.php
Log Message:
* WARNING * This _will_ clobber your configuration settings, as most of the defines have moved to the new table, configuration. (Let me know if I broke anything) :)
Index: attachment.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/attachment.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- attachment.php 2001/09/18 03:36:33 1.9
+++ attachment.php 2001/10/12 04:19:31 1.10
@@ -48,7 +48,7 @@
show_text($STRING['bad_attachment'], true);
return false;
}
- $filename = join('/',array(INSTALLPATH, ATTACHMENT_PATH,
+ $filename = join('/',array(INSTALL_PATH, ATTACHMENT_PATH,
$ainfo['project_id'], "{$ainfo['bug_id']}-{$ainfo['file_name']}"));
if (!is_readable($filename)) {
show_text($STRING['bad_attachment'], true);
@@ -89,7 +89,7 @@
}
}
- $filepath = INSTALLPATH.'/'.ATTACHMENT_PATH;
+ $filepath = INSTALL_PATH.'/'.ATTACHMENT_PATH;
$tmpfilename = $HTTP_POST_FILES['attachment']['tmp_name'];
$filename = "$bugid-{$HTTP_POST_FILES['attachment']['name']}";
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- bug.php 2001/10/05 04:22:45 1.48
+++ bug.php 2001/10/12 04:19:31 1.49
@@ -71,7 +71,7 @@
'oldvalue' => stripslashes($row['old_value']),
'newvalue' => stripslashes($row['new_value']),
'createdby' => stripslashes(maskemail($row['login'])),
- 'date' => date(DATEFORMAT.' '.TIMEFORMAT, $row['created_date'])
+ 'date' => date(DATE_FORMAT.' '.TIME_FORMAT, $row['created_date'])
));
$t->parse('rows', 'row', true);
}
@@ -153,8 +153,8 @@
$row = $q->grab();
$t->set_var(array(
'newpostedby' => $row['login'],
- 'newpostedon' => date(TIMEFORMAT, $row['created_date']).' on '.
- date(DATEFORMAT, $row['created_date']),
+ 'newpostedon' => date(TIME_FORMAT, $row['created_date']).' on '.
+ date(DATE_FORMAT, $row['created_date']),
'newcomments' => textwrap('+ '.format_comments($row['comment_text']),72,"\n+ ")
));
// If this comment is the first additional comment after the creation of the
@@ -165,15 +165,15 @@
." where b.created_by = u.user_id and bug_id = {$buginfo['bug_id']}");
$t->set_var(array(
'oldpostedby' => $by,
- 'oldpostedon' => date(TIMEFORMAT,$on).' on '.date(DATEFORMAT,$on),
+ 'oldpostedon' => date(TIME_FORMAT,$on).' on '.date(DATE_FORMAT,$on),
'oldcomments' => textwrap(format_comments($comments),72)
));
} else {
$row = $q->grab();
$t->set_var(array(
'oldpostedby' => $row['login'],
- 'oldpostedon' => date(TIMEFORMAT,$row['created_date']).' on '.
- date(DATEFORMAT,$row['created_date']),
+ 'oldpostedon' => date(TIME_FORMAT,$row['created_date']).' on '.
+ date(DATE_FORMAT,$row['created_date']),
'oldcomments' => textwrap(format_comments($row['comment_text']),72)
));
}
@@ -201,7 +201,7 @@
$t->set_var(array(
'bugid' => $buginfo['bug_id'],
- 'bugurl' => INSTALLURL."/bug.php?op=show&bugid={$buginfo['bug_id']}",
+ 'bugurl' => INSTALL_URL."/bug.php?op=show&bugid={$buginfo['bug_id']}",
'priority' => $select['priority'][($cf['priority'] ? $cf['priority'] : $buginfo['priority'])],
'priority_stat' => $cf['priority'] ? '!' : ' ',
'reporter' => $reporter,
@@ -212,8 +212,8 @@
if ($toemail) {
mail($toemail,"[Bug {$buginfo['bug_id']}] Changed - ".
($cf['title'] ? $cf['title'] : $buginfo['title']), $t->parse('main','emailout'),
- sprintf("From: %s\nReply-To: %s\nErrors-To: %s\nContent-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit\n", ADMINEMAIL, ADMINEMAIL,
- ADMINEMAIL, $STRING['lang_charset']));
+ sprintf("From: %s\nReply-To: %s\nErrors-To: %s\nContent-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit\n", ADMIN_EMAIL, ADMIN_EMAIL,
+ ADMIN_EMAIL, $STRING['lang_charset']));
}
}
@@ -394,7 +394,7 @@
'resolution' => build_select('resolution',$row['resolution_id']),
'assignedto' => $row['assigned_to'],
'createdby' => $row['created_by'],
- 'createddate' => date(DATEFORMAT,$row['created_date']),
+ 'createddate' => date(DATE_FORMAT,$row['created_date']),
'lastmodifieddate' => $row['last_modified_date'],
'project' => $row['project_id'],
'projectname' => $projectname,
@@ -462,8 +462,8 @@
'resolution' => $row['resolution_name'] ? $row['resolution_name'] : '',
'owner' => maskemail($row['owner']),
'reporter' => maskemail($row['reporter']),
- 'createddate' => date(DATEFORMAT,$row['created_date']),
- 'createdtime' => date(TIMEFORMAT,$row['created_date']),
+ 'createddate' => date(DATE_FORMAT,$row['created_date']),
+ 'createdtime' => date(TIME_FORMAT,$row['created_date']),
'lastmodifieddate' => $row['last_modified_date'],
'project' => build_select('project',$row['project_id']),
'projectid' => $row['project_id'],
@@ -506,7 +506,7 @@
$t->set_var('attrows', '<tr><td colspan="5" align="center">No attachments</td></tr>');
} else {
while ($att = $q->grab()) {
- if (is_readable(INSTALLPATH.'/'.ATTACHMENT_PATH."/{$row['project_id']}/$bugid-{$att['file_name']}")) {
+ if (is_readable(INSTALL_PATH.'/'.ATTACHMENT_PATH."/{$row['project_id']}/$bugid-{$att['file_name']}")) {
$action = "<a href='attachment.php?attachid={$att['attachment_id']}'>View</a>";
if ($perm->have_perm('Administrator')) {
$action .= " | <a href='attachment.php?del={$att['attachment_id']}' onClick=\"return confirm('Are you sure you want to delete this attachment?');\">Delete</a>";
@@ -524,7 +524,7 @@
'attdesc' => stripslashes($att['description']),
'attsize' => $attsize,
'atttype' => $att['mime_type'],
- 'attdate' => date(DATEFORMAT, $att['created_date']),
+ 'attdate' => date(DATE_FORMAT, $att['created_date']),
'attaction' => $action
));
$t->parse('attrows', 'attrow', true);
@@ -550,8 +550,8 @@
'rdescription' => nl2br(format_comments(
htmlspecialchars($row['comment_text']))),
'rreporter' => maskemail($row['login']),
- 'rcreateddate' => date(TIMEFORMAT,$row['created_date']).' on '.
- date(DATEFORMAT,$row['created_date'])
+ 'rcreateddate' => date(TIME_FORMAT,$row['created_date']).' on '.
+ date(DATE_FORMAT,$row['created_date'])
));
$t->parse('rows','row',true);
}
@@ -583,7 +583,7 @@
'id' => $row['project_id'],
'name' => $row['project_name'],
'description' => $row['project_desc'],
- 'date' => date(DATEFORMAT,$row['created_date'])
+ 'date' => date(DATE_FORMAT,$row['created_date'])
));
$t->parse('rows','row',true);
}
Index: config.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/config.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- config.php 2001/09/29 14:50:26 1.12
+++ config.php 2001/10/12 04:19:31 1.13
@@ -22,41 +22,15 @@
// ------------------------------------------------------------------------
// $Id$
-define ('INSTALLPATH', '/home/bcurtis/public_html/phpbt');
-define ('INSTALLURL', 'http://localhost/~bcurtis/phpbt');
+define ('PHPLIB_PATH', ''); // If PHPlib is not in your include path
-define ('PHPLIBPATH', ''); // If not in the include path
-define ('JPGRAPH_PATH', ''); // If not in the include path
-
-// Location of your cvs web interface (see format_comments() in bug.php)
-define ('CVS_WEB', 'http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpbt/phpbt/');
-
// Database Config
-define ('DB_TYPE', 'mysql'); //using PHPlib file naming
+define ('DB_TYPE', 'mysql'); // using PHPlib file naming
define ('DB_HOST', 'localhost');
define ('DB_DATABASE', 'BugTracker');
define ('DB_USER', 'root');
define ('DB_PASSWORD', '');
-define ('ADMINEMAIL', 'ph...@be...');
-define ('ENCRYPTPASS', 0); // Whether to store passwords encrypted
-define ('THEME', 'default/'); // Which set of templates to use
-define ('USE_JPGRAPH', 0); // Whether to show images or not
-define ('MASK_EMAIL', 1); // Should email addresses be plainly visible?
-define ('HIDE_EMAIL', 1); // Should email addresses be hidden for those not logged in?
-// Should the query list use the severity colors as the row background color (like SourceForge)
-define ('USE_SEVERITY_COLOR', 1);
-define ('EMAIL_IS_LOGIN', 1); // Whether to use email addresses as logins
-
-// Sub-dir of the INSTALLPATH - Needs to be writeable by the web process
-define ('ATTACHMENT_PATH', 'attachments');
-// Maximum size (in bytes) of an attachment
-// This will not override the settings in php.ini if php.ini has a lower limit
-define ('ATTACHMENT_MAX_SIZE', 2097152);
-define ('ONEDAY', 86400);
-define ('DATEFORMAT', 'm-d-Y');
-define ('TIMEFORMAT', 'g:i A');
-
// Database Table Config
// you can change either the prefix of the table names or each table name individually
define ('TBL_PREFIX', ''); // the prefix for all tables, leave empty to use the old style
@@ -82,15 +56,14 @@
define ('TBL_VERSION', TBL_PREFIX.'version');
define ('TBL_PROJECT_GROUP', TBL_PREFIX.'project_group');
-require_once (PHPLIBPATH.'db_'.DB_TYPE.'.inc');
-require_once (PHPLIBPATH.'ct_sql.inc');
-require_once (PHPLIBPATH.'session.inc');
-require_once (PHPLIBPATH.'auth.inc');
-require_once (PHPLIBPATH.'perm.inc');
-require_once (PHPLIBPATH.'page.inc');
-require_once (PHPLIBPATH.'template.inc');
+define ('ONEDAY', 86400);
-// Localization - include the file with the desired language
-include INSTALLPATH.'/languages/en.php';
+require_once (PHPLIB_PATH.'db_'.DB_TYPE.'.inc');
+require_once (PHPLIB_PATH.'ct_sql.inc');
+require_once (PHPLIB_PATH.'session.inc');
+require_once (PHPLIB_PATH.'auth.inc');
+require_once (PHPLIB_PATH.'perm.inc');
+require_once (PHPLIB_PATH.'page.inc');
+require_once (PHPLIB_PATH.'template.inc');
?>
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- include.php 2001/10/11 14:28:37 1.60
+++ include.php 2001/10/12 04:19:31 1.61
@@ -22,11 +22,11 @@
// ------------------------------------------------------------------------
// $Id$
-if (defined("INCLUDE_PATH")) {
- require INCLUDE_PATH."config.php";
-} else {
- require "config.php";
+define ('INSTALL_PATH', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));
+if (!defined('INCLUDE_PATH')) {
+ define('INCLUDE_PATH', '');
}
+require (INSTALL_PATH.'/'.INCLUDE_PATH.'config.php');
// Edit this class with your database information
class dbclass extends DB_Sql {
@@ -49,7 +49,16 @@
}
$q = new dbclass;
-$cssfile = 'global.css';
+
+// Set up the configuration variables
+$q->query("select varname, varvalue from configuration");
+while (list($k, $v) = $q->grab()) {
+ define($k, $v);
+}
+
+// Localization - include the file with the desired language
+include INSTALL_PATH.'/'.INCLUDE_PATH.'languages/'.LANGUAGE.'.php';
+
$me = $HTTP_SERVER_VARS['PHP_SELF'];
$me2 = $HTTP_SERVER_VARS['REQUEST_URI'];
$selrange = 30;
@@ -106,7 +115,7 @@
function auth_loginform() {
global $sess;
- include 'templates/'.THEME.'login.html';
+ include 'templates/'.THEME.'/login.html';
}
@@ -115,7 +124,7 @@
if (!$username) return 'nobody';
$this->auth['uname'] = $username;
- if (ENCRYPTPASS) {
+ if (ENCRYPT_PASS) {
$password = md5($password);
}
$u = $q->grab("select * from ".TBL_AUTH_USER." where login = '$username' and password = '$password' and active > 0");
@@ -245,10 +254,10 @@
}
}
-if (defined('INCLUDE_PATH')) {
- $t = new templateclass(INCLUDE_PATH.'templates/'.THEME.'admin', 'keep');
+if (INCLUDE_PATH == '../') {
+ $t = new templateclass(INCLUDE_PATH.'templates/'.THEME.'/admin', 'keep');
} else {
- $t = new templateclass('templates/'.THEME, 'keep');
+ $t = new templateclass('templates/'.THEME.'/', 'keep');
}
$t->set_var(array(
@@ -256,7 +265,6 @@
'me' => $me,
'me2' => $me2,
'error' => '',
- 'cssfile' => $cssfile,
'loginerror' => '',
'template_path' => INCLUDE_PATH.'templates/'.THEME));
@@ -512,13 +520,13 @@
'loginerror' => 'Invalid login<br>'
));
} else {
- if (ENCRYPTPASS) {
+ if (ENCRYPT_PASS) {
$password = genpassword(10);
$mpassword = md5($password);
$q->query("update ".TBL_AUTH_USER." set password = '$mpassword' where login = '$username'");
}
mail($email, $STRING['newacctsubject'], sprintf($STRING['newacctmessage'],
- $password), sprintf("From: %s\nContent-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit\n",ADMINEMAIL, $STRING['lang_charset']));
+ $password), sprintf("From: %s\nContent-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit\n",ADMIN_EMAIL, $STRING['lang_charset']));
$t->set_var(array(
'loginerrorcolor' => '#0000ff',
'loginerror' => 'Your password has been emailed to you<br>'
Index: newaccount.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/newaccount.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- newaccount.php 2001/10/02 23:19:42 1.17
+++ newaccount.php 2001/10/12 04:19:31 1.18
@@ -40,7 +40,7 @@
$firstname = htmlspecialchars($firstname);
$lastname = htmlspecialchars($lastname);
$password = genpassword(10);
- if (ENCRYPTPASS) {
+ if (ENCRYPT_PASS) {
$mpassword = md5($password);
} else {
$mpassword = $password;
@@ -52,7 +52,7 @@
$q->query("insert into ".TBL_USER_GROUP." (user_id, group_id)"
." select $user_id, group_id from ".TBL_AUTH_GROUP." where group_name = 'user'");
mail($email, $STRING['newacctsubject'], sprintf($STRING['newacctmessage'],
- $password), sprintf("From: %s\nContent-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit\n",ADMINEMAIL, $STRING['lang_charset']));
+ $password), sprintf("From: %s\nContent-Type: text/plain; charset=%s\nContent-Transfer-Encoding: 8bit\n",ADMIN_EMAIL, $STRING['lang_charset']));
$t->set_file('content','newaccountsuccess.html');
}
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- query.php 2001/10/06 03:56:33 1.31
+++ query.php 2001/10/12 04:19:31 1.32
@@ -263,7 +263,7 @@
case 'created_date' :
case 'last_modified_date' :
case 'close_date' :
- $coldata = $row[$field] ? date(DATEFORMAT, $row[$field]) : ' ';
+ $coldata = $row[$field] ? date(DATE_FORMAT, $row[$field]) : ' ';
$td_extra = 'class="center"';
break;
case 'bug_id' :
Index: user.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/user.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- user.php 2001/09/18 03:36:33 1.15
+++ user.php 2001/10/12 04:19:31 1.16
@@ -44,7 +44,7 @@
return;
}
- if (ENCRYPTPASS) {
+ if (ENCRYPT_PASS) {
$mpassword = md5($pass1);
} else {
$mpassword = $pass1;
|