Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
101845e4
Commit
101845e4
authored
Dec 15, 2006
by
Penny Leach
Browse files
added mechamism for check_upgrades to disable logins.
parent
5a9ad47d
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/admin/upgrade.json.php
View file @
101845e4
...
...
@@ -30,6 +30,10 @@ define('INSTALLER', 1);
require
(
dirname
(
dirname
(
__FILE__
))
.
'/init.php'
);
require
(
get_config
(
'libroot'
)
.
'upgrade.php'
);
$upgrade
=
check_upgrades
(
$name
);
if
(
empty
(
$upgrade
->
disablelogin
))
{
auth_setup
();
}
$install
=
param_boolean
(
'install'
);
if
(
!
$install
)
{
$name
=
param_variable
(
'name'
);
...
...
@@ -57,7 +61,6 @@ if ($install) {
json_reply
(
false
,
$message
);
}
$upgrade
=
check_upgrades
(
$name
);
$data
=
array
(
'key'
=>
$name
);
...
...
htdocs/admin/upgrade.php
View file @
101845e4
...
...
@@ -34,6 +34,10 @@ require(get_config('libroot') . 'upgrade.php');
$smarty
=
smarty
();
$upgrades
=
check_upgrades
();
if
(
empty
(
$upgrades
[
'disablelogin'
]))
{
auth_setup
();
}
if
(
!
$upgrades
)
{
die_info
(
get_string
(
'noupgrades'
,
'admin'
));
}
...
...
htdocs/lib/upgrade.php
View file @
101845e4
...
...
@@ -45,8 +45,12 @@ function check_upgrades($name=null) {
$toupgrade
=
array
();
$installing
=
false
;
$disablelogin
=
false
;
require
(
'version.php'
);
if
(
isset
(
$config
->
disablelogin
)
&&
!
empty
(
$config
->
disablelogin
))
{
$disablelogin
=
true
;
}
// check core first...
if
(
empty
(
$name
)
||
$name
==
'core'
)
{
try
{
...
...
@@ -64,6 +68,10 @@ function check_upgrades($name=null) {
$installing
=
true
;
}
else
if
(
$config
->
version
>
$coreversion
)
{
if
(
isset
(
$config
->
minupgradefrom
)
&&
$coreversion
<
$config
->
minupgradefrom
)
{
throw
new
ConfigSanityException
(
"Must upgrade to
$config->minupgradefrom
first "
.
" (you have
$coreversion
)"
);
}
$core
=
new
StdClass
;
$core
->
upgrade
=
true
;
$core
->
from
=
$coreversion
;
...
...
@@ -126,6 +134,9 @@ function check_upgrades($name=null) {
}
require
(
get_config
(
'docroot'
)
.
$pluginpath
.
'/version.php'
);
if
(
isset
(
$config
->
disablelogin
)
&&
!
empty
(
$config
->
disablelogin
))
{
$disablelogin
=
true
;
}
}
if
(
empty
(
$pluginversion
))
{
...
...
@@ -139,6 +150,10 @@ function check_upgrades($name=null) {
$toupgrade
[
$pluginkey
]
=
$plugininfo
;
}
else
if
(
$config
->
version
>
$pluginversion
)
{
if
(
isset
(
$config
->
minupgradefrom
)
&&
$pluginversion
<
$config
->
minupgradefrom
)
{
throw
new
ConfigSanityException
(
"Must upgrade to
$config->minupgradefrom
first "
.
" (you have
$pluginversion
)"
);
}
$plugininfo
=
new
StdClass
;
$plugininfo
->
upgrade
=
true
;
$plugininfo
->
from
=
$pluginversion
;
...
...
@@ -156,8 +171,10 @@ function check_upgrades($name=null) {
foreach
((
array
)
$toupgrade
[
$name
]
as
$key
=>
$value
)
{
$upgrade
->
{
$key
}
=
$value
;
}
$upgrade
->
disablelogin
=
$disablelogin
;
return
$upgrade
;
}
$toupgrade
[
'disablelogin'
]
=
$disablelogin
;
return
$toupgrade
;
}
...
...
Write
Preview
Supports
Markdown
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