Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/calendar/ajax/share/unshare.php')
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/share/unshare.php21
1 files changed, 10 insertions, 11 deletions
diff --git a/apps/calendar/ajax/share/unshare.php b/apps/calendar/ajax/share/unshare.php
index ec3150a89aa..cbd5ed8e505 100644..100755
--- a/apps/calendar/ajax/share/unshare.php
+++ b/apps/calendar/ajax/share/unshare.php
@@ -5,7 +5,7 @@
* later.
* See the COPYING-README file.
*/
-require_once('../../../../lib/base.php');
+
$id = strip_tags($_GET['id']);
$idtype = strip_tags($_GET['idtype']);
switch($idtype){
@@ -13,7 +13,7 @@ switch($idtype){
case 'event':
break;
default:
- OC_JSON::error(array('message'=>'unexspected parameter'));
+ OCP\JSON::error(array('message'=>'unexspected parameter'));
exit;
}
$sharewith = $_GET['sharewith'];
@@ -24,21 +24,20 @@ switch($sharetype){
case 'public':
break;
default:
- OC_JSON::error(array('message'=>'unexspected parameter'));
+ OCP\JSON::error(array('message'=>'unexspected parameter'));
exit;
}
-if($sharetype == 'user' && !OC_User::userExists($sharewith)){
- OC_JSON::error(array('message'=>'user not found'));
+if($sharetype == 'user' && !OCP\User::userExists($sharewith)){
+ OCP\JSON::error(array('message'=>'user not found'));
exit;
-}
-if($sharetype == 'group' && !OC_Group::groupExists($sharewith)){
- OC_JSON::error(array('message'=>'group not found'));
+}elseif($sharetype == 'group' && !OC_Group::groupExists($sharewith)){
+ OCP\JSON::error(array('message'=>'group not found'));
exit;
}
-$success = OC_Calendar_Share::unshare(OC_User::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::Event));
+$success = OC_Calendar_Share::unshare(OCP\USER::getUser(), $sharewith, $sharetype, $id, (($idtype=='calendar') ? OC_Calendar_Share::CALENDAR : OC_Calendar_Share::EVENT));
if($success){
- OC_JSON::success();
+ OCP\JSON::success();
}else{
- OC_JSON::error(array('message'=>'can not unshare'));
+ OCP\JSON::error(array('message'=>'can not unshare'));
exit;
} \ No newline at end of file