Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-core
Commits
8070ad5b
Commit
8070ad5b
authored
Apr 04, 2006
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added a permission check to offices
parent
f4b30895
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
16 deletions
+41
-16
intranet-office-procs.tcl
tcl/intranet-office-procs.tcl
+41
-16
No files found.
tcl/intranet-office-procs.tcl
View file @
8070ad5b
...
...
@@ -305,25 +305,49 @@ where
ad_proc -public im_office_user_component
{
current_user_id user_id
}
{
ad_proc -public im_office_user_component
{
current_user_id
user_id
}
{
Creates a HTML table showing the table of offices related to the
specified user.
}
{
set bgcolor
(
0
)
" class=roweven"
set bgcolor
(
1
)
" class=rowodd"
set office_view_page
"/intranet/offices/view"
set subsite_id
[
ad_conn subsite_id
]
set sql
"
select
o.*,
im_category_from_id(o.office_type_id) as office_type
from
im_offices o,
acs_rels r
where
r.object_id_one = o.office_id
and r.object_id_two = :user_id
"
select
o.*,
im_category_from_id(o.office_type_id) as office_type
from
(select
o.*,
m.member_p as permission_member,
see_all.see_all as permission_all
from
acs_rels r,
( select count(*) as see_all
from acs_object_party_privilege_map
where object_id = :subsite_id
and party_id = :current_user_id
and privilege='view_offices_all'
) see_all,
im_offices o left outer join
( select count(rel_id) as member_p,
object_id_one as object_id
from acs_rels
where object_id_two = :current_user_id
group by object_id_one
) m on (o.office_id = m.object_id)
where
r.object_id_one = o.office_id
and r.object_id_two = :user_id
) o
where
(o.permission_member > 0 OR o.permission_all > 0)
"
set component_html
"
<table cellspacing=1 cellpadding=1>
...
...
@@ -346,22 +370,23 @@ where
incr ctr
}
if
{
$ctr
== 1
}
{
append component_html
"<tr><td colspan=2>
[
_ intranet-core.No_offices_found
]
</td></tr>
\n
"
# Skip the office component completely, because
# the current_user probably doesn't have permissions
# to see anything
# append component_html
"<tr><td colspan=2>
[
_ intranet-core.No_offices_found
]
</td></tr>
\n
"
return
""
}
append component_html
"</table>
\n
"
return
$component
_html
}
# -----------------------------------------------------------
# Nuke a office
# -----------------------------------------------------------
ad_proc im_office_nuke
{
office_id
}
{
Nuke
(
complete delete from the database
)
a office
}
{
...
...
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