Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv22704
Modified Files:
attachment.php bug.php config.php include.php index.php
logout.php newaccount.php query.php report.php user.php
Log Message:
Internalizing PHPlib stuff, and moving to PHP native sessions
Index: attachment.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/attachment.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- attachment.php 2001/10/12 04:19:31 1.10
+++ attachment.php 2001/11/13 03:52:59 1.11
@@ -168,6 +168,4 @@
$t->pparse('main',array('content','wrap','main'));
-page_close();
-
?>
Index: bug.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/bug.php,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- bug.php 2001/11/08 14:27:35 1.57
+++ bug.php 2001/11/13 03:53:00 1.58
@@ -704,6 +704,4 @@
$t->pparse('main',array('content','wrap','main'));
-page_close();
-
?>
Index: config.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/config.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- config.php 2001/10/30 03:59:51 1.15
+++ config.php 2001/11/13 03:53:01 1.16
@@ -62,11 +62,8 @@
define ('ONEDAY', 86400);
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');
+require_once ('inc/session.php');
+require_once ('inc/auth.php');
+require_once ('inc/template.php');
?>
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- include.php 2001/11/08 05:13:15 1.73
+++ include.php 2001/11/13 03:53:02 1.74
@@ -27,7 +27,7 @@
define('INCLUDE_PATH', '');
}
-@require (INSTALL_PATH.'/'.INCLUDE_PATH.'config.php');
+include (INSTALL_PATH.'/'.INCLUDE_PATH.'config.php');
if (!defined('DB_HOST')) { // Installation hasn't been completed
header("Location: install.php");
exit();
@@ -133,123 +133,10 @@
$default_db_fields = array('bug_id', 'title', 'reporter', 'owner',
'severity_name', 'priority', 'status_name', 'resolution_name');
-class sqlclass extends CT_Sql {
- var $database_class = 'dbclass';
- var $database_table = TBL_ACTIVE_SESSIONS;
-}
-
class usess extends Session {
var $classname = 'usess';
- var $magic = 'gerdisbad';
- var $mode = 'cookie';
- #var $fallback_mode = 'get';
- var $lifetime = 0;
- var $that_class = 'sqlclass';
- var $allowcache = 'jl';
-}
-
-class uauth extends Auth {
- var $classname = 'uauth';
var $lifetime = 0;
- var $magic = 'looneyville';
- var $nobody = true;
-
- function auth_loginform() {
- global $sess;
-
- include 'templates/'.THEME.'/login.html';
-
- }
-
- function auth_validatelogin() {
- global $username, $password, $q, $select, $emailpass, $emailsuccess, $STRING;
-
- if (!$username) return 'nobody';
- $this->auth['uname'] = $username;
- if (ENCRYPT_PASS) {
- $password = md5($password);
- }
- $u = $q->grab("select * from ".TBL_AUTH_USER." where login = '$username' and password = '$password' and active > 0");
- if (!$q->num_rows()) {
- return 'nobody';
- } else {
- $this->auth['db_fields'] = unserialize($u['bug_list_fields']);
-
- // Grab group assignments and permissions based on groups
- $q->query("select group_name, perm_name"
- ." from ".TBL_AUTH_PERM." ap, ".TBL_GROUP_PERM." gp, ".TBL_AUTH_GROUP." ag, ".TBL_USER_GROUP." ug"
- ." where ap.perm_id = gp.perm_id and gp.group_id = ag.group_id"
- ." and ag.group_id = ug.group_id and ug.user_id = {$u['user_id']}");
- while (list($group, $perm) = $q->grab()) {
- $this->auth['perm'][$perm] = true;
- $this->auth['group'][$group] = true;
- }
-
- return $u['user_id'];
- }
- }
-
- function unauth($nobody = false) {
- Auth::unauth($nobody);
- $this->auth['group'] = '';
- $this->auth['db_fields'] = '';
- }
-}
-
-class uperm extends Perm {
- var $classname = 'uperm';
-
- function check_auth($auth_var, $reqs) {
- global $auth;
-
- // Administrators always pass
- if ($auth->auth[$auth_var]['Admin']) {
- return true;
- }
-
- if (is_array($reqs)) {
- foreach ($reqs as $req) {
- if (!$auth->auth[$auth_var][$req]) {
- return false;
- }
- }
- } else {
- if (!$auth->auth[$auth_var][$reqs]) {
- return false;
- }
- }
-
- // Didn't fail on any requirements? Then the user passes the check
- return true;
- }
-
-
- function in_group($req_groups) {
- return $this->check_auth('group', $req_groups);
- }
-
-
- function have_perm($req_perms) {
- return $this->check_auth('perm', $req_perms);
- }
-
-
- function perm_invalid() {
- global $t, $auth;
- $t->set_file('content','badperm.html');
- $t->pparse('main',array('content','wrap','main'));
- }
-
- function check_group($group) {
- global $t;
-
- if (!$this->check_auth('group', $group)) {
- $t->set_file('content', 'badgroup.html');
- $t->set_var('group', $group);
- $t->pparse('main',array('content','wrap','main'));
- exit();
- }
- }
+ var $allowcache = '';
}
class templateclass extends Template {
@@ -260,7 +147,7 @@
$this->set_block('wrap', 'logoutblock', 'loblock');
$this->set_block('wrap', 'loginblock', 'liblock');
$this->set_block('wrap', 'adminnavblock', 'anblock');
- if ($u && $u != 'nobody') {
+ if ($u) {
list($owner_open, $owner_closed) = $q->grab("SELECT sum(CASE WHEN status_name in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END ) ,"
."sum(CASE WHEN status_name not in ('Unconfirmed','New','Assigned','Reopened') THEN 1 ELSE 0 END )"
."from ".TBL_BUG." b left join ".TBL_STATUS." s using(status_id) where assigned_to = $u");
@@ -562,7 +449,7 @@
function maskemail($email) {
global $auth;
- if (HIDE_EMAIL && $auth->auth['uid'] == 'nobody') {
+ if (HIDE_EMAIL && !$auth->auth['uid']) {
return '******';
} elseif (MASK_EMAIL) {
return str_replace('@', ' at ', str_replace('.', ' dot ', $email));
@@ -601,7 +488,7 @@
}
} else {
$auth->auth['uid'] = $auth->auth_validatelogin();
- if ($auth->auth['uid'] == 'nobody') {
+ if (!$auth->auth['uid']) {
$t->set_var(array(
'loginerrorcolor' => '#ff0000',
'loginerror' => 'Invalid login<br>'
Index: index.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/index.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- index.php 2001/09/01 15:44:20 1.11
+++ index.php 2001/11/13 03:53:04 1.12
@@ -60,6 +60,4 @@
$t->pparse('main',array('content','wrap','main'));
-page_close();
-
?>
Index: logout.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/logout.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- logout.php 2001/10/15 13:51:43 1.6
+++ logout.php 2001/11/13 03:53:04 1.7
@@ -27,6 +27,4 @@
include 'templates/'.THEME.'/logout.html';
-page_close();
-
?>
Index: newaccount.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/newaccount.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- newaccount.php 2001/11/06 04:40:18 1.20
+++ newaccount.php 2001/11/13 03:53:04 1.21
@@ -99,6 +99,4 @@
$t->pparse('main',array('content','wrap','main'));
-page_close();
-
?>
Index: query.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/query.php,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- query.php 2001/11/12 01:13:33 1.37
+++ query.php 2001/11/13 03:53:04 1.38
@@ -323,6 +323,4 @@
$t->pparse('main',array('content','wrap','main'));
-page_close();
-
?>
Index: report.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/report.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- report.php 2001/11/02 04:22:12 1.16
+++ report.php 2001/11/13 03:53:04 1.17
@@ -95,6 +95,4 @@
$t->pparse('main',array('content','wrap','main'));
-page_close();
-
?>
Index: user.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/user.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- user.php 2001/10/12 04:19:31 1.16
+++ user.php 2001/11/13 03:53:04 1.17
@@ -93,6 +93,4 @@
$t->pparse('main', array('content', 'wrap', 'main'));
-page_close();
-
?>
|