diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-09-12 01:06:57 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-09-12 01:06:57 -0400 |
commit | 60feaf9abfbc60d950de9c2b820ad46b3b973eb3 (patch) | |
tree | f9931192ec8f3cf20840f87462592bf5a03b4af1 /core/ajax | |
parent | b194ac3ddeeab6ce923a313725b3ce85fe849baa (diff) | |
parent | 54d4e556fe3302d1e580cb6d4abbfcd5699263a5 (diff) | |
download | nextcloud-server-60feaf9abfbc60d950de9c2b820ad46b3b973eb3.tar.gz nextcloud-server-60feaf9abfbc60d950de9c2b820ad46b3b973eb3.zip |
Merge branch 'master' into share_expiration
Conflicts:
core/js/share.js
lib/util.php
Diffstat (limited to 'core/ajax')
-rw-r--r-- | core/ajax/appconfig.php | 12 | ||||
-rw-r--r-- | core/ajax/share.php | 38 | ||||
-rw-r--r-- | core/ajax/translations.php | 2 | ||||
-rw-r--r-- | core/ajax/vcategories/add.php | 6 | ||||
-rw-r--r-- | core/ajax/vcategories/delete.php | 6 | ||||
-rw-r--r-- | core/ajax/vcategories/edit.php | 8 |
6 files changed, 35 insertions, 37 deletions
diff --git a/core/ajax/appconfig.php b/core/ajax/appconfig.php index bf749be3e30..1b43afa74fb 100644 --- a/core/ajax/appconfig.php +++ b/core/ajax/appconfig.php @@ -5,18 +5,18 @@ * See the COPYING-README file. */ -require_once ("../../lib/base.php"); +require_once "../../lib/base.php"; OC_Util::checkAdminUser(); OCP\JSON::callCheck(); $action=isset($_POST['action'])?$_POST['action']:$_GET['action']; $result=false; -switch($action){ +switch($action) { case 'getValue': - $result=OC_Appconfig::getValue($_GET['app'],$_GET['key'],$_GET['defaultValue']); + $result=OC_Appconfig::getValue($_GET['app'], $_GET['key'], $_GET['defaultValue']); break; case 'setValue': - $result=OC_Appconfig::setValue($_POST['app'],$_POST['key'],$_POST['value']); + $result=OC_Appconfig::setValue($_POST['app'], $_POST['key'], $_POST['value']); break; case 'getApps': $result=OC_Appconfig::getApps(); @@ -25,10 +25,10 @@ switch($action){ $result=OC_Appconfig::getKeys($_GET['app']); break; case 'hasKey': - $result=OC_Appconfig::hasKey($_GET['app'],$_GET['key']); + $result=OC_Appconfig::hasKey($_GET['app'], $_GET['key']); break; case 'deleteKey': - $result=OC_Appconfig::deleteKey($_POST['app'],$_POST['key']); + $result=OC_Appconfig::deleteKey($_POST['app'], $_POST['key']); break; case 'deleteApp': $result=OC_Appconfig::deleteApp($_POST['app']); diff --git a/core/ajax/share.php b/core/ajax/share.php index 8c2e85523e3..b615cfd3541 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -78,7 +78,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo $reshare = false; } if ($_GET['checkShares'] == 'true') { - $shares = OCP\Share::getItemShared($_GET['itemType'], $_GET['itemSource']); + $shares = OCP\Share::getItemShared($_GET['itemType'], $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true); } else { $shares = false; } @@ -88,23 +88,23 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo case 'getShareWith': if (isset($_GET['search'])) { $shareWith = array(); - if (OC_App::isEnabled('contacts')) { - // TODO Add function to contacts to only get the 'fullname' column to improve performance - $ids = OC_Contacts_Addressbook::activeIds(); - foreach ($ids as $id) { - $vcards = OC_Contacts_VCard::all($id); - foreach ($vcards as $vcard) { - $contact = $vcard['fullname']; - if (stripos($contact, $_GET['search']) !== false - && (!isset($_GET['itemShares']) - || !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_CONTACT]) - || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_CONTACT]) - || !in_array($contact, $_GET['itemShares'][OCP\Share::SHARE_TYPE_CONTACT]))) { - $shareWith[] = array('label' => $contact, 'value' => array('shareType' => 5, 'shareWith' => $vcard['id'])); - } - } - } - } +// if (OC_App::isEnabled('contacts')) { +// // TODO Add function to contacts to only get the 'fullname' column to improve performance +// $ids = OC_Contacts_Addressbook::activeIds(); +// foreach ($ids as $id) { +// $vcards = OC_Contacts_VCard::all($id); +// foreach ($vcards as $vcard) { +// $contact = $vcard['fullname']; +// if (stripos($contact, $_GET['search']) !== false +// && (!isset($_GET['itemShares']) +// || !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_CONTACT]) +// || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_CONTACT]) +// || !in_array($contact, $_GET['itemShares'][OCP\Share::SHARE_TYPE_CONTACT]))) { +// $shareWith[] = array('label' => $contact, 'value' => array('shareType' => 5, 'shareWith' => $vcard['id'])); +// } +// } +// } +// } $count = 0; $users = array(); $limit = 0; @@ -141,5 +141,3 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo break; } } - -?>
\ No newline at end of file diff --git a/core/ajax/translations.php b/core/ajax/translations.php index 2bd6b7ed634..75679da2c04 100644 --- a/core/ajax/translations.php +++ b/core/ajax/translations.php @@ -22,7 +22,7 @@ */ // Init owncloud -require_once('../../lib/base.php'); +require_once '../../lib/base.php'; $app = $_POST["app"]; diff --git a/core/ajax/vcategories/add.php b/core/ajax/vcategories/add.php index e69f8bb726b..81fa06dbf19 100644 --- a/core/ajax/vcategories/add.php +++ b/core/ajax/vcategories/add.php @@ -7,14 +7,14 @@ */ function bailOut($msg) { OC_JSON::error(array('data' => array('message' => $msg))); - OC_Log::write('core','ajax/vcategories/add.php: '.$msg, OC_Log::DEBUG); + OC_Log::write('core', 'ajax/vcategories/add.php: '.$msg, OC_Log::DEBUG); exit(); } function debug($msg) { - OC_Log::write('core','ajax/vcategories/add.php: '.$msg, OC_Log::DEBUG); + OC_Log::write('core', 'ajax/vcategories/add.php: '.$msg, OC_Log::DEBUG); } -require_once('../../../lib/base.php'); +require_once '../../../lib/base.php'; OC_JSON::checkLoggedIn(); $category = isset($_GET['category'])?strip_tags($_GET['category']):null; $app = isset($_GET['app'])?$_GET['app']:null; diff --git a/core/ajax/vcategories/delete.php b/core/ajax/vcategories/delete.php index a41fa083c38..cd46a25b79d 100644 --- a/core/ajax/vcategories/delete.php +++ b/core/ajax/vcategories/delete.php @@ -8,14 +8,14 @@ function bailOut($msg) { OC_JSON::error(array('data' => array('message' => $msg))); - OC_Log::write('core','ajax/vcategories/delete.php: '.$msg, OC_Log::DEBUG); + OC_Log::write('core', 'ajax/vcategories/delete.php: '.$msg, OC_Log::DEBUG); exit(); } function debug($msg) { - OC_Log::write('core','ajax/vcategories/delete.php: '.$msg, OC_Log::DEBUG); + OC_Log::write('core', 'ajax/vcategories/delete.php: '.$msg, OC_Log::DEBUG); } -require_once('../../../lib/base.php'); +require_once '../../../lib/base.php'; OC_JSON::checkLoggedIn(); $app = isset($_POST['app'])?$_POST['app']:null; $categories = isset($_POST['categories'])?$_POST['categories']:null; diff --git a/core/ajax/vcategories/edit.php b/core/ajax/vcategories/edit.php index 3e5540cbc22..a0e67841c55 100644 --- a/core/ajax/vcategories/edit.php +++ b/core/ajax/vcategories/edit.php @@ -8,14 +8,14 @@ function bailOut($msg) { OC_JSON::error(array('data' => array('message' => $msg))); - OC_Log::write('core','ajax/vcategories/edit.php: '.$msg, OC_Log::DEBUG); + OC_Log::write('core', 'ajax/vcategories/edit.php: '.$msg, OC_Log::DEBUG); exit(); } function debug($msg) { - OC_Log::write('core','ajax/vcategories/edit.php: '.$msg, OC_Log::DEBUG); + OC_Log::write('core', 'ajax/vcategories/edit.php: '.$msg, OC_Log::DEBUG); } -require_once('../../../lib/base.php'); +require_once '../../../lib/base.php'; OC_JSON::checkLoggedIn(); $app = isset($_GET['app'])?$_GET['app']:null; @@ -29,5 +29,5 @@ $tmpl = new OC_TEMPLATE("core", "edit_categories_dialog"); $vcategories = new OC_VCategories($app); $categories = $vcategories->categories(); debug(print_r($categories, true)); -$tmpl->assign('categories',$categories); +$tmpl->assign('categories', $categories); $tmpl->printpage(); |