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
28714c43
Commit
28714c43
authored
Nov 28, 2007
by
Richard Mansfield
Browse files
Show admin header link for institutional admins
parent
2297d50a
Changes
2
Show whitespace changes
Inline
Side-by-side
htdocs/auth/user.php
View file @
28714c43
...
...
@@ -83,6 +83,7 @@ class User {
'accountprefs'
=>
array
(),
'activityprefs'
=>
array
(),
'institutions'
=>
array
(),
'admininstitutions'
=>
array
(),
'sesskey'
=>
''
);
$this
->
attributes
=
array
();
...
...
@@ -345,7 +346,6 @@ class User {
return
true
;
}
public
function
join_institution
(
$institution
)
{
$institutions
=
$this
->
get
(
'institutions'
);
if
(
!
isset
(
$institutions
[
$institution
]))
{
...
...
@@ -357,6 +357,16 @@ class User {
}
}
public
function
in_institution
(
$institution
,
$role
=
null
)
{
$institutions
=
$this
->
get
(
'institutions'
);
return
isset
(
$institutions
[
$institution
])
&&
(
is_null
(
$role
)
||
$institutions
[
$institution
]
->
{
$role
});
}
public
function
is_institutional_admin
()
{
$a
=
$this
->
get
(
'admininstitutions'
);
return
!
empty
(
$a
);
}
}
...
...
@@ -453,7 +463,15 @@ class LiveUser extends User {
if
(
empty
(
$user
->
id
))
$this
->
commit
();
$this
->
activityprefs
=
load_activity_preferences
(
$user
->
id
);
$this
->
accountprefs
=
load_account_preferences
(
$user
->
id
);
$this
->
institutions
=
load_user_institutions
(
$user
->
id
);
$institutions
=
load_user_institutions
(
$user
->
id
);
$admininstitutions
=
array
();
foreach
(
$institutions
as
$i
)
{
if
(
$i
->
admin
)
{
$admininstitutions
[
$i
->
institution
]
=
true
;
}
}
$this
->
institutions
=
$institutions
;
$this
->
admininstitutions
=
$admininstitutions
;
$this
->
commit
();
}
...
...
htdocs/theme/default/templates/header.tpl
View file @
28714c43
...
...
@@ -35,11 +35,13 @@
<div
id=
"globalTabs"
>
<ul>
<li
id=
"globalnav-logout"
><a
href=
"
{
$WWWROOT
}
?logout"
>
Logout
</a></li>
{
if
$USER
->
get
(
'admin'
)
}
{
if
$ADMIN
}
{
if
$USER
->
get
(
'admin'
)
||
$USER
->
is_institutional_admin
()
}
{
if
$ADMIN
||
$INSTITUTIONALADMIN
}
<li
id=
"globalnav-returntosite"
><a
href=
"
{
$WWWROOT
}
"
>
Return to Site
</a></li>
{
else
}
{
else
if
$USER
->
get
(
'admin'
)
}
<li
id=
"globalnav-siteadmin"
><a
href=
"
{
$WWWROOT
}
admin/"
>
Site Administration
</a></li>
{
else
}
<li
id=
"globalnav-siteadmin"
><a
href=
"
{
$WWWROOT
}
admin/"
>
User Administration
</a></li>
{/
if
}
{* <li><a href="" onclick="createLoggingPane(); return false;">Create Logging Pane</a></li> *}
{/
if
}
...
...
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