<?php
/**
* Module functions library of BugFree system.
*
* BugFree 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.
*
* BugFree 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 BugFree; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @link http://www.bugfree.org.cn
* @package BugFree
* @version $Id$
*/
//------------------------- BASE FUNCTIONS -----------------------------------//
/**
* Get Current Mode
*
* @author Yupeng Lee<leeyupeng@gmail.com>
*/
function baseGetTestMode()
{
if($_SESSION['TestMode'] == '')
{
$_SESSION['TestMode'] = 'Bug';
}
return $_SESSION['TestMode'];
}
/*================================User Function Start=================================*/
/**
* Judge valid user.
*
* @author Chunsheng Wang <wwccss@263.net>
* @global array the BugFree config array.
* @global object the object of ADO class created in SetupBug.inc.php.
* @param string $TestUserName the user name used to login BugFree system.
* @param string $TestUserPWD the user password used to login BugFree system.
*/
function baseJudgeUser($TestUserName = '',$TestUserPWD = '')
{
global $_CFG;
$DBName = !empty($_CFG['UserDB']) ? 'MyUserDB' : 'MyDB';
global $$DBName;
$TestUserPWD = baseEncryptUserPWD($TestUserPWD);
$Where = "{$_CFG[UserTable][UserName]} = '{$TestUserName}' AND {$_CFG[UserTable][UserPassword]} = '{$TestUserPWD}'";
if($DBName == 'MyDB')
{
$Where .= " AND IsDroped = '0'";
}
$TestUserInfo = dbGetRow($_CFG[UserTable][TableName], "{$_CFG[UserTable][UserName]} AS UserName, {$_CFG[UserTable][RealName]} AS RealName, {$_CFG[UserTable][Email]} AS Email"
, $Where , $$DBName);
return $TestUserInfo;
}
/**
* Encrypt the password according to the EncryptType defined in Config.inc.php.
*
* @author Chunsheng Wang <wwccss@263.net>
* @global array config vars of BugFree system.
* @param string $TestUserPWD the password before encrypting.
* @return string encrypted password.
*/
function baseEncryptUserPWD($TestUserPWD)
{
global $_CFG;
if($_CFG['UserTable']['EncryptType'] == 'md5')
{
$TestUserPWD = md5($TestUserPWD);
}
elseif($_CFG['UserTable']['EncryptType'] == 'mysqlpassword')
{
$TestUserPWD = "PASSWORD('{$TestUserPWD}')";
}
else
{
$TestUserPWD = $TestUserPWD;
}
return $TestUserPWD;
}
/**
* Judge User Login Status
*
* @author Yupeng Lee<leeyupeng@gmail.com>
* @
*/
function baseJudgeUserLogin()
{
return true;
}
/**
* Judge Adminuser Login Status
*
* @author Yupeng Lee<leeyupeng@gmail.com>
*
*/
function baseJudgeAdminUserLogin()
{
global $_CFG;
if(baseJudgeIsAdmin($_SESSION['TestUserName']))
{
return true;
}
else
{
die('Permission Denenied');
}
}
/**
* Judge is admin
*
* @author Yupeng Lee<leeyupeng@gmail.com>
*
*/
function baseJudgeIsAdmin($UserName)
{
global $_CFG;
$UserName = strtolower($UserName);
if(in_array($UserName, $_CFG['AdminUser']))
{
return true;
}
return false;
}
/**
* Get the User's A C L.
*
* @author Yupeng Lee <leeyupeng@163.com>
* @param string $TestUserName UserName.
* @return string User's ACL.
*/
function baseGetUserACL($TestUserName)
{
$ProjectList = testGetValidProjectList();
$UserACL = array();
$ProjectACL = array();
if(baseJudgeIsAdmin($TestUserName))
{
$ProjectACL = array_keys($ProjectList);
}
else
{
$GroupACL = testGetGroupList("GroupUser LIKE '%,{$TestUserName},%'");
$ProjectACL = array();
foreach($GroupACL as $GroupInfo)
{
$ProjectACL += $GroupInfo['GroupProjectList'];
}
$ProjectACL = array_keys($ProjectACL);
}
foreach($ProjectACL as $ProjectID)
{
if($ProjectList[$ProjectID])
{
$UserACL[$ProjectID] = 'All';
}
}
return $UserACL;
}
/**
* Get query string from group query post in SearchBug.php/SearchCase.php/SearchResult.php
*
* @author Yupeng Lee<leeyupeng@gmail.com>
*/
function baseGetGroupQueryStr($PostQueryArray)
{
global $_CFG;
$FirstQueryGroup = array();
$SecondQureyGroup = array();
$FieldName = 'Field';
$OperatorName = 'Operator';
$ValueName = 'Value';
$AndOrName = 'AndOr';
for($I=0; $I<$_CFG['QueryFieldNumber']; $I++)
{
$WhereStr = ' ';
if(ucfirst($PostQueryArray[$AndOrName.$I]) == 'And')
{
$WhereStr .= '1 AND ';
}
elseif(ucfirst($PostQueryArray[$AndOrName.$I]) == 'Or')
{
$WhereStr .= '1 OR ';
}
$TempQueryStr = baseGetFieldQueryStr($PostQueryArray[$FieldName.$I], $PostQueryArray[$OperatorName.$I], $PostQueryArray[$ValueName.$I]);
if($TempQueryStr == '')
{
$WhereStr = '';
}
else
{
$WhereStr .= $TempQueryStr;
}
if($WhereStr != '')
{
$I%2 == 0 ? $FirstQueryGroup[] = $WhereStr : $SecondQureyGroup[] = $WhereStr;
}
}
$FirstQueryStr = join('AND', $FirstQueryGroup);
$SecondQueryStr = join('AND', $SecondQureyGroup);
$FirstQueryStr == '' ? $FirstQueryStr = '1' : '';
$SecondQueryStr == '' ? $SecondQueryStr = '1' : '';
$QueryStr = '(' . $FirstQueryStr . ') ' . $PostQueryArray['AndOrGroup'] . ' (' . $SecondQueryStr . ')';
return $QueryStr;
}
function baseGetFieldQueryStr($FieldName, $OperatorName, $FieldValue)
{
$QueryStr = '';
if($FieldValue == '')
{
return $QueryStr;
}
if(ucfirst($FieldValue) == 'Null')
{
$FieldValue = '';
}
if($OperatorName == 'LIKE')
{
$QueryStr = "LIKE '%{$FieldValue}%' ";
}
elseif($OperatorName == 'UNDER')
{
$QueryStr = "LIKE '{$FieldValue}%' ";
}
elseif($OperatorName == '!=')
{
$QueryStr = "NOT " . dbCreateIN($FieldValue) . " ";
}
elseif($OperatorName == '=')
{
if(eregi('date', $FieldName))
{
$QueryStr = sysStrToDateSql($FieldValue);
}
else
{
$QueryStr = $OperatorName . " '{$FieldValue}' ";
}
}
else
{
$QueryStr = $OperatorName . " '{$FieldValue}' ";
}
$QueryStr = $FieldName . ' ' . $QueryStr;
return $QueryStr;
}
/**
* Get user list which are not droped
*
* @author Yupeng Lee<leeyupeng@gmail.com>
*/
function testGetUserList($Where = '', $OrderBy = 'RealName ASC', $Limit = '', $ListKey = 'UserName')
{
global $_CFG;
$DBName = !empty($_CFG['UserDB']) ? 'MyUserDB' : 'MyDB';
global $$DBName;
global $_CFG;
//$Columns = "{$_CFG[UserTable][UserName]} AS UserName, CONCAT(UPPER(LEFT({$_CFG[User
没有合适的资源?快使用搜索试试~ 我知道了~
信息办公BugFree v2.0 RC1 Build 20071031 (开源Bug管理系统)-bugfree.rar
共263个文件
php:140个
tpl:52个
gif:21个
0 下载量 171 浏览量
2024-04-07
06:23:58
上传
评论
收藏 825KB RAR 举报
温馨提示
【项目资源】:包含前端、后端、移动开发、操作系统、人工智能、物联网、信息化管理、数据库、硬件开发、大数据、课程资源、音视频、网站开发等各种技术项目的源码。包括STM32、ESP8266、PHP、QT、Linux、iOS、C++、Java、python、web、C#、EDA、proteus、RTOS等项目的源码。【项目质量】:所有源码都经过严格测试,可以直接运行。功能在确认正常工作后才上传。【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。【附加价值】:项目具有较高的学习借鉴价值,也可直接拿来修改复刻。对于有一定基础或热衷于研究的人来说,可以在这些基础代码上进行修改和扩展,实现其他功能。【沟通交流】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。鼓励下载和使用,并欢迎大家互相学习,共同进步。
资源推荐
资源详情
资源评论
收起资源包目录
信息办公BugFree v2.0 RC1 Build 20071031 (开源Bug管理系统)-bugfree.rar (263个子文件)
NoticeBug.bat 976B
Basic.css 13KB
Login.css 2KB
TreeMenu.css 828B
xmlschema.dtd 1KB
Logo_Link.gif 4KB
login_bg_left.gif 3KB
login_bg_right.gif 3KB
login_separate_line.gif 1KB
Loading.gif 1KB
deletefile.gif 538B
login_bg_center.gif 502B
export.gif 408B
report.gif 354B
login_input.gif 277B
icon_refresh.gif 90B
closed.gif 85B
opened.gif 83B
arrow_left_enabled.gif 78B
arrow_right_enabled.gif 78B
arrow_left_disabled.gif 78B
arrow_right_disabled.gif 78B
delete.gif 65B
child.gif 48B
blank.gif 43B
blank.gif 43B
index.htm 1KB
index.htm 1KB
index.htm 1KB
mysql_meta_module.inc 16KB
mysql_driver.inc 15KB
mysql_perfmon_module.inc 11KB
mysql_date_module.inc 7KB
menu_module.inc 5KB
mysql_extend_module.inc 4KB
pear_module.inc 4KB
mysql_datadict.inc 3KB
mysql_transaction_module.inc 2KB
object_module.inc 2KB
adodblite_module.inc 873B
overlib.js 36KB
Main.js 36KB
xajax_uncompressed.js 21KB
xajax.js 16KB
FusionCharts.js 7KB
TreeMenu.js 2KB
pngfix.js 2KB
FuncModel.inc.php 110KB
adodb-xmlschema.inc.php 59KB
class.phpmailer.php 46KB
FuncMain.inc.php 42KB
adodb-time.inc.php 39KB
_COMMON.php 38KB
xajax.inc.php 36KB
_COMMON.php 35KB
class.smtp.php 34KB
class.compiler.php 30KB
adodb-perf-module.inc.php 26KB
class.template.php 24KB
adodb-datadict.inc.php 22KB
xajaxResponse.inc.php 20KB
install.php 17KB
Page.class.php 15KB
FuncStat.inc.php 15KB
adodb.inc.php 10KB
Bug.php 9KB
adodb-error.inc.php 9KB
function.html_select_date.php 8KB
UserControl.php 7KB
function.resize_image.php 7KB
FusionCharts.php 7KB
adodb-perf.inc.php 7KB
PostAction.php 6KB
function.html_select_time.php 6KB
FileInfo.php 6KB
Case.php 6KB
Init.inc.php 6KB
function.html_image.php 5KB
Result.php 5KB
tohtml.inc.php 5KB
BugList.php 5KB
ResultList.php 4KB
class.config.php 4KB
CaseList.php 4KB
Config.inc.php 4KB
Config.Default.php 4KB
function.mailto.php 4KB
compile.section_start.php 4KB
SearchBug.php 4KB
SearchCase.php 4KB
compile.compile_if.php 4KB
function.popup.php 4KB
SearchResult.php 4KB
AdminModuleList.php 3KB
outputfilter.trimwhitespace.php 3KB
modifier.escape.php 3KB
adodb-errorhandler.inc.php 3KB
function.cycle.php 3KB
prefilter.jstrip.php 3KB
AdminEditGroup.php 3KB
共 263 条
- 1
- 2
- 3
资源评论
大黄鸭duck.
- 粉丝: 6731
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- base(1).apk.1
- K618977005_2012-12-6_beforeP_000.txt.PRM
- 秋招信息获取与处理基础教程
- 程序员面试笔试面经技巧基础教程
- Python实例-21个自动办公源码-数据处理技术+Excel+自动化脚本+资源管理
- 全球前8GDP数据图(python动态柱状图)
- 汽车检测7-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、TFRecord、VOC数据集合集.rar
- 检测高压线电线-YOLO(v5至v9)、COCO、Darknet、VOC数据集合集.rar
- 检测行路中的人脸-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、VOC数据集合集.rar
- Image_17083039753012.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功