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
aee963ae
Commit
aee963ae
authored
12 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Detect old versions before 1.7 which do not support DB based session handler. Add logDBError
parent
8005eb2e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/class.osticket.php
+18
-3
18 additions, 3 deletions
include/class.osticket.php
with
18 additions
and
3 deletions
include/class.osticket.php
+
18
−
3
View file @
aee963ae
...
@@ -35,7 +35,14 @@ class osTicket {
...
@@ -35,7 +35,14 @@ class osTicket {
function
osTicket
(
$cfgId
)
{
function
osTicket
(
$cfgId
)
{
$this
->
config
=
Config
::
lookup
(
$cfgId
);
$this
->
config
=
Config
::
lookup
(
$cfgId
);
$this
->
session
=
osTicketSession
::
start
(
SESSION_TTL
);
// start_session
//DB based session storage was added starting with v1.7
// which does NOT have DB Version
if
(
$this
->
config
&&
!
$this
->
getConfig
()
->
getDBversion
())
$this
->
session
=
osTicketSession
::
start
(
SESSION_TTL
);
// start DB based session
else
session_start
();
}
}
function
isSystemOnline
()
{
function
isSystemOnline
()
{
...
@@ -163,6 +170,14 @@ class osTicket {
...
@@ -163,6 +170,14 @@ class osTicket {
return
$this
->
log
(
LOG_ERR
,
$title
,
$error
,
$alert
);
return
$this
->
log
(
LOG_ERR
,
$title
,
$error
,
$alert
);
}
}
function
logDBError
(
$title
,
$error
,
$alert
=
true
)
{
if
(
$alert
&&
!
$this
->
getConfig
()
->
alertONSQLError
())
$alert
=
false
;
return
$this
->
log
(
LOG_ERR
,
$title
,
$error
,
$alert
);
}
function
log
(
$priority
,
$title
,
$message
,
$alert
=
false
)
{
function
log
(
$priority
,
$title
,
$message
,
$alert
=
false
)
{
//We are providing only 3 levels of logs. Windows style.
//We are providing only 3 levels of logs. Windows style.
...
@@ -188,8 +203,8 @@ class osTicket {
...
@@ -188,8 +203,8 @@ class osTicket {
if
(
$alert
)
if
(
$alert
)
$this
->
alertAdmin
(
$title
,
$message
);
$this
->
alertAdmin
(
$title
,
$message
);
//Logging everything during upgrade.
if
(
$this
->
getConfig
()
->
getLogLevel
()
<
$level
)
if
(
$this
->
getConfig
()
->
getLogLevel
()
<
$level
&&
!
$this
->
isUpgradePending
()
)
return
false
;
return
false
;
//Save log based on system log level settings.
//Save log based on system log level settings.
...
...
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