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
550015dc
Commit
550015dc
authored
13 years ago
by
Peter Rotich
Browse files
Options
Downloads
Patches
Plain Diff
Add pending upgrade check
parent
88520be7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scp/admin.inc.php
+10
-15
10 additions, 15 deletions
scp/admin.inc.php
scp/staff.inc.php
+10
-11
10 additions, 11 deletions
scp/staff.inc.php
with
20 additions
and
26 deletions
scp/admin.inc.php
+
10
−
15
View file @
550015dc
...
@@ -15,34 +15,29 @@
...
@@ -15,34 +15,29 @@
**********************************************************************/
**********************************************************************/
require
(
'staff.inc.php'
);
require
(
'staff.inc.php'
);
//Make sure config is loaded and the staff is set and of admin type
//Make sure config is loaded and the staff is set and of admin type
if
(
!
$cfg
or
!
$thisstaff
or
!
$thisstaff
->
isadmin
()){
if
(
!
$cfg
or
!
$thisstaff
or
!
$thisstaff
->
isadmin
())
{
header
(
'Location: index.php'
);
header
(
'Location: index.php'
);
require
(
'index.php'
);
// just in case!
require
(
'index.php'
);
// just in case!
exit
;
exit
;
}
}
//Some security related warnings - bitch until fixed!!! :)
//Some security related warnings - bitch until fixed!!! :)
if
(
defined
(
'THIS_VERSION'
)
&&
strcasecmp
(
$cfg
->
getVersion
(),
THIS_VERSION
))
{
if
(
$cfg
->
isUpgradePending
())
{
$sysnotice
=
sprintf
(
'The script is version %s while the database is version %s.'
,
THIS_VERSION
,
$cfg
->
getVersion
());
$errors
[
'err'
]
=
$sysnotice
=
'System upgrade is pending <a href="../setup/upgrade.php">Upgrade Now</a>'
;
if
(
file_exists
(
'../setup/'
))
}
elseif
(
!
$cfg
->
isHelpDeskOffline
())
{
$sysnotice
.
=
' Possibly caused by incomplete <a href="../setup/upgrade.php">upgrade</a>.'
;
$errors
[
'err'
]
=
$sysnotice
;
if
(
file_exists
(
'../setup/'
))
{
}
elseif
(
!
$cfg
->
isHelpDeskOffline
())
{
$sysnotice
=
'Please take a minute to delete <strong>setup/install</strong> directory (../setup/) for security reasons.'
;
if
(
file_exists
(
'../setup/'
)){
}
elseif
(
CONFIG_FILE
&&
file_exists
(
CONFIG_FILE
)
&&
is_writable
(
CONFIG_FILE
))
{
$sysnotice
=
'Please take a minute to delete <strong>setup/install</strong> directory for security reasons.'
;
}
else
{
if
(
CONFIG_FILE
&&
file_exists
(
CONFIG_FILE
)
&&
is_writable
(
CONFIG_FILE
))
{
//Confirm for real that the file is writable by group or world.
//Confirm for real that the file is writable by group or world.
clearstatcache
();
//clear the cache!
clearstatcache
();
//clear the cache!
$perms
=
@
fileperms
(
CONFIG_FILE
);
$perms
=
@
fileperms
(
CONFIG_FILE
);
if
((
$perms
&
0x0002
)
||
(
$perms
&
0x0010
))
{
if
((
$perms
&
0x0002
)
||
(
$perms
&
0x0010
))
{
$sysnotice
=
sprintf
(
'Please change permission of config file (%s) to remove write access. e.g <i>chmod 644 %s</i>'
,
$sysnotice
=
sprintf
(
'Please change permission of config file (%s) to remove write access. e.g <i>chmod 644 %s</i>'
,
basename
(
CONFIG_FILE
),
basename
(
CONFIG_FILE
));
basename
(
CONFIG_FILE
),
basename
(
CONFIG_FILE
));
}
}
}
}
}
if
(
!
$sysnotice
&&
ini_get
(
'register_globals'
))
if
(
!
$sysnotice
&&
ini_get
(
'register_globals'
))
$sysnotice
=
'Please consider turning off register globals if possible'
;
$sysnotice
=
'Please consider turning off register globals if possible'
;
}
}
...
...
This diff is collapsed.
Click to expand it.
scp/staff.inc.php
+
10
−
11
View file @
550015dc
...
@@ -63,19 +63,19 @@ if(!$thisstaff || !is_object($thisstaff) || !$thisstaff->getId() || !$thisstaff-
...
@@ -63,19 +63,19 @@ if(!$thisstaff || !is_object($thisstaff) || !$thisstaff->getId() || !$thisstaff-
exit
;
exit
;
}
}
//2) if not super admin..check system status and group status
//2) if not super admin..check system status and group status
if
(
!
$thisstaff
->
isadmin
()){
if
(
!
$thisstaff
->
isadmin
())
{
//Staff are not allowed to login in offline mode!!
if
(
$cfg
->
isHelpDeskOffline
()){
staffLoginPage
(
'System Offline'
);
exit
;
}
//Check for disabled staff or group!
//Check for disabled staff or group!
if
(
!
$thisstaff
->
isactive
()
||
!
$thisstaff
->
isGroupActive
())
{
if
(
!
$thisstaff
->
isactive
()
||
!
$thisstaff
->
isGroupActive
())
{
staffLoginPage
(
'Access Denied. Contact Admin'
);
staffLoginPage
(
'Access Denied. Contact Admin'
);
exit
;
exit
;
}
}
}
//Staff are not allowed to login in offline mode!!
if
(
$cfg
->
isHelpDeskOffline
()
||
$cfg
->
isUpgradePending
())
{
staffLoginPage
(
'System Offline'
);
exit
;
}
}
//Keep the session activity alive
//Keep the session activity alive
$thisstaff
->
refreshSession
();
$thisstaff
->
refreshSession
();
...
@@ -93,10 +93,9 @@ $errors=array();
...
@@ -93,10 +93,9 @@ $errors=array();
$msg
=
$warn
=
$sysnotice
=
''
;
$msg
=
$warn
=
$sysnotice
=
''
;
$tabs
=
array
();
$tabs
=
array
();
$submenu
=
array
();
$submenu
=
array
();
if
(
$cfg
->
isUpgradePending
())
{
if
(
defined
(
'THIS_VERSION'
)
&&
strcasecmp
(
$cfg
->
getVersion
(),
THIS_VERSION
))
{
$errors
[
'err'
]
=
$sysnotice
=
'System upgrade is pending <a href="../setup/upgrade.php">Upgrade Now</a>'
;
$errors
[
'err'
]
=
$sysnotice
=
sprintf
(
'The script is version %s while the database is version %s'
,
THIS_VERSION
,
$cfg
->
getVersion
());
}
elseif
(
$cfg
->
isHelpDeskOffline
())
{
}
elseif
(
$cfg
->
isHelpDeskOffline
()){
$sysnotice
=
'<strong>System is set to offline mode</strong> - Client interface is disabled and ONLY admins can access staff control panel.'
;
$sysnotice
=
'<strong>System is set to offline mode</strong> - Client interface is disabled and ONLY admins can access staff control panel.'
;
$sysnotice
.
=
' <a href="settings.php">Enable</a>.'
;
$sysnotice
.
=
' <a href="settings.php">Enable</a>.'
;
}
}
...
...
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