Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
docker
osticket
Commits
514533c6
Commit
514533c6
authored
13 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Remove class.sys.php - no longer used
parent
44b0a5c5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/class.sys.php
+0
-107
0 additions, 107 deletions
include/class.sys.php
include/mysql.php
+0
-2
0 additions, 2 deletions
include/mysql.php
main.inc.php
+0
-1
0 additions, 1 deletion
main.inc.php
with
0 additions
and
110 deletions
include/class.sys.php
deleted
100644 → 0
+
0
−
107
View file @
44b0a5c5
<?php
/*************************************************************************
class.sys.php
System core helper.
Peter Rotich <peter@osticket.com>
Copyright (c) 2006-2012 osTicket
http://www.osticket.com
Released under the GNU General Public License WITHOUT ANY WARRANTY.
See LICENSE.TXT for details.
vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
require_once
(
INCLUDE_DIR
.
'class.config.php'
);
//Config helper
define
(
'LOG_WARN'
,
LOG_WARNING
);
class
Sys
{
var
$loglevel
=
array
(
1
=>
'Error'
,
'Warning'
,
'Debug'
);
//Load configuration info.
function
getConfig
()
{
$cfg
=
new
Config
(
1
);
return
(
$cfg
&&
$cfg
->
getId
())
?
$cfg
:
null
;
}
function
alertAdmin
(
$subject
,
$message
,
$log
=
false
)
{
global
$cfg
;
//Set admin's email address
if
(
!
$cfg
||
!
(
$to
=
$cfg
->
getAdminEmail
()))
$to
=
ADMIN_EMAIL
;
//Try getting the alert email.
$email
=
null
;
if
(
$cfg
&&
!
(
$email
=
$cfg
->
getAlertEmail
()))
$email
=
$cfg
->
getDefaultEmail
();
//will take the default email.
if
(
$email
)
{
$email
->
send
(
$to
,
$subject
,
$message
);
}
else
{
//no luck - try the system mail.
Email
::
sendmail
(
$to
,
$subject
,
$message
,
sprintf
(
'"osTicket Alerts"<%s>'
,
$to
));
}
//log the alert? Watch out for loops here.
if
(
$log
&&
is_object
(
$cfg
))
{
//if $cfg is not set then it means we don't have DB connection.
Sys
::
log
(
LOG_CRIT
,
$subject
,
$message
,
false
);
//Log the entry...and make sure no alerts are resent.
}
}
function
log
(
$priority
,
$title
,
$message
,
$alert
=
true
)
{
global
$cfg
;
switch
(
$priority
){
//We are providing only 3 levels of logs. Windows style.
case
LOG_EMERG
:
case
LOG_ALERT
:
case
LOG_CRIT
:
case
LOG_ERR
:
$level
=
1
;
if
(
$alert
)
{
Sys
::
alertAdmin
(
$title
,
$message
);
}
break
;
case
LOG_WARN
:
case
LOG_WARNING
:
//Warning...
$level
=
2
;
break
;
case
LOG_NOTICE
:
case
LOG_INFO
:
case
LOG_DEBUG
:
default
:
$level
=
3
;
//debug
}
//Save log based on system log level settings.
if
(
$cfg
&&
$cfg
->
getLogLevel
()
>=
$level
){
$loglevel
=
array
(
1
=>
'Error'
,
'Warning'
,
'Debug'
);
$sql
=
'INSERT INTO '
.
SYSLOG_TABLE
.
' SET created=NOW(),updated=NOW() '
.
',title='
.
db_input
(
$title
)
.
',log_type='
.
db_input
(
$loglevel
[
$level
])
.
',log='
.
db_input
(
$message
)
.
',ip_address='
.
db_input
(
$_SERVER
[
'REMOTE_ADDR'
]);
//echo $sql;
mysql_query
(
$sql
);
//don't use db_query to avoid possible loop.
}
}
function
purgeLogs
(){
global
$cfg
;
if
(
$cfg
&&
(
$gp
=
$cfg
->
getLogGracePeriod
())
&&
is_numeric
(
$gp
))
{
$sql
=
'DELETE FROM '
.
SYSLOG_TABLE
.
' WHERE DATE_ADD(created, INTERVAL '
.
$gp
.
' MONTH)<=NOW()'
;
db_query
(
$sql
);
}
}
}
?>
This diff is collapsed.
Click to expand it.
include/mysql.php
+
0
−
2
View file @
514533c6
...
@@ -16,8 +16,6 @@
...
@@ -16,8 +16,6 @@
vim: expandtab sw=4 ts=4 sts=4:
vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
**********************************************************************/
require_once
(
INCLUDE_DIR
.
'class.sys.php'
);
function
db_connect
(
$host
,
$user
,
$passwd
,
$db
=
""
)
{
function
db_connect
(
$host
,
$user
,
$passwd
,
$db
=
""
)
{
//Assert
//Assert
...
...
This diff is collapsed.
Click to expand it.
main.inc.php
+
0
−
1
View file @
514533c6
...
@@ -90,7 +90,6 @@
...
@@ -90,7 +90,6 @@
require
(
INCLUDE_DIR
.
'class.ostsession.php'
);
require
(
INCLUDE_DIR
.
'class.ostsession.php'
);
require
(
INCLUDE_DIR
.
'class.usersession.php'
);
require
(
INCLUDE_DIR
.
'class.usersession.php'
);
require
(
INCLUDE_DIR
.
'class.pagenate.php'
);
//Pagenate helper!
require
(
INCLUDE_DIR
.
'class.pagenate.php'
);
//Pagenate helper!
require
(
INCLUDE_DIR
.
'class.sys.php'
);
//system loader & config & logger.
require
(
INCLUDE_DIR
.
'class.log.php'
);
require
(
INCLUDE_DIR
.
'class.log.php'
);
require
(
INCLUDE_DIR
.
'class.mcrypt.php'
);
require
(
INCLUDE_DIR
.
'class.mcrypt.php'
);
require
(
INCLUDE_DIR
.
'class.misc.php'
);
require
(
INCLUDE_DIR
.
'class.misc.php'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment