Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
eb8070d3
Commit
eb8070d3
authored
Nov 06, 2006
by
Nigel McNie
Committed by
Nigel McNie
Nov 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added checking for if the internal plugins are installed.
parent
be38eb8f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
htdocs/init.php
htdocs/init.php
+1
-0
htdocs/lib/mahara.php
htdocs/lib/mahara.php
+16
-6
No files found.
htdocs/init.php
View file @
eb8070d3
...
...
@@ -100,6 +100,7 @@ try {
$db
->
SetFetchMode
(
ADODB_FETCH_ASSOC
);
configure_dbconnection
();
ensure_internal_plugins_exist
();
ob_end_clean
();
}
...
...
htdocs/lib/mahara.php
View file @
eb8070d3
...
...
@@ -58,7 +58,7 @@ function ensure_sanity() {
// register globals workaround
if
(
ini_get_bool
(
'register_globals'
))
{
log_environ
(
get_string
(
'registerglobals'
,
'error'
));
$massivearray
=
array_keys
(
array_merge
(
$_POST
,
$_GET
,
$_COOKIE
,
$_SERVER
,
$_REQUEST
,
$_FILES
));
$massivearray
=
array_keys
(
array_merge
(
$_POST
,
$_GET
,
$_COOKIE
,
$_SERVER
,
$_REQUEST
,
$_FILES
));
foreach
(
$massivearray
as
$tounset
)
{
unset
(
$GLOBALS
[
$tounset
]);
}
...
...
@@ -120,16 +120,26 @@ function ensure_sanity() {
throw
new
ConfigSanityException
(
get_string
(
'datarootnotwritable'
,
'error'
,
get_config
(
'dataroot'
)));
}
// Json functions not available
//if (!function_exists('json_encode') || !function_exists('json_decode')) {
// throw new ConfigSanityException(get_string('jsonextensionnotloaded', 'error'));
//}
// @todo the results of these should be checked
check_dir_exists
(
get_config
(
'dataroot'
)
.
'smarty/compile'
);
check_dir_exists
(
get_config
(
'dataroot'
)
.
'smarty/cache'
);
}
/**
* Check to see if the internal plugins are installed. Die if they are not.
*/
function
ensure_internal_plugins_exist
()
{
// Internal things installed
if
(
!
get_config
(
'installed'
))
{
foreach
(
plugin_types
()
as
$type
)
{
if
(
!
record_exists
(
$type
.
'_installed'
,
'name'
,
'internal'
))
{
throw
new
ConfigSanityException
(
get_string
(
$type
.
'notinstalled'
));
}
}
}
}
function
get_string
(
$identifier
,
$section
=
'mahara'
)
{
$langconfigstrs
=
array
(
'parentlanguage'
,
'strftimedate'
,
'strftimedateshort'
,
'strftimedatetime'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment