Change name of share function to shareItem, silly PHP 5.3.1 thinking it is a constructor...

This commit is contained in:
Michael Gapczynski 2012-08-12 14:48:56 -04:00
parent fb493c45dd
commit 64ef1e2181
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['item']
case 'share': case 'share':
if (isset($_POST['shareType']) && isset($_POST['shareWith']) && isset($_POST['permissions'])) { if (isset($_POST['shareType']) && isset($_POST['shareWith']) && isset($_POST['permissions'])) {
try { try {
OCP\Share::share($_POST['itemType'], $_POST['item'], $_POST['shareType'], $_POST['shareWith'], $_POST['permissions']); OCP\Share::shareItem($_POST['itemType'], $_POST['item'], $_POST['shareType'], $_POST['shareWith'], $_POST['permissions']);
// TODO May need to return private link // TODO May need to return private link
OC_JSON::success(); OC_JSON::success();
} catch (Exception $exception) { } catch (Exception $exception) {

View File

@ -140,7 +140,7 @@ class Share {
* @param int CRUDS permissions * @param int CRUDS permissions
* @return bool Returns true on success or false on failure * @return bool Returns true on success or false on failure
*/ */
public static function share($itemType, $itemSource, $shareType, $shareWith, $permissions) { public static function shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions) {
$uidOwner = \OC_User::getUser(); $uidOwner = \OC_User::getUser();
// Verify share type and sharing conditions are met // Verify share type and sharing conditions are met
switch ($shareType) { switch ($shareType) {
@ -201,7 +201,7 @@ class Share {
\OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR);
throw new \Exception($message); throw new \Exception($message);
} }
return self::share($itemType, $itemSource, self::SHARE_TYPE_EMAIL, $details['EMAIL'], $permissions); return self::shareItem($itemType, $itemSource, self::SHARE_TYPE_EMAIL, $details['EMAIL'], $permissions);
break; break;
// Future share types need to include their own conditions // Future share types need to include their own conditions
default: default: