Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
osticket
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
4ba80a36
Commit
4ba80a36
authored
10 years ago
by
Jared Hancock
Browse files
Options
Downloads
Patches
Plain Diff
kb: Add setting to enable only for authenticated clients
parent
e8cedfd6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/class.config.php
+14
-2
14 additions, 2 deletions
include/class.config.php
include/i18n/en_US/help/tips/settings.kb.yaml
+9
-0
9 additions, 0 deletions
include/i18n/en_US/help/tips/settings.kb.yaml
include/staff/settings-kb.inc.php
+6
-2
6 additions, 2 deletions
include/staff/settings-kb.inc.php
with
29 additions
and
4 deletions
include/class.config.php
+
14
−
2
View file @
4ba80a36
...
...
@@ -210,6 +210,13 @@ class OsticketConfig extends Config {
}
function
isKnowledgebaseEnabled
()
{
global
$thisclient
;
if
(
$this
->
get
(
'restrict_kb'
,
false
)
&&
(
!
$thisclient
||
$thisclient
->
isGuest
())
)
{
return
false
;
}
require_once
(
INCLUDE_DIR
.
'class.faq.php'
);
return
(
$this
->
get
(
'enable_kb'
)
&&
FAQ
::
countPublishedFAQs
());
}
...
...
@@ -1089,11 +1096,16 @@ class OsticketConfig extends Config {
function
updateKBSettings
(
$vars
,
&
$errors
)
{
if
(
$errors
)
return
false
;
if
(
$vars
[
'restrict_kb'
]
&&
!
$this
->
isClientRegistrationEnabled
())
$errors
[
'restrict_kb'
]
=
__
(
'The knowledge base cannot be restricted unless client registration is enabled'
);
if
(
$errors
)
return
false
;
return
$this
->
updateAll
(
array
(
'enable_kb'
=>
isset
(
$vars
[
'enable_kb'
])
?
1
:
0
,
'enable_premade'
=>
isset
(
$vars
[
'enable_premade'
])
?
1
:
0
,
'restrict_kb'
=>
isset
(
$vars
[
'restrict_kb'
])
?
1
:
0
,
'enable_premade'
=>
isset
(
$vars
[
'enable_premade'
])
?
1
:
0
,
));
}
...
...
This diff is collapsed.
Click to expand it.
include/i18n/en_US/help/tips/settings.kb.yaml
+
9
−
0
View file @
4ba80a36
...
...
@@ -28,6 +28,15 @@ knowledge_base_status:
-
title
:
Manage Knowledge Base
href
:
/scp/kb.php
restrict_kb
:
title
:
Resctrict Access to the Knowledge Base
content
:
>
Enable this setting to prevent unregistered users from accessing
your knowledge base articles on the client interface.
links
:
-
title
:
Access Control Settings
href
:
/scp/settings.php?t=access
canned_responses
:
title
:
Canned Responses
content
:
>
...
...
This diff is collapsed.
Click to expand it.
include/staff/settings-kb.inc.php
+
6
−
2
View file @
4ba80a36
...
...
@@ -16,12 +16,16 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config)
</thead>
<tbody>
<tr>
<td
width=
"180"
>
<?php
echo
__
(
'Knowledge Base Status'
);
?>
:
</td>
<td
width=
"180"
valign=
"top"
>
<?php
echo
__
(
'Knowledge Base Status'
);
?>
:
</td>
<td>
<input
type=
"checkbox"
name=
"enable_kb"
value=
"1"
<?php
echo
$config
[
'enable_kb'
]
?
'checked="checked"'
:
''
;
?>
>
<?php
echo
__
(
'Enable Knowledge Base'
);
?>
<font
class=
"error"
>
<?php
echo
$errors
[
'enable_kb'
];
?>
</font>
<i
class=
"help-tip icon-question-sign"
href=
"#knowledge_base_status"
></i>
<div
class=
"error"
>
<?php
echo
$errors
[
'enable_kb'
];
?>
</div>
<input
type=
"checkbox"
name=
"restrict_kb"
value=
"1"
<?php
echo
$config
[
'restrict_kb'
]
?
'checked="checked"'
:
''
;
?>
>
<?php
echo
__
(
'Require Client Login'
);
?>
<i
class=
"help-tip icon-question-sign"
href=
"#restrict_kb"
></i>
<div
class=
"error"
>
<?php
echo
$errors
[
'restrict_kb'
];
?>
</div>
</td>
</tr>
<tr>
...
...
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