CMS
Version 3.9
toggle_share.inc
Go to the documentation of this file.
1
<?php
2
Fakoli::using
(
"sharing"
);
3
$share_id
= checkNumeric($_GET[
"share_id"
]);
4
$work_area_id
= checkNumeric($_GET[
"work_area_id"
]);
5
6
if
(!
$work_area_id
|| !
$share_id
)
7
{
8
Fakoli::end
(
"Missing Parameter"
);
9
}
10
11
$workArea
=
new
WorkArea(
$work_area_id
);
12
$share
=
new
ShareToken
(
$share_id
);
13
14
if
(!checkRole(
"admin,data"
) &&
$user
->user_id !=
$share
->user_id && !
$workArea
->isManager())
15
{
16
Fakoli::end
(
"Permission Denied"
);
17
}
18
19
$share
->active = !
$share
->active;
20
$share
->last_updated = now();
21
$share
->last_updated_by_id =
$user
->user_id;
22
$share
->save();
23
24
Fakoli::end
(
"OK"
);
Fakoli\using
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition:
core.inc:116
Fakoli\end
static end($message="")
Use this method to terminate execution of a script instead of using the php keywords exit() or die().
Definition:
core.inc:1149
ShareToken
Definition:
share_token.inc:8
$user
global $user
Definition:
comment_form.inc:16
$share_id
$share_id
Definition:
toggle_share.inc:3
$workArea
if(! $work_area_id||! $share_id) $workArea
Definition:
toggle_share.inc:11
$share
$share
Definition:
toggle_share.inc:12
$work_area_id
$work_area_id
Definition:
toggle_share.inc:4
code
cms.sonjara.com
cms
components
sharing
handlers
toggle_share.inc
Generated on Tue Mar 23 2021 15:36:14 for CMS by
1.9.1