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
1c11c660
Commit
1c11c660
authored
Aug 19, 2008
by
Richard Mansfield
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When a db upgrade is waiting, redirect admins to upgrade page & disable non-admin logins
parent
684ddc35
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
0 deletions
+27
-0
htdocs/auth/lib.php
htdocs/auth/lib.php
+4
-0
htdocs/index.php
htdocs/index.php
+1
-0
htdocs/init.php
htdocs/init.php
+14
-0
htdocs/lang/en.utf8/mahara.php
htdocs/lang/en.utf8/mahara.php
+2
-0
htdocs/lib/web.php
htdocs/lib/web.php
+1
-0
htdocs/theme/default/static/style/style.css
htdocs/theme/default/static/style/style.css
+4
-0
htdocs/theme/default/templates/header.tpl
htdocs/theme/default/templates/header.tpl
+1
-0
No files found.
htdocs/auth/lib.php
View file @
1c11c660
...
...
@@ -355,6 +355,10 @@ function auth_setup () {
return
;
}
// Lock the site until core upgrades are done
require_once
(
get_config
(
'libroot'
)
.
'version.php'
);
set_config
(
'siteclosed'
,
$config
->
version
>
get_config
(
'version'
));
// Check the time that the session is set to log out. If the user does
// not have a session, this time will be 0.
$sessionlogouttime
=
$USER
->
get
(
'logout_time'
);
...
...
htdocs/index.php
View file @
1c11c660
...
...
@@ -27,6 +27,7 @@
define
(
'INTERNAL'
,
1
);
define
(
'PUBLIC'
,
1
);
define
(
'MENUITEM'
,
''
);
define
(
'HOME'
,
1
);
require
(
'init.php'
);
define
(
'TITLE'
,
get_string
(
'home'
));
...
...
htdocs/init.php
View file @
1c11c660
...
...
@@ -206,6 +206,20 @@ if (!defined('INSTALLER')) {
auth_setup
();
}
if
(
get_config
(
'siteclosed'
))
{
if
(
$USER
->
admin
&&
!
defined
(
'INSTALLER'
))
{
redirect
(
'/admin/upgrade.php'
);
}
if
(
!
$USER
->
admin
)
{
if
(
$USER
->
is_logged_in
())
{
$USER
->
logout
();
}
if
(
!
defined
(
'HOME'
))
{
redirect
();
}
}
}
// check to see if we're installed...
if
(
!
get_config
(
'installed'
)
&&
false
===
strpos
(
$_SERVER
[
'SCRIPT_FILENAME'
],
'admin/index.php'
)
...
...
htdocs/lang/en.utf8/mahara.php
View file @
1c11c660
...
...
@@ -400,6 +400,8 @@ $string['useradministration'] = 'User Administration';
$string
[
'unreadmessages'
]
=
'unread messages'
;
$string
[
'unreadmessage'
]
=
'unread message'
;
$string
[
'siteclosed'
]
=
'The site is temporarily closed for a database upgrade. Site administrators may log in.'
;
// footer
$string
[
'termsandconditions'
]
=
'Terms and Conditions'
;
$string
[
'privacystatement'
]
=
'Privacy Statement'
;
...
...
htdocs/lib/web.php
View file @
1c11c660
...
...
@@ -367,6 +367,7 @@ EOF;
$smarty
->
assign
(
'SESSKEY'
,
$USER
->
get
(
'sesskey'
));
$smarty
->
assign_by_ref
(
'JAVASCRIPT'
,
$javascript_array
);
$smarty
->
assign_by_ref
(
'HEADERS'
,
$headers
);
$smarty
->
assign
(
'SITECLOSED'
,
get_config
(
'siteclosed'
));
if
((
!
isset
(
$extraconfig
[
'pagehelp'
])
||
$extraconfig
[
'pagehelp'
]
!==
false
)
and
$help
=
has_page_help
())
{
...
...
htdocs/theme/default/static/style/style.css
View file @
1c11c660
...
...
@@ -566,6 +566,10 @@ tr.required th,
#logo
{
padding
:
0
;
}
.sitemessage
{
text-align
:
center
;
color
:
#cc0000
;
}
/* search box in header */
.searchbox
{
font-size
:
11px
;
...
...
htdocs/theme/default/templates/header.tpl
View file @
1c11c660
...
...
@@ -59,6 +59,7 @@
{/
if
}
</table>
<div
id=
"logo"
><a
href=
"
{
$WWWROOT
}
"
><img
src=
"
{
theme_path
location
=
'images/logo.gif'
}
"
border=
"0"
alt=
""
></a></div>
{
if
$SITECLOSED
}
<div
class=
"sitemessage"
>
{
str
tag
=
siteclosed
}
</div>
{/
if
}
<h1
class=
"hidden"
><a
href=
"
{
$WWWROOT
}
"
>
{
$hiddenheading
|
default
:
"Mahara"
|
escape
}
</a></h1>
{
if
$MAINNAV
}
<div
id=
"mainnav"
>
...
...
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