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
80288da1
Commit
80288da1
authored
Dec 01, 2020
by
Lisa Seeto
Committed by
Gerrit Code Review
Dec 01, 2020
Browse files
Merge "Bug 1903205: Only show migrate account link if it is possible to do"
parents
9fb22ac0
77b2a3e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/account/institutions.php
View file @
80288da1
...
...
@@ -227,13 +227,21 @@ function requestmembership_submit(Pieform $form, $values) {
redirect
(
get_config
(
'wwwroot'
)
.
'account/institutions.php'
);
}
try
{
$migrateallowed
=
auth_configure_session_handlers
(
"saml"
);
}
catch
(
ConfigSanityException
$e
)
{
$migrateallowed
=
false
;
}
$smarty
=
smarty
();
setpageicon
(
$smarty
,
'icon-university'
);
$smarty
->
assign
(
'migrateallowed'
,
$migrateallowed
);
$smarty
->
assign
(
'memberform'
,
$memberform
);
$smarty
->
assign
(
'requestedform'
,
$requestedform
);
$smarty
->
assign
(
'invitedform'
,
$invitedform
);
$smarty
->
assign
(
'joinform'
,
$joinform
);
$smarty
->
assign
(
'migrateurl'
,
get_config
(
'wwwroot'
)
.
'account/migrateinstitution.php'
);
$smarty
->
assign
(
'sitename'
,
get_config
(
'sitename'
));
$smarty
->
assign
(
'SUBPAGENAV'
,
account_institution_get_menu_tabs
());
$smarty
->
assign
(
'SUBPAGENAV'
,
account_institution_get_menu_tabs
(
$migrateallowed
));
$smarty
->
display
(
'account/institutions.tpl'
);
htdocs/lib/web.php
View file @
80288da1
...
...
@@ -5035,21 +5035,23 @@ function is_valid_url($url) {
return
true
;
}
function
account_institution_get_menu_tabs
()
{
function
account_institution_get_menu_tabs
(
$migrate
=
true
)
{
$menu
=
array
(
'institutions'
=>
array
(
'path'
=>
'settings/institutions'
,
'url'
=>
'account/institutions.php'
,
'title'
=>
get_string
(
'currentinstitutionmembership'
),
'weight'
=>
10
,
),
'migrateinstitution'
=>
array
(
)
);
if
(
$migrate
)
{
$menu
[
'migrateinstitution'
]
=
array
(
'path'
=>
'settings/institutions'
,
'url'
=>
'account/migrateinstitution.php'
,
'title'
=>
get_string
(
'selfmigration'
),
'weight'
=>
20
,
)
,
);
)
;
}
if
(
defined
(
'SECTION_PAGE'
))
{
$key
=
SECTION_PAGE
;
...
...
htdocs/theme/raw/templates/account/institutions.tpl
View file @
80288da1
...
...
@@ -7,12 +7,12 @@
{
$memberform
|
safe
}
</div>
{/
if
}
{
if
$migrateallowed
}
<div
class=
"view-container"
>
<h2>
{
str
tag
=
selfmigrate
}
</h2>
{
str
tag
=
migrateinstitutionpagelink
section
=
mahara
arg1
=
$migrateurl
arg2
=
$sitename
}
</div>
{/
if
}
{
if
$requestedform
}
<div
class=
"view-container"
>
<h2>
{
str
tag
=
Requests
}
</h2>
...
...
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