diff --git a/core/ajax/share.php b/core/ajax/share.php index 6704a00c5a..332b6a0bed 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -34,7 +34,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo $shareWith = null; } - $token = OCP\Share::shareItem($_POST['itemType'], $_POST['itemSource'], $shareType, $shareWith, $_POST['permissions']); + $token = OCP\Share::shareItem( + $_POST['itemType'], + $_POST['itemSource'], + $shareType, + $shareWith, + $_POST['permissions'] + ); if (is_string($token)) { OC_JSON::success(array('data' => array('token' => $token))); @@ -59,7 +65,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo break; case 'setPermissions': if (isset($_POST['shareType']) && isset($_POST['shareWith']) && isset($_POST['permissions'])) { - $return = OCP\Share::setPermissions($_POST['itemType'], $_POST['itemSource'], $_POST['shareType'], $_POST['shareWith'], $_POST['permissions']); + $return = OCP\Share::setPermissions( + $_POST['itemType'], + $_POST['itemSource'], + $_POST['shareType'], + $_POST['shareWith'], + $_POST['permissions'] + ); ($return) ? OC_JSON::success() : OC_JSON::error(); } break; @@ -86,9 +98,11 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo if ($type === 'dir') $subject = (string)$l->t('User %s shared a folder with you', $displayName); - $text = (string)$l->t('User %s shared the file "%s" with you. It is available for download here: %s', array($displayName, $file, $link)); + $text = (string)$l->t('User %s shared the file "%s" with you. It is available for download here: %s', + array($displayName, $file, $link)); if ($type === 'dir') - $text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s', array($displayName, $file, $link)); + $text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s', + array($displayName, $file, $link)); $default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply'); @@ -112,14 +126,29 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo } break; case 'getItem': - if (isset($_GET['itemType']) && isset($_GET['itemSource']) && isset($_GET['checkReshare']) && isset($_GET['checkShares'])) { + if (isset($_GET['itemType']) + && isset($_GET['itemSource']) + && isset($_GET['checkReshare']) + && isset($_GET['checkShares'])) { if ($_GET['checkReshare'] == 'true') { - $reshare = OCP\Share::getItemSharedWithBySource($_GET['itemType'], $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true); + $reshare = OCP\Share::getItemSharedWithBySource( + $_GET['itemType'], + $_GET['itemSource'], + OCP\Share::FORMAT_NONE, + null, + true + ); } else { $reshare = false; } if ($_GET['checkShares'] == 'true') { - $shares = OCP\Share::getItemShared($_GET['itemType'], $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true); + $shares = OCP\Share::getItemShared( + $_GET['itemType'], + $_GET['itemSource'], + OCP\Share::FORMAT_NONE, + null, + true + ); } else { $shares = false; } @@ -165,8 +194,15 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo } $offset += $limit; foreach ($users as $uid => $displayName) { - if ((!isset($_GET['itemShares']) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) || !in_array($uid, $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) && $uid != OC_User::getUser()) { - $shareWith[] = array('label' => $displayName, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, 'shareWith' => $uid)); + if ((!isset($_GET['itemShares']) + || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) + || !in_array($uid, $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) + && $uid != OC_User::getUser()) { + $shareWith[] = array( + 'label' => $displayName, + 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, + 'shareWith' => $uid) + ); $count++; } } @@ -179,7 +215,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo || !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]))) { - $shareWith[] = array('label' => $group.' (group)', 'value' => array('shareType' => OCP\Share::SHARE_TYPE_GROUP, 'shareWith' => $group)); + $shareWith[] = array( + 'label' => $group.' (group)', + 'value' => array( + 'shareType' => OCP\Share::SHARE_TYPE_GROUP, + 'shareWith' => $group + ) + ); $count++; } } else { diff --git a/core/js/config.php b/core/js/config.php index 9069175ed6..0aaa448228 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -29,8 +29,33 @@ $array = array( "oc_current_user" => "\"".OC_User::getUser(). "\"", "oc_requesttoken" => "\"".OC_Util::callRegister(). "\"", "datepickerFormatDate" => json_encode($l->l('jsdate', 'jsdate')), - "dayNames" => json_encode(array((string)$l->t('Sunday'), (string)$l->t('Monday'), (string)$l->t('Tuesday'), (string)$l->t('Wednesday'), (string)$l->t('Thursday'), (string)$l->t('Friday'), (string)$l->t('Saturday'))), - "monthNames" => json_encode(array((string)$l->t('January'), (string)$l->t('February'), (string)$l->t('March'), (string)$l->t('April'), (string)$l->t('May'), (string)$l->t('June'), (string)$l->t('July'), (string)$l->t('August'), (string)$l->t('September'), (string)$l->t('October'), (string)$l->t('November'), (string)$l->t('December'))), + "dayNames" => json_encode( + array( + (string)$l->t('Sunday'), + (string)$l->t('Monday'), + (string)$l->t('Tuesday'), + (string)$l->t('Wednesday'), + (string)$l->t('Thursday'), + (string)$l->t('Friday'), + (string)$l->t('Saturday') + ) + ), + "monthNames" => json_encode( + array( + (string)$l->t('January'), + (string)$l->t('February'), + (string)$l->t('March'), + (string)$l->t('April'), + (string)$l->t('May'), + (string)$l->t('June'), + (string)$l->t('July'), + (string)$l->t('August'), + (string)$l->t('September'), + (string)$l->t('October'), + (string)$l->t('November'), + (string)$l->t('December') + ) + ), "firstDay" => json_encode($l->l('firstday', 'firstday')) , ); @@ -38,4 +63,3 @@ $array = array( foreach ($array as $setting => $value) { echo("var ". $setting ."=".$value.";\n"); } -?> \ No newline at end of file diff --git a/core/templates/exception.php b/core/templates/exception.php index 62d6cf2ade..4059c7e047 100644 --- a/core/templates/exception.php +++ b/core/templates/exception.php @@ -5,7 +5,9 @@

bug tracker, please copy the following informations into the description.