зеркало из https://github.com/nextcloud/server.git
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Родитель
d6e17fb017
Коммит
14c996d982
|
@ -217,7 +217,7 @@ class Notifier implements INotifier {
|
|||
$placeholders[] = '{' . $placeholder . '}';
|
||||
if ($parameter['type'] === 'user') {
|
||||
$replacements[] = '@' . $parameter['name'];
|
||||
} else if ($parameter['type'] === 'file') {
|
||||
} elseif ($parameter['type'] === 'file') {
|
||||
$replacements[] = $parameter['path'];
|
||||
} else {
|
||||
$replacements[] = $parameter['name'];
|
||||
|
|
|
@ -224,7 +224,7 @@ class Application extends App {
|
|||
$subject = Event::SUBJECT_OBJECT_ADD;
|
||||
if ($eventName === '\OCA\DAV\CalDAV\CalDavBackend::updateCalendarObject') {
|
||||
$subject = Event::SUBJECT_OBJECT_UPDATE;
|
||||
} else if ($eventName === '\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject') {
|
||||
} elseif ($eventName === '\OCA\DAV\CalDAV\CalDavBackend::deleteCalendarObject') {
|
||||
$subject = Event::SUBJECT_OBJECT_DELETE;
|
||||
}
|
||||
$backend->onTouchCalendarObject(
|
||||
|
|
|
@ -216,7 +216,7 @@ class Backend {
|
|||
|
||||
if ($owner === $event->getAuthor()) {
|
||||
$subject = Calendar::SUBJECT_UNSHARE_USER . '_you';
|
||||
} else if ($principal[2] === $event->getAuthor()) {
|
||||
} elseif ($principal[2] === $event->getAuthor()) {
|
||||
$subject = Calendar::SUBJECT_UNSHARE_USER . '_self';
|
||||
} else {
|
||||
$event->setAffectedUser($event->getAuthor())
|
||||
|
@ -230,7 +230,7 @@ class Backend {
|
|||
->setSubject($subject, $parameters);
|
||||
$this->activityManager->publish($event);
|
||||
}
|
||||
} else if ($principal[1] === 'groups') {
|
||||
} elseif ($principal[1] === 'groups') {
|
||||
$this->triggerActivityGroup($principal[2], $event, $calendarData, Calendar::SUBJECT_UNSHARE_USER);
|
||||
|
||||
$parameters = [
|
||||
|
@ -299,7 +299,7 @@ class Backend {
|
|||
->setSubject($subject, $parameters);
|
||||
$this->activityManager->publish($event);
|
||||
}
|
||||
} else if ($principal[1] === 'groups') {
|
||||
} elseif ($principal[1] === 'groups') {
|
||||
$this->triggerActivityGroup($principal[2], $event, $calendarData, Calendar::SUBJECT_SHARE_USER);
|
||||
|
||||
$parameters = [
|
||||
|
@ -422,7 +422,7 @@ class Backend {
|
|||
|
||||
if ($object['type'] === 'todo' && strpos($action, Event::SUBJECT_OBJECT_UPDATE) === 0 && $object['status'] === 'COMPLETED') {
|
||||
$action .= '_completed';
|
||||
} else if ($object['type'] === 'todo' && strpos($action, Event::SUBJECT_OBJECT_UPDATE) === 0 && $object['status'] === 'NEEDS-ACTION') {
|
||||
} elseif ($object['type'] === 'todo' && strpos($action, Event::SUBJECT_OBJECT_UPDATE) === 0 && $object['status'] === 'NEEDS-ACTION') {
|
||||
$action .= '_needs_action';
|
||||
}
|
||||
|
||||
|
@ -499,7 +499,7 @@ class Backend {
|
|||
$prinical = explode('/', $share['{http://owncloud.org/ns}principal']);
|
||||
if ($prinical[1] === 'users') {
|
||||
$users[] = $prinical[2];
|
||||
} else if ($prinical[1] === 'groups') {
|
||||
} elseif ($prinical[1] === 'groups') {
|
||||
$groups[] = $prinical[2];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,44 +101,44 @@ class Calendar extends Base {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_ADD) {
|
||||
$subject = $this->l->t('{actor} created calendar {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_ADD . '_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_ADD . '_self') {
|
||||
$subject = $this->l->t('You created calendar {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_DELETE) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_DELETE) {
|
||||
$subject = $this->l->t('{actor} deleted calendar {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_DELETE . '_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_DELETE . '_self') {
|
||||
$subject = $this->l->t('You deleted calendar {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UPDATE) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UPDATE) {
|
||||
$subject = $this->l->t('{actor} updated calendar {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UPDATE . '_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UPDATE . '_self') {
|
||||
$subject = $this->l->t('You updated calendar {calendar}');
|
||||
|
||||
} else if ($event->getSubject() === self::SUBJECT_PUBLISH . '_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_PUBLISH . '_self') {
|
||||
$subject = $this->l->t('You shared calendar {calendar} as public link');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNPUBLISH . '_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNPUBLISH . '_self') {
|
||||
$subject = $this->l->t('You removed public link for calendar {calendar}');
|
||||
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARE_USER) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARE_USER) {
|
||||
$subject = $this->l->t('{actor} shared calendar {calendar} with you');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARE_USER . '_you') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARE_USER . '_you') {
|
||||
$subject = $this->l->t('You shared calendar {calendar} with {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARE_USER . '_by') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARE_USER . '_by') {
|
||||
$subject = $this->l->t('{actor} shared calendar {calendar} with {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER) {
|
||||
$subject = $this->l->t('{actor} unshared calendar {calendar} from you');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_you') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_you') {
|
||||
$subject = $this->l->t('You unshared calendar {calendar} from {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_by') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_by') {
|
||||
$subject = $this->l->t('{actor} unshared calendar {calendar} from {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_self') {
|
||||
$subject = $this->l->t('{actor} unshared calendar {calendar} from themselves');
|
||||
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_you') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_you') {
|
||||
$subject = $this->l->t('You shared calendar {calendar} with group {group}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_by') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_by') {
|
||||
$subject = $this->l->t('{actor} shared calendar {calendar} with group {group}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_you') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_you') {
|
||||
$subject = $this->l->t('You unshared calendar {calendar} from group {group}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_by') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_by') {
|
||||
$subject = $this->l->t('{actor} unshared calendar {calendar} from group {group}');
|
||||
} else {
|
||||
throw new \InvalidArgumentException();
|
||||
|
@ -153,7 +153,7 @@ class Calendar extends Base {
|
|||
if (isset($parsedParameters['user'])) {
|
||||
// Couldn't group by calendar, maybe we can group by users
|
||||
$event = $this->eventMerger->mergeEvents('user', $event, $previousEvent);
|
||||
} else if (isset($parsedParameters['group'])) {
|
||||
} elseif (isset($parsedParameters['group'])) {
|
||||
// Couldn't group by calendar, maybe we can group by groups
|
||||
$event = $this->eventMerger->mergeEvents('group', $event, $previousEvent);
|
||||
}
|
||||
|
|
|
@ -93,15 +93,15 @@ class Event extends Base {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_event') {
|
||||
$subject = $this->l->t('{actor} created event {event} in calendar {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_event_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_event_self') {
|
||||
$subject = $this->l->t('You created event {event} in calendar {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_event') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_event') {
|
||||
$subject = $this->l->t('{actor} deleted event {event} from calendar {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_event_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_event_self') {
|
||||
$subject = $this->l->t('You deleted event {event} from calendar {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_event') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_event') {
|
||||
$subject = $this->l->t('{actor} updated event {event} in calendar {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_event_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_event_self') {
|
||||
$subject = $this->l->t('You updated event {event} in calendar {calendar}');
|
||||
} else {
|
||||
throw new \InvalidArgumentException();
|
||||
|
|
|
@ -50,24 +50,24 @@ class Todo extends Event {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_todo') {
|
||||
$subject = $this->l->t('{actor} created todo {todo} in list {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_todo_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_todo_self') {
|
||||
$subject = $this->l->t('You created todo {todo} in list {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_todo') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_todo') {
|
||||
$subject = $this->l->t('{actor} deleted todo {todo} from list {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_todo_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_todo_self') {
|
||||
$subject = $this->l->t('You deleted todo {todo} from list {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo') {
|
||||
$subject = $this->l->t('{actor} updated todo {todo} in list {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_self') {
|
||||
$subject = $this->l->t('You updated todo {todo} in list {calendar}');
|
||||
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_completed') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_completed') {
|
||||
$subject = $this->l->t('{actor} solved todo {todo} in list {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_completed_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_completed_self') {
|
||||
$subject = $this->l->t('You solved todo {todo} in list {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action') {
|
||||
$subject = $this->l->t('{actor} reopened todo {todo} in list {calendar}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action_self') {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action_self') {
|
||||
$subject = $this->l->t('You reopened todo {todo} in list {calendar}');
|
||||
} else {
|
||||
throw new \InvalidArgumentException();
|
||||
|
|
|
@ -742,7 +742,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
throw new DAV\Exception('The ' . $sccs . ' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet');
|
||||
}
|
||||
$values['components'] = implode(',',$properties[$sccs]->getValue());
|
||||
} else if (isset($properties['components'])) {
|
||||
} elseif (isset($properties['components'])) {
|
||||
// Allow to provide components internally without having
|
||||
// to create a SupportedCalendarComponentSet object
|
||||
$values['components'] = $properties['components'];
|
||||
|
|
|
@ -511,7 +511,7 @@ class ReminderService {
|
|||
$users[] = $user;
|
||||
$userIds[] = $principal[2];
|
||||
}
|
||||
} else if ($principal[1] === 'groups') {
|
||||
} elseif ($principal[1] === 'groups') {
|
||||
$groups[] = $principal[2];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -516,7 +516,7 @@ class IMipPlugin extends SabreIMipPlugin {
|
|||
$template->setSubject('Cancelled: ' . $summary);
|
||||
$template->addHeading($l10n->t('Invitation canceled'), $l10n->t('Hello %s,', [$attendeeName]));
|
||||
$template->addBodyText($l10n->t('The meeting »%1$s« with %2$s was canceled.', [$summary, $inviteeName]));
|
||||
} else if ($method === self::METHOD_REPLY) {
|
||||
} elseif ($method === self::METHOD_REPLY) {
|
||||
$template->setSubject('Re: ' . $summary);
|
||||
$template->addHeading($l10n->t('Invitation updated'), $l10n->t('Hello %s,', [$attendeeName]));
|
||||
$template->addBodyText($l10n->t('The meeting »%1$s« with %2$s was updated.', [$summary, $inviteeName]));
|
||||
|
|
|
@ -262,7 +262,7 @@ class AddressBookImpl implements IAddressBook {
|
|||
|
||||
$result['PHOTO'] = 'VALUE=uri:' . $url;
|
||||
|
||||
} else if ($property->name === 'X-SOCIALPROFILE') {
|
||||
} elseif ($property->name === 'X-SOCIALPROFILE') {
|
||||
$type = $this->getTypeFromProperty($property);
|
||||
|
||||
// Type is the social network, when it's empty we don't need this.
|
||||
|
@ -274,7 +274,7 @@ class AddressBookImpl implements IAddressBook {
|
|||
}
|
||||
|
||||
// The following properties can be set multiple times
|
||||
} else if (in_array($property->name, ['CLOUD', 'EMAIL', 'IMPP', 'TEL', 'URL', 'X-ADDRESSBOOKSERVER-MEMBER'])) {
|
||||
} elseif (in_array($property->name, ['CLOUD', 'EMAIL', 'IMPP', 'TEL', 'URL', 'X-ADDRESSBOOKSERVER-MEMBER'])) {
|
||||
if (!isset($result[$property->name])) {
|
||||
$result[$property->name] = [];
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ class PublicAuth extends AbstractBasic {
|
|||
|| $share->getShareType() === IShare::TYPE_CIRCLE) {
|
||||
if ($this->shareManager->checkPassword($share, $password)) {
|
||||
return true;
|
||||
} else if ($this->session->exists('public_link_authenticated')
|
||||
} elseif ($this->session->exists('public_link_authenticated')
|
||||
&& $this->session->get('public_link_authenticated') === (string)$share->getId()) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -116,7 +116,7 @@ class PublicAuth extends AbstractBasic {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
} else if ($share->getShareType() === IShare::TYPE_REMOTE) {
|
||||
} elseif ($share->getShareType() === IShare::TYPE_REMOTE) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -328,7 +328,7 @@ class File extends Node implements IFile {
|
|||
$checksum = trim($this->request->server['HTTP_OC_CHECKSUM']);
|
||||
$this->fileView->putFileInfo($this->path, ['checksum' => $checksum]);
|
||||
$this->refreshInfo();
|
||||
} else if ($this->getChecksum() !== null && $this->getChecksum() !== '') {
|
||||
} elseif ($this->getChecksum() !== null && $this->getChecksum() !== '') {
|
||||
$this->fileView->putFileInfo($this->path, ['checksum' => '']);
|
||||
$this->refreshInfo();
|
||||
}
|
||||
|
@ -592,7 +592,7 @@ class File extends Node implements IFile {
|
|||
if (isset($this->request->server['HTTP_OC_CHECKSUM'])) {
|
||||
$checksum = trim($this->request->server['HTTP_OC_CHECKSUM']);
|
||||
$this->fileView->putFileInfo($targetPath, ['checksum' => $checksum]);
|
||||
} else if ($info->getChecksum() !== null && $info->getChecksum() !== '') {
|
||||
} elseif ($info->getChecksum() !== null && $info->getChecksum() !== '') {
|
||||
$this->fileView->putFileInfo($this->path, ['checksum' => '']);
|
||||
}
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ class FilesReportPlugin extends ServerPlugin {
|
|||
$name = $reportProps['name'];
|
||||
if ($name === $ns . 'filter-rules') {
|
||||
$filterRules = $reportProps['value'];
|
||||
} else if ($name === '{DAV:}prop') {
|
||||
} elseif ($name === '{DAV:}prop') {
|
||||
// propfind properties
|
||||
foreach ($reportProps['value'] as $propVal) {
|
||||
$requestedProps[] = $propVal['name'];
|
||||
|
@ -422,7 +422,7 @@ class FilesReportPlugin extends ServerPlugin {
|
|||
$entry = current($entry);
|
||||
if ($entry instanceof \OCP\Files\File) {
|
||||
$results[] = new File($this->fileView, $entry);
|
||||
} else if ($entry instanceof \OCP\Files\Folder) {
|
||||
} elseif ($entry instanceof \OCP\Files\Folder) {
|
||||
$results[] = new Directory($this->fileView, $entry);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ class Principal implements BackendInterface {
|
|||
if ($user !== null) {
|
||||
return $this->userToPrincipal($user);
|
||||
}
|
||||
} else if ($prefix === 'principals/circles') {
|
||||
} elseif ($prefix === 'principals/circles') {
|
||||
try {
|
||||
return $this->circleToPrincipal($name);
|
||||
} catch (QueryException $e) {
|
||||
|
|
|
@ -232,7 +232,7 @@ class Backend {
|
|||
'principal' => $share['{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}principal'],
|
||||
'protected' => true,
|
||||
];
|
||||
} else if ($this->resourceType === 'calendar') {
|
||||
} elseif ($this->resourceType === 'calendar') {
|
||||
// Allow changing the properties of read only calendars,
|
||||
// so users can change the visibility.
|
||||
$acl[] = [
|
||||
|
|
|
@ -91,7 +91,7 @@ class AssemblyStream implements \Icewind\Streams\File {
|
|||
public function stream_seek($offset, $whence = SEEK_SET) {
|
||||
if ($whence === SEEK_CUR) {
|
||||
$offset = $this->stream_tell() + $offset;
|
||||
} else if ($whence === SEEK_END) {
|
||||
} elseif ($whence === SEEK_END) {
|
||||
$offset = $this->size + $offset;
|
||||
}
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ class ImageExportPluginTest extends TestCase {
|
|||
->willReturnCallback(function ($path) use ($card, $book) {
|
||||
if ($path === 'user/book/card') {
|
||||
return $card;
|
||||
} else if ($path === 'user/book') {
|
||||
} elseif ($path === 'user/book') {
|
||||
return $book;
|
||||
}
|
||||
$this->fail();
|
||||
|
|
|
@ -60,7 +60,7 @@ class Sapi {
|
|||
$copyStream = fopen('php://temp', 'r+');
|
||||
if (is_string($response->getBody())) {
|
||||
fwrite($copyStream, $response->getBody());
|
||||
} else if (is_resource($response->getBody())) {
|
||||
} elseif (is_resource($response->getBody())) {
|
||||
stream_copy_to_stream($response->getBody(), $copyStream);
|
||||
}
|
||||
rewind($copyStream);
|
||||
|
|
|
@ -489,7 +489,7 @@ class Crypt {
|
|||
|
||||
if (!$isCorrectHash && $enforceSignature) {
|
||||
throw new GenericEncryptionException('Bad Signature', $this->l->t('Bad Signature'));
|
||||
} else if (!$isCorrectHash && !$enforceSignature) {
|
||||
} elseif (!$isCorrectHash && !$enforceSignature) {
|
||||
$this->logger->info("Signature check skipped", ['app' => 'encryption']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ class DecryptAll {
|
|||
$useLoginPassword = $this->questionHelper->ask($input, $output, $questionUseLoginPassword);
|
||||
if ($useLoginPassword) {
|
||||
$question = new Question('Please enter the user\'s login password: ');
|
||||
} else if ($this->util->isRecoveryEnabledForUser($user) === false) {
|
||||
} elseif ($this->util->isRecoveryEnabledForUser($user) === false) {
|
||||
$output->writeln('No recovery key available for user ' . $user);
|
||||
return false;
|
||||
} else {
|
||||
|
|
|
@ -433,7 +433,7 @@ class KeyManager {
|
|||
// when logged in, the master key is already decrypted in the session
|
||||
$privateKey = $this->session->getPrivateKey();
|
||||
}
|
||||
} else if ($publicAccess) {
|
||||
} elseif ($publicAccess) {
|
||||
// use public share key for public links
|
||||
$uid = $this->getPublicShareKeyId();
|
||||
$shareKey = $this->getShareKey($path, $uid);
|
||||
|
|
|
@ -388,7 +388,7 @@ class KeyManagerTest extends TestCase {
|
|||
$expectedUid = 'masterKeyId';
|
||||
$this->configMock->expects($this->any())->method('getSystemValue')->with('secret')
|
||||
->willReturn('password');
|
||||
} else if (!$uid) {
|
||||
} elseif (!$uid) {
|
||||
$expectedUid = 'systemKeyId';
|
||||
} else {
|
||||
$expectedUid = $uid;
|
||||
|
|
|
@ -133,7 +133,7 @@ class AddressHandler {
|
|||
public function removeProtocolFromUrl($url) {
|
||||
if (strpos($url, 'https://') === 0) {
|
||||
return substr($url, strlen('https://'));
|
||||
} else if (strpos($url, 'http://') === 0) {
|
||||
} elseif (strpos($url, 'http://') === 0) {
|
||||
return substr($url, strlen('http://'));
|
||||
}
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ class Notifier implements INotifier {
|
|||
$user = $cloudId->getUser();
|
||||
if (strpos($server, 'http://') === 0) {
|
||||
$server = substr($server, strlen('http://'));
|
||||
} else if (strpos($server, 'https://') === 0) {
|
||||
} elseif (strpos($server, 'https://') === 0) {
|
||||
$server = substr($server, strlen('https://'));
|
||||
}
|
||||
|
||||
|
|
|
@ -302,7 +302,7 @@ class DbHandler {
|
|||
|
||||
if (strpos($url, 'https://') === 0) {
|
||||
$normalized = substr($url, strlen('https://'));
|
||||
} else if (strpos($url, 'http://') === 0) {
|
||||
} elseif (strpos($url, 'http://') === 0) {
|
||||
$normalized = substr($url, strlen('http://'));
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ class FavoriteProvider implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_REMOVED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_REMOVED) {
|
||||
$event->setType('unfavorite');
|
||||
$event->setParsedSubject($this->l->t('Removed from favorites'));
|
||||
if ($this->activityManager->getRequirePNG()) {
|
||||
|
@ -136,7 +136,7 @@ class FavoriteProvider implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_REMOVED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_REMOVED) {
|
||||
$event->setType('unfavorite');
|
||||
$subject = $this->l->t('You removed {file} from your favorites');
|
||||
if ($this->activityManager->getRequirePNG()) {
|
||||
|
|
|
@ -52,7 +52,7 @@ class Helper {
|
|||
|
||||
if (empty($favorites)) {
|
||||
throw new \RuntimeException('No favorites', 1);
|
||||
} else if (isset($favorites[self::FAVORITE_LIMIT])) {
|
||||
} elseif (isset($favorites[self::FAVORITE_LIMIT])) {
|
||||
throw new \RuntimeException('Too many favorites', 2);
|
||||
}
|
||||
|
||||
|
|
|
@ -143,19 +143,19 @@ class Provider implements IProvider {
|
|||
if ($event->getSubject() === 'created_by') {
|
||||
$subject = $this->l->t('Created by {user}');
|
||||
$this->setIcon($event, 'add-color');
|
||||
} else if ($event->getSubject() === 'changed_by') {
|
||||
} elseif ($event->getSubject() === 'changed_by') {
|
||||
$subject = $this->l->t('Changed by {user}');
|
||||
$this->setIcon($event, 'change');
|
||||
} else if ($event->getSubject() === 'deleted_by') {
|
||||
} elseif ($event->getSubject() === 'deleted_by') {
|
||||
$subject = $this->l->t('Deleted by {user}');
|
||||
$this->setIcon($event, 'delete-color');
|
||||
} else if ($event->getSubject() === 'restored_by') {
|
||||
} elseif ($event->getSubject() === 'restored_by') {
|
||||
$subject = $this->l->t('Restored by {user}');
|
||||
$this->setIcon($event, 'actions/history', 'core');
|
||||
} else if ($event->getSubject() === 'renamed_by') {
|
||||
} elseif ($event->getSubject() === 'renamed_by') {
|
||||
$subject = $this->l->t('Renamed by {user}');
|
||||
$this->setIcon($event, 'change');
|
||||
} else if ($event->getSubject() === 'moved_by') {
|
||||
} elseif ($event->getSubject() === 'moved_by') {
|
||||
$subject = $this->l->t('Moved by {user}');
|
||||
$this->setIcon($event, 'change');
|
||||
} else {
|
||||
|
@ -189,55 +189,55 @@ class Provider implements IProvider {
|
|||
$subject = $this->l->t('You created an encrypted file in {file}');
|
||||
}
|
||||
$this->setIcon($event, 'add-color');
|
||||
} else if ($event->getSubject() === 'created_by') {
|
||||
} elseif ($event->getSubject() === 'created_by') {
|
||||
$subject = $this->l->t('{user} created {file}');
|
||||
if ($this->fileIsEncrypted) {
|
||||
$subject = $this->l->t('{user} created an encrypted file in {file}');
|
||||
}
|
||||
$this->setIcon($event, 'add-color');
|
||||
} else if ($event->getSubject() === 'created_public') {
|
||||
} elseif ($event->getSubject() === 'created_public') {
|
||||
$subject = $this->l->t('{file} was created in a public folder');
|
||||
$this->setIcon($event, 'add-color');
|
||||
} else if ($event->getSubject() === 'changed_self') {
|
||||
} elseif ($event->getSubject() === 'changed_self') {
|
||||
$subject = $this->l->t('You changed {file}');
|
||||
if ($this->fileIsEncrypted) {
|
||||
$subject = $this->l->t('You changed an encrypted file in {file}');
|
||||
}
|
||||
$this->setIcon($event, 'change');
|
||||
} else if ($event->getSubject() === 'changed_by') {
|
||||
} elseif ($event->getSubject() === 'changed_by') {
|
||||
$subject = $this->l->t('{user} changed {file}');
|
||||
if ($this->fileIsEncrypted) {
|
||||
$subject = $this->l->t('{user} changed an encrypted file in {file}');
|
||||
}
|
||||
$this->setIcon($event, 'change');
|
||||
} else if ($event->getSubject() === 'deleted_self') {
|
||||
} elseif ($event->getSubject() === 'deleted_self') {
|
||||
$subject = $this->l->t('You deleted {file}');
|
||||
if ($this->fileIsEncrypted) {
|
||||
$subject = $this->l->t('You deleted an encrypted file in {file}');
|
||||
}
|
||||
$this->setIcon($event, 'delete-color');
|
||||
} else if ($event->getSubject() === 'deleted_by') {
|
||||
} elseif ($event->getSubject() === 'deleted_by') {
|
||||
$subject = $this->l->t('{user} deleted {file}');
|
||||
if ($this->fileIsEncrypted) {
|
||||
$subject = $this->l->t('{user} deleted an encrypted file in {file}');
|
||||
}
|
||||
$this->setIcon($event, 'delete-color');
|
||||
} else if ($event->getSubject() === 'restored_self') {
|
||||
} elseif ($event->getSubject() === 'restored_self') {
|
||||
$subject = $this->l->t('You restored {file}');
|
||||
$this->setIcon($event, 'actions/history', 'core');
|
||||
} else if ($event->getSubject() === 'restored_by') {
|
||||
} elseif ($event->getSubject() === 'restored_by') {
|
||||
$subject = $this->l->t('{user} restored {file}');
|
||||
$this->setIcon($event, 'actions/history', 'core');
|
||||
} else if ($event->getSubject() === 'renamed_self') {
|
||||
} elseif ($event->getSubject() === 'renamed_self') {
|
||||
$subject = $this->l->t('You renamed {oldfile} to {newfile}');
|
||||
$this->setIcon($event, 'change');
|
||||
} else if ($event->getSubject() === 'renamed_by') {
|
||||
} elseif ($event->getSubject() === 'renamed_by') {
|
||||
$subject = $this->l->t('{user} renamed {oldfile} to {newfile}');
|
||||
$this->setIcon($event, 'change');
|
||||
} else if ($event->getSubject() === 'moved_self') {
|
||||
} elseif ($event->getSubject() === 'moved_self') {
|
||||
$subject = $this->l->t('You moved {oldfile} to {newfile}');
|
||||
$this->setIcon($event, 'change');
|
||||
} else if ($event->getSubject() === 'moved_by') {
|
||||
} elseif ($event->getSubject() === 'moved_by') {
|
||||
$subject = $this->l->t('{user} moved {oldfile} to {newfile}');
|
||||
$this->setIcon($event, 'change');
|
||||
} else {
|
||||
|
@ -348,7 +348,7 @@ class Provider implements IProvider {
|
|||
if (is_array($parameter)) {
|
||||
$path = reset($parameter);
|
||||
$id = (string) key($parameter);
|
||||
} else if ($event !== null) {
|
||||
} elseif ($event !== null) {
|
||||
// Legacy from before ownCloud 8.2
|
||||
$path = $parameter;
|
||||
$id = $event->getObjectId();
|
||||
|
|
|
@ -175,7 +175,7 @@ class Scan extends Base {
|
|||
$inputPath = '/' . trim($inputPath, '/');
|
||||
list(, $user,) = explode('/', $inputPath, 3);
|
||||
$users = [$user];
|
||||
} else if ($input->getOption('all')) {
|
||||
} elseif ($input->getOption('all')) {
|
||||
$users = $this->userManager->search('');
|
||||
} else {
|
||||
$users = $input->getArgument('user_id');
|
||||
|
|
|
@ -260,7 +260,7 @@ class Helper {
|
|||
$sortFunc = 'compareFileNames';
|
||||
if ($sortAttribute === 'mtime') {
|
||||
$sortFunc = 'compareTimestamp';
|
||||
} else if ($sortAttribute === 'size') {
|
||||
} elseif ($sortAttribute === 'size') {
|
||||
$sortFunc = 'compareSize';
|
||||
}
|
||||
usort($files, [Helper::class, $sortFunc]);
|
||||
|
|
|
@ -125,7 +125,7 @@ class ListCommand extends Base {
|
|||
} else {
|
||||
if ($userId === self::ALL) {
|
||||
$output->writeln("<info>No mounts configured</info>");
|
||||
} else if ($userId) {
|
||||
} elseif ($userId) {
|
||||
$output->writeln("<info>No mounts configured by $userId</info>");
|
||||
} else {
|
||||
$output->writeln("<info>No admin mounts configured</info>");
|
||||
|
|
|
@ -105,16 +105,16 @@ class Notify extends Base {
|
|||
|
||||
if ($input->getOption('user')) {
|
||||
$mount->setBackendOption('user', $input->getOption('user'));
|
||||
} else if (isset($_ENV['NOTIFY_USER'])) {
|
||||
} elseif (isset($_ENV['NOTIFY_USER'])) {
|
||||
$mount->setBackendOption('user', $_ENV['NOTIFY_USER']);
|
||||
} else if (isset($_SERVER['NOTIFY_USER'])) {
|
||||
} elseif (isset($_SERVER['NOTIFY_USER'])) {
|
||||
$mount->setBackendOption('user', $_SERVER['NOTIFY_USER']);
|
||||
}
|
||||
if ($input->getOption('password')) {
|
||||
$mount->setBackendOption('password', $input->getOption('password'));
|
||||
} else if (isset($_ENV['NOTIFY_PASSWORD'])) {
|
||||
} elseif (isset($_ENV['NOTIFY_PASSWORD'])) {
|
||||
$mount->setBackendOption('password', $_ENV['NOTIFY_PASSWORD']);
|
||||
} else if (isset($_SERVER['NOTIFY_PASSWORD'])) {
|
||||
} elseif (isset($_SERVER['NOTIFY_PASSWORD'])) {
|
||||
$mount->setBackendOption('password', $_SERVER['NOTIFY_PASSWORD']);
|
||||
}
|
||||
|
||||
|
@ -280,16 +280,16 @@ class Notify extends Base {
|
|||
foreach ($changes as $change) {
|
||||
if ($change->getPath() === '/.nc_test_file.txt' || $change->getPath() === '.nc_test_file.txt') {
|
||||
$foundRootChange = true;
|
||||
} else if ($change->getPath() === '/.nc_test_folder/subfile.txt' || $change->getPath() === '.nc_test_folder/subfile.txt') {
|
||||
} elseif ($change->getPath() === '/.nc_test_folder/subfile.txt' || $change->getPath() === '.nc_test_folder/subfile.txt') {
|
||||
$foundSubfolderChange = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($foundRootChange && $foundSubfolderChange && $verbose) {
|
||||
$output->writeln('<info>Self-test successful</info>');
|
||||
} else if ($foundRootChange && !$foundSubfolderChange) {
|
||||
} elseif ($foundRootChange && !$foundSubfolderChange) {
|
||||
$output->writeln('<error>Error while running self-test, change is subfolder not detected</error>');
|
||||
} else if (!$foundRootChange) {
|
||||
} elseif (!$foundRootChange) {
|
||||
$output->writeln('<error>Error while running self-test, no changes detected</error>');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class SMBNotifyHandler implements INotifyHandler {
|
|||
private function relativePath($fullPath) {
|
||||
if ($fullPath === $this->root) {
|
||||
return '';
|
||||
} else if (substr($fullPath, 0, strlen($this->root)) === $this->root) {
|
||||
} elseif (substr($fullPath, 0, strlen($this->root)) === $this->root) {
|
||||
return substr($fullPath, strlen($this->root));
|
||||
} else {
|
||||
return null;
|
||||
|
|
|
@ -200,7 +200,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
if (isset($storages[$this->id]) && isset($storages[$oldId])) {
|
||||
// if both ids exist, delete the old storage and corresponding filecache entries
|
||||
\OC\Files\Cache\Storage::remove($oldId);
|
||||
} else if (isset($storages[$oldId])) {
|
||||
} elseif (isset($storages[$oldId])) {
|
||||
// if only the old id exists do an update
|
||||
$stmt = \OC::$server->getDatabaseConnection()->prepare(
|
||||
'UPDATE `*PREFIX*storages` SET `id` = ? WHERE `id` = ?'
|
||||
|
@ -221,7 +221,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
|||
$fileType = $this->filetype($path);
|
||||
if ($fileType === 'dir') {
|
||||
return $this->rmdir($path);
|
||||
} else if ($fileType === 'file') {
|
||||
} elseif ($fileType === 'file') {
|
||||
return $this->unlink($path);
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -49,7 +49,7 @@ class OwnCloud extends \OC\Files\Storage\DAV implements IDisableEncryptionStorag
|
|||
if (substr($host, 0, 8) === "https://") {
|
||||
$host = substr($host, 8);
|
||||
$params['secure'] = true;
|
||||
} else if (substr($host, 0, 7) === "http://") {
|
||||
} elseif (substr($host, 0, 7) === "http://") {
|
||||
$host = substr($host, 7);
|
||||
$params['secure'] = false;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ class SFTP extends \OC\Files\Storage\Common {
|
|||
$parsed = parse_url($host);
|
||||
if(is_array($parsed) && isset($parsed['port'])) {
|
||||
return [$parsed['host'], $parsed['port']];
|
||||
} else if (is_array($parsed)) {
|
||||
} elseif (is_array($parsed)) {
|
||||
return [$parsed['host'], 22];
|
||||
} else {
|
||||
return [$input, 22];
|
||||
|
|
|
@ -96,7 +96,7 @@ class SMB extends Common implements INotifyStorage {
|
|||
|
||||
if (isset($params['auth'])) {
|
||||
$auth = $params['auth'];
|
||||
} else if (isset($params['user']) && isset($params['password']) && isset($params['share'])) {
|
||||
} elseif (isset($params['user']) && isset($params['password']) && isset($params['share'])) {
|
||||
list($workgroup, $user) = $this->splitUser($params['user']);
|
||||
$auth = new BasicAuth($user, $workgroup, $params['password']);
|
||||
} else {
|
||||
|
@ -161,7 +161,7 @@ class SMB extends Common implements INotifyStorage {
|
|||
protected function relativePath($fullPath) {
|
||||
if ($fullPath === $this->root) {
|
||||
return '';
|
||||
} else if (substr($fullPath, 0, strlen($this->root)) === $this->root) {
|
||||
} elseif (substr($fullPath, 0, strlen($this->root)) === $this->root) {
|
||||
return substr($fullPath, strlen($this->root));
|
||||
} else {
|
||||
return null;
|
||||
|
|
|
@ -324,7 +324,7 @@ class Swift extends \OC\Files\Storage\Common {
|
|||
|
||||
if ($path === '.') {
|
||||
$path = '';
|
||||
} else if ($this->is_dir($path)) {
|
||||
} elseif ($this->is_dir($path)) {
|
||||
$path .= '/';
|
||||
}
|
||||
|
||||
|
@ -506,7 +506,7 @@ class Swift extends \OC\Files\Storage\Common {
|
|||
return false;
|
||||
}
|
||||
|
||||
} else if ($fileType === 'dir') {
|
||||
} elseif ($fileType === 'dir') {
|
||||
try {
|
||||
$source = $this->fetchObject($path1 . '/');
|
||||
$source->copy([
|
||||
|
|
|
@ -88,7 +88,7 @@ abstract class LegacyStoragesService {
|
|||
$applicableUsers[] = $applicable;
|
||||
$storageConfig->setApplicableUsers($applicableUsers);
|
||||
}
|
||||
} else if ($mountType === \OC_Mount_Config::MOUNT_TYPE_GROUP) {
|
||||
} elseif ($mountType === \OC_Mount_Config::MOUNT_TYPE_GROUP) {
|
||||
$applicableGroups = $storageConfig->getApplicableGroups();
|
||||
$applicableGroups[] = $applicable;
|
||||
$storageConfig->setApplicableGroups($applicableGroups);
|
||||
|
|
|
@ -420,7 +420,7 @@ abstract class StoragesService {
|
|||
|
||||
if ($wasGlobal && !$isGlobal) {
|
||||
$this->dbConfig->removeApplicable($id, DBConfigService::APPLICABLE_TYPE_GLOBAL, null);
|
||||
} else if (!$wasGlobal && $isGlobal) {
|
||||
} elseif (!$wasGlobal && $isGlobal) {
|
||||
$this->dbConfig->addApplicable($id, DBConfigService::APPLICABLE_TYPE_GLOBAL, null);
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ abstract class Base implements IProvider {
|
|||
if (is_array($parameter)) {
|
||||
$path = reset($parameter);
|
||||
$id = (string) key($parameter);
|
||||
} else if ($event !== null) {
|
||||
} elseif ($event !== null) {
|
||||
// Legacy from before ownCloud 8.2
|
||||
$path = $parameter;
|
||||
$id = $event->getObjectId();
|
||||
|
|
|
@ -46,7 +46,7 @@ class Downloads extends Base {
|
|||
if ($event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED ||
|
||||
$event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED) {
|
||||
$subject = $this->l->t('Downloaded via public link');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARED_FILE_BY_EMAIL_DOWNLOADED ||
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARED_FILE_BY_EMAIL_DOWNLOADED ||
|
||||
$event->getSubject() === self::SUBJECT_SHARED_FOLDER_BY_EMAIL_DOWNLOADED) {
|
||||
$subject = $this->l->t('Downloaded by {email}');
|
||||
} else {
|
||||
|
@ -75,7 +75,7 @@ class Downloads extends Base {
|
|||
if ($event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED ||
|
||||
$event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED) {
|
||||
$subject = $this->l->t('{file} downloaded via public link');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARED_FILE_BY_EMAIL_DOWNLOADED ||
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARED_FILE_BY_EMAIL_DOWNLOADED ||
|
||||
$event->getSubject() === self::SUBJECT_SHARED_FOLDER_BY_EMAIL_DOWNLOADED) {
|
||||
$subject = $this->l->t('{email} downloaded {file}');
|
||||
} else {
|
||||
|
|
|
@ -72,13 +72,13 @@ class Groups extends Base {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_SHARED_GROUP_SELF) {
|
||||
$subject = $this->l->t('Shared with group {group}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_GROUP_SELF) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_GROUP_SELF) {
|
||||
$subject = $this->l->t('Removed share for group {group}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_RESHARED_GROUP_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_RESHARED_GROUP_BY) {
|
||||
$subject = $this->l->t('{actor} shared with group {group}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_GROUP_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_GROUP_BY) {
|
||||
$subject = $this->l->t('{actor} removed share for group {group}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_EXPIRED_GROUP) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_EXPIRED_GROUP) {
|
||||
$subject = $this->l->t('Share for group {group} expired');
|
||||
} else {
|
||||
throw new \InvalidArgumentException();
|
||||
|
@ -105,13 +105,13 @@ class Groups extends Base {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_SHARED_GROUP_SELF) {
|
||||
$subject = $this->l->t('You shared {file} with group {group}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_GROUP_SELF) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_GROUP_SELF) {
|
||||
$subject = $this->l->t('You removed group {group} from {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_RESHARED_GROUP_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_RESHARED_GROUP_BY) {
|
||||
$subject = $this->l->t('{actor} shared {file} with group {group}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_GROUP_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_GROUP_BY) {
|
||||
$subject = $this->l->t('{actor} removed group {group} from {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_EXPIRED_GROUP) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_EXPIRED_GROUP) {
|
||||
$subject = $this->l->t('Share for file {file} with group {group} expired');
|
||||
} else {
|
||||
throw new \InvalidArgumentException();
|
||||
|
|
|
@ -45,15 +45,15 @@ class PublicLinks extends Base {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_SHARED_LINK_SELF) {
|
||||
$subject = $this->l->t('Shared as public link');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_LINK_SELF) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_LINK_SELF) {
|
||||
$subject = $this->l->t('Removed public link');
|
||||
} else if ($event->getSubject() === self::SUBJECT_LINK_EXPIRED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_LINK_EXPIRED) {
|
||||
$subject = $this->l->t('Public link expired');
|
||||
} else if ($event->getSubject() === self::SUBJECT_RESHARED_LINK_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_RESHARED_LINK_BY) {
|
||||
$subject = $this->l->t('{actor} shared as public link');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_LINK_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_LINK_BY) {
|
||||
$subject = $this->l->t('{actor} removed public link');
|
||||
} else if ($event->getSubject() === self::SUBJECT_LINK_BY_EXPIRED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_LINK_BY_EXPIRED) {
|
||||
$subject = $this->l->t('Public link of {actor} expired');
|
||||
|
||||
} else {
|
||||
|
@ -81,15 +81,15 @@ class PublicLinks extends Base {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_SHARED_LINK_SELF) {
|
||||
$subject = $this->l->t('You shared {file} as public link');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_LINK_SELF) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_LINK_SELF) {
|
||||
$subject = $this->l->t('You removed public link for {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_LINK_EXPIRED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_LINK_EXPIRED) {
|
||||
$subject = $this->l->t('Public link expired for {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_RESHARED_LINK_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_RESHARED_LINK_BY) {
|
||||
$subject = $this->l->t('{actor} shared {file} as public link');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_LINK_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_LINK_BY) {
|
||||
$subject = $this->l->t('{actor} removed public link for {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_LINK_BY_EXPIRED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_LINK_BY_EXPIRED) {
|
||||
$subject = $this->l->t('Public link of {actor} for {file} expired');
|
||||
|
||||
} else {
|
||||
|
|
|
@ -60,7 +60,7 @@ class RemoteShares extends Base {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_ACCEPTED) {
|
||||
$subject = $this->l->t('{user} accepted the remote share');
|
||||
} else if ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_DECLINED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_DECLINED) {
|
||||
$subject = $this->l->t('{user} declined the remote share');
|
||||
} else {
|
||||
throw new \InvalidArgumentException();
|
||||
|
@ -87,11 +87,11 @@ class RemoteShares extends Base {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_RECEIVED) {
|
||||
$subject = $this->l->t('You received a new remote share {file} from {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_ACCEPTED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_ACCEPTED) {
|
||||
$subject = $this->l->t('{user} accepted the remote share of {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_DECLINED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_DECLINED) {
|
||||
$subject = $this->l->t('{user} declined the remote share of {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_UNSHARED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_UNSHARED) {
|
||||
$subject = $this->l->t('{user} unshared {file} from you');
|
||||
} else {
|
||||
throw new \InvalidArgumentException();
|
||||
|
|
|
@ -54,23 +54,23 @@ class Users extends Base {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_SHARED_USER_SELF) {
|
||||
$subject = $this->l->t('Shared with {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_USER_SELF) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_USER_SELF) {
|
||||
$subject = $this->l->t('Removed share for {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SELF_UNSHARED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SELF_UNSHARED) {
|
||||
$subject = $this->l->t('You removed yourself');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SELF_UNSHARED_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SELF_UNSHARED_BY) {
|
||||
$subject = $this->l->t('{actor} removed themselves');
|
||||
} else if ($event->getSubject() === self::SUBJECT_RESHARED_USER_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_RESHARED_USER_BY) {
|
||||
$subject = $this->l->t('{actor} shared with {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_USER_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_USER_BY) {
|
||||
$subject = $this->l->t('{actor} removed share for {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARED_WITH_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARED_WITH_BY) {
|
||||
$subject = $this->l->t('Shared by {actor}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_BY) {
|
||||
$subject = $this->l->t('{actor} removed share');
|
||||
} else if ($event->getSubject() === self::SUBJECT_EXPIRED_USER) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_EXPIRED_USER) {
|
||||
$subject = $this->l->t('Share for {user} expired');
|
||||
} else if ($event->getSubject() === self::SUBJECT_EXPIRED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_EXPIRED) {
|
||||
$subject = $this->l->t('Share expired');
|
||||
} else {
|
||||
throw new \InvalidArgumentException();
|
||||
|
@ -97,23 +97,23 @@ class Users extends Base {
|
|||
|
||||
if ($event->getSubject() === self::SUBJECT_SHARED_USER_SELF) {
|
||||
$subject = $this->l->t('You shared {file} with {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_USER_SELF) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_USER_SELF) {
|
||||
$subject = $this->l->t('You removed {user} from {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SELF_UNSHARED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SELF_UNSHARED) {
|
||||
$subject = $this->l->t('You removed yourself from {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SELF_UNSHARED_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SELF_UNSHARED_BY) {
|
||||
$subject = $this->l->t('{actor} removed themselves from {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_RESHARED_USER_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_RESHARED_USER_BY) {
|
||||
$subject = $this->l->t('{actor} shared {file} with {user}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_USER_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_USER_BY) {
|
||||
$subject = $this->l->t('{actor} removed {user} from {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARED_WITH_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARED_WITH_BY) {
|
||||
$subject = $this->l->t('{actor} shared {file} with you');
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_BY) {
|
||||
$subject = $this->l->t('{actor} removed you from the share named {file}');
|
||||
} else if ($event->getSubject() === self::SUBJECT_EXPIRED_USER) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_EXPIRED_USER) {
|
||||
$subject = $this->l->t('Share for file {file} with {user} expired');
|
||||
} else if ($event->getSubject() === self::SUBJECT_EXPIRED) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_EXPIRED) {
|
||||
$subject = $this->l->t('Share for file {file} expired');
|
||||
|
||||
} else {
|
||||
|
|
|
@ -143,7 +143,7 @@ class DeletedShareAPIController extends OCSController {
|
|||
$group = $this->groupManager->get($share->getSharedWith());
|
||||
$result['share_with'] = $share->getSharedWith();
|
||||
$result['share_with_displayname'] = $group !== null ? $group->getDisplayName() : $share->getSharedWith();
|
||||
} else if ($share->getShareType() === \OCP\Share::SHARE_TYPE_ROOM) {
|
||||
} elseif ($share->getShareType() === \OCP\Share::SHARE_TYPE_ROOM) {
|
||||
$result['share_with'] = $share->getSharedWith();
|
||||
$result['share_with_displayname'] = '';
|
||||
|
||||
|
|
|
@ -218,11 +218,11 @@ class ShareAPIController extends OCSController {
|
|||
$sharedWith = $this->userManager->get($share->getSharedWith());
|
||||
$result['share_with'] = $share->getSharedWith();
|
||||
$result['share_with_displayname'] = $sharedWith !== null ? $sharedWith->getDisplayName() : $share->getSharedWith();
|
||||
} else if ($share->getShareType() === Share::SHARE_TYPE_GROUP) {
|
||||
} elseif ($share->getShareType() === Share::SHARE_TYPE_GROUP) {
|
||||
$group = $this->groupManager->get($share->getSharedWith());
|
||||
$result['share_with'] = $share->getSharedWith();
|
||||
$result['share_with_displayname'] = $group !== null ? $group->getDisplayName() : $share->getSharedWith();
|
||||
} else if ($share->getShareType() === IShare::TYPE_LINK) {
|
||||
} elseif ($share->getShareType() === IShare::TYPE_LINK) {
|
||||
|
||||
// "share_with" and "share_with_displayname" for passwords of link
|
||||
// shares was deprecated in Nextcloud 15, use "password" instead.
|
||||
|
@ -235,17 +235,17 @@ class ShareAPIController extends OCSController {
|
|||
|
||||
$result['token'] = $share->getToken();
|
||||
$result['url'] = $this->urlGenerator->linkToRouteAbsolute('files_sharing.sharecontroller.showShare', ['token' => $share->getToken()]);
|
||||
} else if ($share->getShareType() === Share::SHARE_TYPE_REMOTE || $share->getShareType() === Share::SHARE_TYPE_REMOTE_GROUP) {
|
||||
} elseif ($share->getShareType() === Share::SHARE_TYPE_REMOTE || $share->getShareType() === Share::SHARE_TYPE_REMOTE_GROUP) {
|
||||
$result['share_with'] = $share->getSharedWith();
|
||||
$result['share_with_displayname'] = $this->getDisplayNameFromAddressBook($share->getSharedWith(), 'CLOUD');
|
||||
$result['token'] = $share->getToken();
|
||||
} else if ($share->getShareType() === Share::SHARE_TYPE_EMAIL) {
|
||||
} elseif ($share->getShareType() === Share::SHARE_TYPE_EMAIL) {
|
||||
$result['share_with'] = $share->getSharedWith();
|
||||
$result['password'] = $share->getPassword();
|
||||
$result['send_password_by_talk'] = $share->getSendPasswordByTalk();
|
||||
$result['share_with_displayname'] = $this->getDisplayNameFromAddressBook($share->getSharedWith(), 'EMAIL');
|
||||
$result['token'] = $share->getToken();
|
||||
} else if ($share->getShareType() === Share::SHARE_TYPE_CIRCLE) {
|
||||
} elseif ($share->getShareType() === Share::SHARE_TYPE_CIRCLE) {
|
||||
// getSharedWith() returns either "name (type, owner)" or
|
||||
// "name (type, owner) [id]", depending on the Circles app version.
|
||||
$hasCircleId = (substr($share->getSharedWith(), -1) === ']');
|
||||
|
@ -264,7 +264,7 @@ class ShareAPIController extends OCSController {
|
|||
$shareWithLength = -1;
|
||||
}
|
||||
$result['share_with'] = substr($share->getSharedWith(), $shareWithStart, $shareWithLength);
|
||||
} else if ($share->getShareType() === Share::SHARE_TYPE_ROOM) {
|
||||
} elseif ($share->getShareType() === Share::SHARE_TYPE_ROOM) {
|
||||
$result['share_with'] = $share->getSharedWith();
|
||||
$result['share_with_displayname'] = '';
|
||||
|
||||
|
@ -461,7 +461,7 @@ class ShareAPIController extends OCSController {
|
|||
}
|
||||
$share->setSharedWith($shareWith);
|
||||
$share->setPermissions($permissions);
|
||||
} else if ($shareType === Share::SHARE_TYPE_GROUP) {
|
||||
} elseif ($shareType === Share::SHARE_TYPE_GROUP) {
|
||||
if (!$this->shareManager->allowGroupSharing()) {
|
||||
throw new OCSNotFoundException($this->l->t('Group sharing is disabled by the administrator'));
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ class ShareAPIController extends OCSController {
|
|||
}
|
||||
$share->setSharedWith($shareWith);
|
||||
$share->setPermissions($permissions);
|
||||
} else if ($shareType === Share::SHARE_TYPE_LINK
|
||||
} elseif ($shareType === Share::SHARE_TYPE_LINK
|
||||
|| $shareType === Share::SHARE_TYPE_EMAIL) {
|
||||
|
||||
// Can we even share links?
|
||||
|
@ -533,21 +533,21 @@ class ShareAPIController extends OCSController {
|
|||
throw new OCSNotFoundException($this->l->t('Invalid date, date format must be YYYY-MM-DD'));
|
||||
}
|
||||
}
|
||||
} else if ($shareType === Share::SHARE_TYPE_REMOTE) {
|
||||
} elseif ($shareType === Share::SHARE_TYPE_REMOTE) {
|
||||
if (!$this->shareManager->outgoingServer2ServerSharesAllowed()) {
|
||||
throw new OCSForbiddenException($this->l->t('Sharing %1$s failed because the back end does not allow shares from type %2$s', [$path->getPath(), $shareType]));
|
||||
}
|
||||
|
||||
$share->setSharedWith($shareWith);
|
||||
$share->setPermissions($permissions);
|
||||
} else if ($shareType === Share::SHARE_TYPE_REMOTE_GROUP) {
|
||||
} elseif ($shareType === Share::SHARE_TYPE_REMOTE_GROUP) {
|
||||
if (!$this->shareManager->outgoingServer2ServerGroupSharesAllowed()) {
|
||||
throw new OCSForbiddenException($this->l->t('Sharing %1$s failed because the back end does not allow shares from type %2$s', [$path->getPath(), $shareType]));
|
||||
}
|
||||
|
||||
$share->setSharedWith($shareWith);
|
||||
$share->setPermissions($permissions);
|
||||
} else if ($shareType === Share::SHARE_TYPE_CIRCLE) {
|
||||
} elseif ($shareType === Share::SHARE_TYPE_CIRCLE) {
|
||||
if (!\OC::$server->getAppManager()->isEnabledForUser('circles') || !class_exists('\OCA\Circles\ShareByCircleProvider')) {
|
||||
throw new OCSNotFoundException($this->l->t('You cannot share to a Circle if the app is not enabled'));
|
||||
}
|
||||
|
@ -560,7 +560,7 @@ class ShareAPIController extends OCSController {
|
|||
}
|
||||
$share->setSharedWith($shareWith);
|
||||
$share->setPermissions($permissions);
|
||||
} else if ($shareType === Share::SHARE_TYPE_ROOM) {
|
||||
} elseif ($shareType === Share::SHARE_TYPE_ROOM) {
|
||||
try {
|
||||
$this->getRoomShareHelper()->createShare($share, $shareWith, $permissions, $expireDate);
|
||||
} catch (QueryException $e) {
|
||||
|
@ -975,14 +975,14 @@ class ShareAPIController extends OCSController {
|
|||
// Update hide download state
|
||||
if ($hideDownload === 'true') {
|
||||
$share->setHideDownload(true);
|
||||
} else if ($hideDownload === 'false') {
|
||||
} elseif ($hideDownload === 'false') {
|
||||
$share->setHideDownload(false);
|
||||
}
|
||||
|
||||
$newPermissions = null;
|
||||
if ($publicUpload === 'true') {
|
||||
$newPermissions = Constants::PERMISSION_READ | Constants::PERMISSION_CREATE | Constants::PERMISSION_UPDATE | Constants::PERMISSION_DELETE;
|
||||
} else if ($publicUpload === 'false') {
|
||||
} elseif ($publicUpload === 'false') {
|
||||
$newPermissions = Constants::PERMISSION_READ;
|
||||
}
|
||||
|
||||
|
@ -1028,7 +1028,7 @@ class ShareAPIController extends OCSController {
|
|||
|
||||
if ($expireDate === '') {
|
||||
$share->setExpirationDate(null);
|
||||
} else if ($expireDate !== null) {
|
||||
} elseif ($expireDate !== null) {
|
||||
try {
|
||||
$expireDate = $this->parseDate($expireDate);
|
||||
} catch (\Exception $e) {
|
||||
|
@ -1039,7 +1039,7 @@ class ShareAPIController extends OCSController {
|
|||
|
||||
if ($password === '') {
|
||||
$share->setPassword(null);
|
||||
} else if ($password !== null) {
|
||||
} elseif ($password !== null) {
|
||||
$share->setPassword($password);
|
||||
}
|
||||
|
||||
|
@ -1054,7 +1054,7 @@ class ShareAPIController extends OCSController {
|
|||
}
|
||||
|
||||
$share->setSendPasswordByTalk(true);
|
||||
} else if ($sendPasswordByTalk !== null) {
|
||||
} elseif ($sendPasswordByTalk !== null) {
|
||||
$share->setSendPasswordByTalk(false);
|
||||
}
|
||||
}
|
||||
|
@ -1068,7 +1068,7 @@ class ShareAPIController extends OCSController {
|
|||
|
||||
if ($expireDate === '') {
|
||||
$share->setExpirationDate(null);
|
||||
} else if ($expireDate !== null) {
|
||||
} elseif ($expireDate !== null) {
|
||||
try {
|
||||
$expireDate = $this->parseDate($expireDate);
|
||||
} catch (\Exception $e) {
|
||||
|
|
|
@ -193,7 +193,7 @@ class ShareesAPIController extends OCSController {
|
|||
|
||||
if ($shareType !== null && is_array($shareType)) {
|
||||
$shareTypes = array_intersect($shareTypes, $shareType);
|
||||
} else if (is_numeric($shareType)) {
|
||||
} elseif (is_numeric($shareType)) {
|
||||
$shareTypes = array_intersect($shareTypes, [(int) $shareType]);
|
||||
}
|
||||
sort($shareTypes);
|
||||
|
@ -362,7 +362,7 @@ class ShareesAPIController extends OCSController {
|
|||
if (isset($_GET['shareType']) && is_array($_GET['shareType'])) {
|
||||
$shareTypes = array_intersect($shareTypes, $_GET['shareType']);
|
||||
sort($shareTypes);
|
||||
} else if (is_numeric($shareType)) {
|
||||
} elseif (is_numeric($shareType)) {
|
||||
$shareTypes = array_intersect($shareTypes, [(int) $shareType]);
|
||||
sort($shareTypes);
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ class Manager {
|
|||
// check if the user is allowed to access it
|
||||
if ($validShare && (int)$share['share_type'] === Share::SHARE_TYPE_USER && $share['user'] === $this->uid) {
|
||||
return $share;
|
||||
} else if ($validShare && (int)$share['share_type'] === Share::SHARE_TYPE_GROUP) {
|
||||
} elseif ($validShare && (int)$share['share_type'] === Share::SHARE_TYPE_GROUP) {
|
||||
$user = $this->userManager->get($this->uid);
|
||||
if ($this->groupManager->get($share['user'])->inGroup($user)) {
|
||||
return $share;
|
||||
|
@ -333,7 +333,7 @@ class Manager {
|
|||
|
||||
$this->processNotification($id);
|
||||
$result = true;
|
||||
} else if ($share && (int)$share['share_type'] === Share::SHARE_TYPE_GROUP) {
|
||||
} elseif ($share && (int)$share['share_type'] === Share::SHARE_TYPE_GROUP) {
|
||||
$result = $this->writeShareToDb(
|
||||
$share['remote'],
|
||||
$share['share_token'],
|
||||
|
@ -537,7 +537,7 @@ class Manager {
|
|||
WHERE `id` = ?
|
||||
');
|
||||
$result = (bool)$query->execute([(int)$share['id']]);
|
||||
} else if ($result && (int)$share['share_type'] === Share::SHARE_TYPE_GROUP) {
|
||||
} elseif ($result && (int)$share['share_type'] === Share::SHARE_TYPE_GROUP) {
|
||||
$query = $this->connection->prepare('
|
||||
UPDATE `*PREFIX*share_external`
|
||||
SET `accepted` = ?
|
||||
|
|
|
@ -361,7 +361,7 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage {
|
|||
// old federated sharing permissions
|
||||
if (isset($response['{http://open-collaboration-services.org/ns}share-permissions'])) {
|
||||
$permissions = $response['{http://open-collaboration-services.org/ns}share-permissions'];
|
||||
} else if (isset($response['{http://open-cloud-mesh.org/ns}share-permissions'])) {
|
||||
} elseif (isset($response['{http://open-cloud-mesh.org/ns}share-permissions'])) {
|
||||
// permissions provided by the OCM API
|
||||
$permissions = $this->ocmPermissions2ncPermissions($response['{http://open-collaboration-services.org/ns}share-permissions']);
|
||||
} else {
|
||||
|
|
|
@ -60,7 +60,7 @@ class UserShareAcceptanceListener implements IEventListener {
|
|||
|
||||
if ($share->getShareType() === IShare::TYPE_USER) {
|
||||
$this->handleAutoAccept($share, $share->getSharedWith());
|
||||
} else if ($share->getShareType() === IShare::TYPE_GROUP) {
|
||||
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
|
||||
$group = $this->groupManager->get($share->getSharedWith());
|
||||
|
||||
if ($group === null) {
|
||||
|
|
|
@ -66,7 +66,7 @@ class Listener {
|
|||
$notification->setSubject(Notifier::INCOMING_USER_SHARE)
|
||||
->setUser($share->getSharedWith());
|
||||
$this->notificationManager->notify($notification);
|
||||
} else if ($share->getShareType() === IShare::TYPE_GROUP) {
|
||||
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
|
||||
$notification->setSubject(Notifier::INCOMING_GROUP_SHARE);
|
||||
$group = $this->groupManager->get($share->getSharedWith());
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ class Notifier implements INotifier {
|
|||
if ($share->getStatus() !== IShare::STATUS_PENDING) {
|
||||
throw new AlreadyProcessedException();
|
||||
}
|
||||
} else if ($share->getShareType() === IShare::TYPE_GROUP) {
|
||||
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
|
||||
if ($share->getStatus() !== IShare::STATUS_PENDING) {
|
||||
throw new AlreadyProcessedException();
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ class File implements \OCP\Share_Backend_File_Dependent {
|
|||
'permissions' => $item['permissions'],
|
||||
'uid_owner' => $item['uid_owner'],
|
||||
];
|
||||
} else if ($format === self::FORMAT_GET_FOLDER_CONTENTS) {
|
||||
} elseif ($format === self::FORMAT_GET_FOLDER_CONTENTS) {
|
||||
$files = [];
|
||||
foreach ($items as $item) {
|
||||
$file = [];
|
||||
|
@ -157,25 +157,25 @@ class File implements \OCP\Share_Backend_File_Dependent {
|
|||
$files[] = $file;
|
||||
}
|
||||
return $files;
|
||||
} else if ($format === self::FORMAT_OPENDIR) {
|
||||
} elseif ($format === self::FORMAT_OPENDIR) {
|
||||
$files = [];
|
||||
foreach ($items as $item) {
|
||||
$files[] = basename($item['file_target']);
|
||||
}
|
||||
return $files;
|
||||
} else if ($format === self::FORMAT_GET_ALL) {
|
||||
} elseif ($format === self::FORMAT_GET_ALL) {
|
||||
$ids = [];
|
||||
foreach ($items as $item) {
|
||||
$ids[] = $item['file_source'];
|
||||
}
|
||||
return $ids;
|
||||
} else if ($format === self::FORMAT_PERMISSIONS) {
|
||||
} elseif ($format === self::FORMAT_PERMISSIONS) {
|
||||
$filePermissions = [];
|
||||
foreach ($items as $item) {
|
||||
$filePermissions[$item['file_source']] = $item['permissions'];
|
||||
}
|
||||
return $filePermissions;
|
||||
} else if ($format === self::FORMAT_TARGET_NAMES) {
|
||||
} elseif ($format === self::FORMAT_TARGET_NAMES) {
|
||||
$targets = [];
|
||||
foreach ($items as $item) {
|
||||
$targets[] = $item['file_target'];
|
||||
|
|
|
@ -334,7 +334,7 @@ class SharedMountTest extends TestCase {
|
|||
|
||||
if ($type === 'file') {
|
||||
$path = $this->filename;
|
||||
} else if ($type === 'folder') {
|
||||
} elseif ($type === 'folder') {
|
||||
$path = $this->folder;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ class Helper {
|
|||
$timestamp = substr($pathparts['extension'], 1);
|
||||
$name = $pathparts['filename'];
|
||||
|
||||
} else if ($timestamp === null) {
|
||||
} elseif ($timestamp === null) {
|
||||
// for subfolders we need to calculate the timestamp only once
|
||||
$parts = explode('/', ltrim($dir, '/'));
|
||||
$timestamp = substr(pathinfo($parts[0], PATHINFO_EXTENSION), 1);
|
||||
|
|
|
@ -325,7 +325,7 @@ class Trashbin {
|
|||
self::copy_recursive($owner . '/files_versions/' . $ownerPath, $owner . '/files_trashbin/versions/' . basename($ownerPath) . '.d' . $timestamp, $rootView);
|
||||
}
|
||||
self::move($rootView, $owner . '/files_versions/' . $ownerPath, $user . '/files_trashbin/versions/' . $filename . '.d' . $timestamp);
|
||||
} else if ($versions = \OCA\Files_Versions\Storage::getVersions($owner, $ownerPath)) {
|
||||
} elseif ($versions = \OCA\Files_Versions\Storage::getVersions($owner, $ownerPath)) {
|
||||
|
||||
foreach ($versions as $v) {
|
||||
if ($owner !== $user) {
|
||||
|
@ -484,7 +484,7 @@ class Trashbin {
|
|||
|
||||
if ($view->is_dir('/files_trashbin/versions/' . $file)) {
|
||||
$rootView->rename(Filesystem::normalizePath($user . '/files_trashbin/versions/' . $file), Filesystem::normalizePath($owner . '/files_versions/' . $ownerPath));
|
||||
} else if ($versions = self::getVersionsFromTrash($versionedFile, $timestamp, $user)) {
|
||||
} elseif ($versions = self::getVersionsFromTrash($versionedFile, $timestamp, $user)) {
|
||||
foreach ($versions as $v) {
|
||||
if ($timestamp) {
|
||||
$rootView->rename($user . '/files_trashbin/versions/' . $versionedFile . '.v' . $v . '.d' . $timestamp, $owner . '/files_versions/' . $ownerPath . '.v' . $v);
|
||||
|
@ -593,7 +593,7 @@ class Trashbin {
|
|||
|
||||
if ($node instanceof Folder) {
|
||||
$size += self::calculateSize(new View('/' . $user . '/files_trashbin/files/' . $file));
|
||||
} else if ($node instanceof File) {
|
||||
} elseif ($node instanceof File) {
|
||||
$size += $view->filesize('/files_trashbin/files/' . $file);
|
||||
}
|
||||
|
||||
|
@ -618,7 +618,7 @@ class Trashbin {
|
|||
if ($view->is_dir('files_trashbin/versions/' . $file)) {
|
||||
$size += self::calculateSize(new View('/' . $user . '/files_trashbin/versions/' . $file));
|
||||
$view->unlink('files_trashbin/versions/' . $file);
|
||||
} else if ($versions = self::getVersionsFromTrash($filename, $timestamp, $user)) {
|
||||
} elseif ($versions = self::getVersionsFromTrash($filename, $timestamp, $user)) {
|
||||
foreach ($versions as $v) {
|
||||
if ($timestamp) {
|
||||
$size += $view->filesize('/files_trashbin/versions/' . $filename . '.v' . $v . '.d' . $timestamp);
|
||||
|
|
|
@ -301,7 +301,7 @@ class Storage {
|
|||
'/' . $targetOwner . '/files_versions/' . $targetPath
|
||||
);
|
||||
}
|
||||
} else if ($versions = Storage::getVersions($sourceOwner, '/' . $sourcePath)) {
|
||||
} elseif ($versions = Storage::getVersions($sourceOwner, '/' . $sourcePath)) {
|
||||
// create missing dirs if necessary
|
||||
self::createMissingDirectories($targetPath, new View('/'. $targetOwner));
|
||||
|
||||
|
@ -384,7 +384,7 @@ class Storage {
|
|||
'node' => $node,
|
||||
]);
|
||||
return true;
|
||||
} else if ($versionCreated) {
|
||||
} elseif ($versionCreated) {
|
||||
self::deleteVersion($users_view, $version);
|
||||
}
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ class GroupsController extends AUserData {
|
|||
// Check it exists
|
||||
if(!$this->groupManager->groupExists($groupId)){
|
||||
throw new OCSException('', 101);
|
||||
} else if($groupId === 'admin' || !$this->groupManager->get($groupId)->delete()){
|
||||
} elseif($groupId === 'admin' || !$this->groupManager->get($groupId)->delete()){
|
||||
// Cannot delete admin group
|
||||
throw new OCSException('', 102);
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ class UsersController extends AUserData {
|
|||
$subAdminManager = $this->groupManager->getSubAdmin();
|
||||
if ($this->groupManager->isAdmin($uid)){
|
||||
$users = $this->userManager->search($search, $limit, $offset);
|
||||
} else if ($subAdminManager->isSubAdmin($user)) {
|
||||
} elseif ($subAdminManager->isSubAdmin($user)) {
|
||||
$subAdminOfGroups = $subAdminManager->getSubAdminsGroups($user);
|
||||
foreach ($subAdminOfGroups as $key => $group) {
|
||||
$subAdminOfGroups[$key] = $group->getGID();
|
||||
|
@ -176,7 +176,7 @@ class UsersController extends AUserData {
|
|||
if ($this->groupManager->isAdmin($uid)){
|
||||
$users = $this->userManager->search($search, $limit, $offset);
|
||||
$users = array_keys($users);
|
||||
} else if ($subAdminManager->isSubAdmin($currentUser)) {
|
||||
} elseif ($subAdminManager->isSubAdmin($currentUser)) {
|
||||
$subAdminOfGroups = $subAdminManager->getSubAdminsGroups($currentUser);
|
||||
foreach ($subAdminOfGroups as $key => $group) {
|
||||
$subAdminOfGroups[$key] = $group->getGID();
|
||||
|
@ -836,7 +836,7 @@ class UsersController extends AUserData {
|
|||
throw new OCSException('Cannot remove yourself from this group as you are a SubAdmin', 105);
|
||||
}
|
||||
|
||||
} else if (!$this->groupManager->isAdmin($loggedInUser->getUID())) {
|
||||
} elseif (!$this->groupManager->isAdmin($loggedInUser->getUID())) {
|
||||
/** @var IGroup[] $subAdminGroups */
|
||||
$subAdminGroups = $subAdminManager->getSubAdminsGroups($loggedInUser);
|
||||
$subAdminGroups = array_map(function (IGroup $subAdminGroup) {
|
||||
|
|
|
@ -214,7 +214,7 @@ class AppConfigControllerTest extends TestCase {
|
|||
->method('verifyConfigKey');
|
||||
$this->config->expects($this->never())
|
||||
->method('setAppValue');
|
||||
} else if ($keyThrows instanceof \Exception) {
|
||||
} elseif ($keyThrows instanceof \Exception) {
|
||||
$api->expects($this->once())
|
||||
->method('verifyAppId')
|
||||
->with($app);
|
||||
|
@ -243,7 +243,7 @@ class AppConfigControllerTest extends TestCase {
|
|||
$this->assertSame($status, $result->getStatus());
|
||||
if ($appThrows instanceof \Exception) {
|
||||
$this->assertEquals(['data' => ['message' => $appThrows->getMessage()]], $result->getData());
|
||||
} else if ($keyThrows instanceof \Exception) {
|
||||
} elseif ($keyThrows instanceof \Exception) {
|
||||
$this->assertEquals(['data' => ['message' => $keyThrows->getMessage()]], $result->getData());
|
||||
} else {
|
||||
$this->assertEquals([], $result->getData());
|
||||
|
@ -279,7 +279,7 @@ class AppConfigControllerTest extends TestCase {
|
|||
->method('verifyConfigKey');
|
||||
$this->config->expects($this->never())
|
||||
->method('deleteAppValue');
|
||||
} else if ($keyThrows instanceof \Exception) {
|
||||
} elseif ($keyThrows instanceof \Exception) {
|
||||
$api->expects($this->once())
|
||||
->method('verifyAppId')
|
||||
->with($app);
|
||||
|
@ -308,7 +308,7 @@ class AppConfigControllerTest extends TestCase {
|
|||
$this->assertSame($status, $result->getStatus());
|
||||
if ($appThrows instanceof \Exception) {
|
||||
$this->assertEquals(['data' => ['message' => $appThrows->getMessage()]], $result->getData());
|
||||
} else if ($keyThrows instanceof \Exception) {
|
||||
} elseif ($keyThrows instanceof \Exception) {
|
||||
$this->assertEquals(['data' => ['message' => $keyThrows->getMessage()]], $result->getData());
|
||||
} else {
|
||||
$this->assertEquals([], $result->getData());
|
||||
|
|
|
@ -96,7 +96,7 @@ class GroupProvider implements IProvider {
|
|||
} else {
|
||||
$subject = $l->t('{actor} added {user} to group {group}');
|
||||
}
|
||||
} else if ($this->activityManager->getCurrentUserId() === $params['user']) {
|
||||
} elseif ($this->activityManager->getCurrentUserId() === $params['user']) {
|
||||
$subject = $l->t('An administrator added you to group {group}');
|
||||
} else {
|
||||
$subject = $l->t('An administrator added {user} to group {group}');
|
||||
|
@ -111,7 +111,7 @@ class GroupProvider implements IProvider {
|
|||
} else {
|
||||
$subject = $l->t('{actor} removed {user} from group {group}');
|
||||
}
|
||||
} else if ($this->activityManager->getCurrentUserId() === $params['user']) {
|
||||
} elseif ($this->activityManager->getCurrentUserId() === $params['user']) {
|
||||
$subject = $l->t('An administrator removed you from group {group}');
|
||||
} else {
|
||||
$subject = $l->t('An administrator removed {user} from group {group}');
|
||||
|
|
|
@ -102,27 +102,27 @@ class Provider implements IProvider {
|
|||
|
||||
if ($event->getSubject() === self::PASSWORD_CHANGED_BY) {
|
||||
$subject = $this->l->t('{actor} changed your password');
|
||||
} else if ($event->getSubject() === self::PASSWORD_CHANGED_SELF) {
|
||||
} elseif ($event->getSubject() === self::PASSWORD_CHANGED_SELF) {
|
||||
$subject = $this->l->t('You changed your password');
|
||||
} else if ($event->getSubject() === self::PASSWORD_RESET) {
|
||||
} elseif ($event->getSubject() === self::PASSWORD_RESET) {
|
||||
$subject = $this->l->t('Your password was reset by an administrator');
|
||||
|
||||
} else if ($event->getSubject() === self::EMAIL_CHANGED_BY) {
|
||||
} elseif ($event->getSubject() === self::EMAIL_CHANGED_BY) {
|
||||
$subject = $this->l->t('{actor} changed your email address');
|
||||
} else if ($event->getSubject() === self::EMAIL_CHANGED_SELF) {
|
||||
} elseif ($event->getSubject() === self::EMAIL_CHANGED_SELF) {
|
||||
$subject = $this->l->t('You changed your email address');
|
||||
} else if ($event->getSubject() === self::EMAIL_CHANGED) {
|
||||
} elseif ($event->getSubject() === self::EMAIL_CHANGED) {
|
||||
$subject = $this->l->t('Your email address was changed by an administrator');
|
||||
|
||||
} else if ($event->getSubject() === self::APP_TOKEN_CREATED) {
|
||||
} elseif ($event->getSubject() === self::APP_TOKEN_CREATED) {
|
||||
$subject = $this->l->t('You created app password "{token}"');
|
||||
} else if ($event->getSubject() === self::APP_TOKEN_DELETED) {
|
||||
} elseif ($event->getSubject() === self::APP_TOKEN_DELETED) {
|
||||
$subject = $this->l->t('You deleted app password "{token}"');
|
||||
} else if ($event->getSubject() === self::APP_TOKEN_RENAMED) {
|
||||
} elseif ($event->getSubject() === self::APP_TOKEN_RENAMED) {
|
||||
$subject = $this->l->t('You renamed app password "{token}" to "{newToken}"');
|
||||
} else if ($event->getSubject() === self::APP_TOKEN_FILESYSTEM_GRANTED) {
|
||||
} elseif ($event->getSubject() === self::APP_TOKEN_FILESYSTEM_GRANTED) {
|
||||
$subject = $this->l->t('You granted filesystem access to app password "{token}"');
|
||||
} else if ($event->getSubject() === self::APP_TOKEN_FILESYSTEM_REVOKED) {
|
||||
} elseif ($event->getSubject() === self::APP_TOKEN_FILESYSTEM_REVOKED) {
|
||||
$subject = $this->l->t('You revoked filesystem access from app password "{token}"');
|
||||
|
||||
} else {
|
||||
|
|
|
@ -89,7 +89,7 @@ trait CommonSettingsTrait {
|
|||
foreach ($prioritizedSections as $section) {
|
||||
if($type === 'admin') {
|
||||
$settings = $this->settingsManager->getAdminSettings($section->getID(), $subAdminOnly);
|
||||
} else if($type === 'personal') {
|
||||
} elseif($type === 'personal') {
|
||||
$settings = $this->settingsManager->getPersonalSettings($section->getID());
|
||||
}
|
||||
if (empty($settings) && !($section->getID() === 'additional' && count(\OC_App::getForms('admin')) > 0)) {
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<span class="crondate" title="<?php p($absolute_time);?>">
|
||||
<?php p($l->t("Last job execution ran %s. Something seems wrong.", [$relative_time]));?>
|
||||
</span>
|
||||
<?php } else if (time() - $_['cronMaxAge'] > 12*3600) {
|
||||
<?php } elseif (time() - $_['cronMaxAge'] > 12*3600) {
|
||||
if ($_['backgroundjobs_mode'] === 'cron') { ?>
|
||||
<span class="status warning"></span>
|
||||
<span class="crondate" title="<?php p($maxAgeAbsoluteTime);?>">
|
||||
|
|
|
@ -21,4 +21,4 @@
|
|||
*
|
||||
*/
|
||||
|
||||
# used for Personal/Additional settings as fallback for legacy settings
|
||||
# used for Personal/Additional settings as fallback for legacy settings
|
||||
|
|
|
@ -129,7 +129,7 @@ class Activity implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_BY) {
|
||||
$event->setParsedSubject($this->l->t('Shared with %1$s by %2$s', [
|
||||
$parsedParameters['email']['name'],
|
||||
$parsedParameters['actor']['name'],
|
||||
|
@ -143,7 +143,7 @@ class Activity implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_SELF) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_SELF) {
|
||||
$event->setParsedSubject($this->l->t('Unshared from %1$s', [
|
||||
$parsedParameters['email']['name'],
|
||||
]))
|
||||
|
@ -155,7 +155,7 @@ class Activity implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_BY) {
|
||||
$event->setParsedSubject($this->l->t('Unshared from %1$s by %2$s', [
|
||||
$parsedParameters['email']['name'],
|
||||
$parsedParameters['actor']['name'],
|
||||
|
@ -169,7 +169,7 @@ class Activity implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND) {
|
||||
$event->setParsedSubject($this->l->t('Password for mail share sent to %1$s', [
|
||||
$parsedParameters['email']['name']
|
||||
]))
|
||||
|
@ -181,7 +181,7 @@ class Activity implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF) {
|
||||
$event->setParsedSubject($this->l->t('Password for mail share sent to you'))
|
||||
->setRichSubject($this->l->t('Password for mail share sent to you'));
|
||||
if ($this->activityManager->getRequirePNG()) {
|
||||
|
@ -216,7 +216,7 @@ class Activity implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_BY) {
|
||||
$event->setParsedSubject($this->l->t('%3$s shared %1$s with %2$s by mail', [
|
||||
$parsedParameters['file']['path'],
|
||||
$parsedParameters['email']['name'],
|
||||
|
@ -228,7 +228,7 @@ class Activity implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_SELF) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_SELF) {
|
||||
$event->setParsedSubject($this->l->t('You unshared %1$s from %2$s by mail', [
|
||||
$parsedParameters['file']['path'],
|
||||
$parsedParameters['email']['name'],
|
||||
|
@ -239,7 +239,7 @@ class Activity implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_BY) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_UNSHARED_EMAIL_BY) {
|
||||
$event->setParsedSubject($this->l->t('%3$s unshared %1$s from %2$s by mail', [
|
||||
$parsedParameters['file']['path'],
|
||||
$parsedParameters['email']['name'],
|
||||
|
@ -251,7 +251,7 @@ class Activity implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND) {
|
||||
$event->setParsedSubject($this->l->t('Password to access %1$s was sent to %2s', [
|
||||
$parsedParameters['file']['path'],
|
||||
$parsedParameters['email']['name']
|
||||
|
@ -262,7 +262,7 @@ class Activity implements IProvider {
|
|||
} else {
|
||||
$event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg')));
|
||||
}
|
||||
} else if ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF) {
|
||||
} elseif ($event->getSubject() === self::SUBJECT_SHARED_EMAIL_PASSWORD_SEND_SELF) {
|
||||
$event->setParsedSubject(
|
||||
$this->l->t('Password to access %1$s was sent to you',
|
||||
[$parsedParameters['file']['path']]))
|
||||
|
|
|
@ -117,13 +117,13 @@ class Listener {
|
|||
$actor,
|
||||
$this->prepareTagAsParameter($event->getTag()),
|
||||
]);
|
||||
} else if ($event->getEvent() === ManagerEvent::EVENT_UPDATE) {
|
||||
} elseif ($event->getEvent() === ManagerEvent::EVENT_UPDATE) {
|
||||
$activity->setSubject(Provider::UPDATE_TAG, [
|
||||
$actor,
|
||||
$this->prepareTagAsParameter($event->getTag()),
|
||||
$this->prepareTagAsParameter($event->getTagBefore()),
|
||||
]);
|
||||
} else if ($event->getEvent() === ManagerEvent::EVENT_DELETE) {
|
||||
} elseif ($event->getEvent() === ManagerEvent::EVENT_DELETE) {
|
||||
$activity->setSubject(Provider::DELETE_TAG, [
|
||||
$actor,
|
||||
$this->prepareTagAsParameter($event->getTag()),
|
||||
|
@ -217,7 +217,7 @@ class Listener {
|
|||
$path,
|
||||
$this->prepareTagAsParameter($tag),
|
||||
]);
|
||||
} else if ($event->getEvent() === MapperEvent::EVENT_UNASSIGN) {
|
||||
} elseif ($event->getEvent() === MapperEvent::EVENT_UNASSIGN) {
|
||||
$activity->setSubject(Provider::UNASSIGN_TAG, [
|
||||
$actor,
|
||||
$path,
|
||||
|
|
|
@ -121,7 +121,7 @@ class Provider implements IProvider {
|
|||
->setRichSubject($this->l->t('Added system tag {systemtag}'), [
|
||||
'systemtag' => $parsedParameters['systemtag'],
|
||||
]);
|
||||
} else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
|
||||
} elseif ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
|
||||
$event->setParsedSubject($this->l->t('Added system tag %1$s', [
|
||||
$this->generatePlainSystemTag($parsedParameters['systemtag']),
|
||||
]))
|
||||
|
@ -138,7 +138,7 @@ class Provider implements IProvider {
|
|||
'systemtag' => $parsedParameters['systemtag'],
|
||||
]);
|
||||
}
|
||||
} else if ($event->getSubject() === self::UNASSIGN_TAG) {
|
||||
} elseif ($event->getSubject() === self::UNASSIGN_TAG) {
|
||||
if ($parsedParameters['actor']['id'] === '') {
|
||||
$event->setParsedSubject($this->l->t('System tag %1$s removed by the system', [
|
||||
$this->generatePlainSystemTag($parsedParameters['systemtag']),
|
||||
|
@ -146,7 +146,7 @@ class Provider implements IProvider {
|
|||
->setRichSubject($this->l->t('Removed system tag {systemtag}'), [
|
||||
'systemtag' => $parsedParameters['systemtag'],
|
||||
]);
|
||||
} else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
|
||||
} elseif ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
|
||||
$event->setParsedSubject($this->l->t('Removed system tag %1$s', [
|
||||
$this->generatePlainSystemTag($parsedParameters['systemtag']),
|
||||
]))
|
||||
|
@ -198,7 +198,7 @@ class Provider implements IProvider {
|
|||
]))
|
||||
->setRichSubject($this->l->t('{actor} created system tag {systemtag}'), $parsedParameters);
|
||||
}
|
||||
} else if ($event->getSubject() === self::DELETE_TAG) {
|
||||
} elseif ($event->getSubject() === self::DELETE_TAG) {
|
||||
if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
|
||||
$event->setParsedSubject($this->l->t('You deleted system tag %1$s', [
|
||||
$this->generatePlainSystemTag($parsedParameters['systemtag']),
|
||||
|
@ -211,7 +211,7 @@ class Provider implements IProvider {
|
|||
]))
|
||||
->setRichSubject($this->l->t('{actor} deleted system tag {systemtag}'), $parsedParameters);
|
||||
}
|
||||
} else if ($event->getSubject() === self::UPDATE_TAG) {
|
||||
} elseif ($event->getSubject() === self::UPDATE_TAG) {
|
||||
if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
|
||||
$event->setParsedSubject($this->l->t('You updated system tag %2$s to %1$s', [
|
||||
$this->generatePlainSystemTag($parsedParameters['newsystemtag']),
|
||||
|
@ -226,7 +226,7 @@ class Provider implements IProvider {
|
|||
]))
|
||||
->setRichSubject($this->l->t('{actor} updated system tag {oldsystemtag} to {newsystemtag}'), $parsedParameters);
|
||||
}
|
||||
} else if ($event->getSubject() === self::ASSIGN_TAG) {
|
||||
} elseif ($event->getSubject() === self::ASSIGN_TAG) {
|
||||
if ($parsedParameters['actor']['id'] === '') {
|
||||
unset($parsedParameters['actor']);
|
||||
$event->setParsedSubject($this->l->t('System tag %2$s was added to %1$s by the system', [
|
||||
|
@ -234,7 +234,7 @@ class Provider implements IProvider {
|
|||
$this->generatePlainSystemTag($parsedParameters['systemtag']),
|
||||
]))
|
||||
->setRichSubject($this->l->t('System tag {systemtag} was added to {file} by the system'), $parsedParameters);
|
||||
} else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
|
||||
} elseif ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
|
||||
$event->setParsedSubject($this->l->t('You added system tag %2$s to %1$s', [
|
||||
$parsedParameters['file']['path'],
|
||||
$this->generatePlainSystemTag($parsedParameters['systemtag']),
|
||||
|
@ -248,7 +248,7 @@ class Provider implements IProvider {
|
|||
]))
|
||||
->setRichSubject($this->l->t('{actor} added system tag {systemtag} to {file}'), $parsedParameters);
|
||||
}
|
||||
} else if ($event->getSubject() === self::UNASSIGN_TAG) {
|
||||
} elseif ($event->getSubject() === self::UNASSIGN_TAG) {
|
||||
if ($parsedParameters['actor']['id'] === '') {
|
||||
unset($parsedParameters['actor']);
|
||||
$event->setParsedSubject($this->l->t('System tag %2$s was removed from %1$s by the system', [
|
||||
|
@ -256,7 +256,7 @@ class Provider implements IProvider {
|
|||
$this->generatePlainSystemTag($parsedParameters['systemtag']),
|
||||
]))
|
||||
->setRichSubject($this->l->t('System tag {systemtag} was removed from {file} by the system'), $parsedParameters);
|
||||
} else if ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
|
||||
} elseif ($parsedParameters['actor']['id'] === $this->activityManager->getCurrentUserId()) {
|
||||
$event->setParsedSubject($this->l->t('You removed system tag %2$s from %1$s', [
|
||||
$parsedParameters['file']['path'],
|
||||
$this->generatePlainSystemTag($parsedParameters['systemtag']),
|
||||
|
@ -350,7 +350,7 @@ class Provider implements IProvider {
|
|||
protected function generatePlainSystemTag(array $parameter) {
|
||||
if ($parameter['assignable'] === '1') {
|
||||
return $parameter['name'];
|
||||
} else if ($parameter['visibility'] === '1') {
|
||||
} elseif ($parameter['visibility'] === '1') {
|
||||
return $this->l->t('%s (restricted)', $parameter['name']);
|
||||
} else {
|
||||
return $this->l->t('%s (invisible)', $parameter['name']);
|
||||
|
|
|
@ -233,7 +233,7 @@ class LockingController extends OCSController {
|
|||
|
||||
if ($type === ILockingProvider::LOCK_EXCLUSIVE && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_EXCLUSIVE) {
|
||||
$lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
|
||||
} else if ($type === ILockingProvider::LOCK_SHARED && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) {
|
||||
} elseif ($type === ILockingProvider::LOCK_SHARED && (int)$this->config->getAppValue('testing', $lock) === ILockingProvider::LOCK_SHARED) {
|
||||
$lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
|
||||
} else {
|
||||
$lockingProvider->releaseLock($path, $this->config->getAppValue('testing', $lock));
|
||||
|
|
|
@ -86,7 +86,7 @@ class Check extends Command {
|
|||
// Report summary
|
||||
if ($updatesAvailableCount === 0) {
|
||||
$output->writeln('<info>Everything up to date</info>');
|
||||
} else if ($updatesAvailableCount === 1) {
|
||||
} elseif ($updatesAvailableCount === 1) {
|
||||
$output->writeln('<comment>1 update available</comment>');
|
||||
} else {
|
||||
$output->writeln('<comment>' . $updatesAvailableCount . ' updates available</comment>');
|
||||
|
|
|
@ -107,7 +107,7 @@ class BackgroundJob extends TimedJob {
|
|||
if (\in_array($errors, $this->connectionNotifications, true)) {
|
||||
$this->sendErrorNotifications($errors);
|
||||
}
|
||||
} else if (\is_array($status)) {
|
||||
} elseif (\is_array($status)) {
|
||||
$this->config->setAppValue('updatenotification', 'update_check_errors', 0);
|
||||
$this->clearErrorNotifications();
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ class BackgroundJobTest extends TestCase {
|
|||
->method('createNotifications');
|
||||
$job->expects($versionCheck === null ? $this->never() : $this->once())
|
||||
->method('clearErrorNotifications');
|
||||
} else if ($version === false) {
|
||||
} elseif ($version === false) {
|
||||
$job->expects($this->never())
|
||||
->method('createNotifications');
|
||||
$job->expects($this->never())
|
||||
|
|
|
@ -46,7 +46,7 @@ try {
|
|||
\OC::$server->getUserManager()->emit('\OC\User', 'postUnassignedUserId', [$uid]);
|
||||
}
|
||||
);
|
||||
} else if($subject === 'group') {
|
||||
} elseif($subject === 'group') {
|
||||
$mapping = new GroupMapping(\OC::$server->getDatabaseConnection());
|
||||
$result = $mapping->clear();
|
||||
}
|
||||
|
|
|
@ -729,7 +729,7 @@ class Access extends LDAPUtility {
|
|||
$sndName = isset($ldapObject[$sndAttribute][0])
|
||||
? $ldapObject[$sndAttribute][0] : '';
|
||||
$this->cacheUserDisplayName($ncName, $nameByLDAP, $sndName);
|
||||
} else if($nameByLDAP !== null) {
|
||||
} elseif($nameByLDAP !== null) {
|
||||
$this->cacheGroupDisplayName($ncName, $nameByLDAP);
|
||||
}
|
||||
}
|
||||
|
@ -1390,7 +1390,7 @@ class Access extends LDAPUtility {
|
|||
if($key !== 'dn') {
|
||||
if($this->resemblesDN($key)) {
|
||||
$selection[$i][$key] = $this->helper->sanitizeDN($item[$key]);
|
||||
} else if($key === 'objectguid' || $key === 'guid') {
|
||||
} elseif($key === 'objectguid' || $key === 'guid') {
|
||||
$selection[$i][$key] = [$this->convertObjectGUID2Str($item[$key][0])];
|
||||
} else {
|
||||
$selection[$i][$key] = $item[$key];
|
||||
|
@ -1609,7 +1609,7 @@ class Access extends LDAPUtility {
|
|||
$result = $term;
|
||||
if ($term === '') {
|
||||
$result = '*';
|
||||
} else if ($allowEnum !== 'no') {
|
||||
} elseif ($allowEnum !== 'no') {
|
||||
$result = $term . '*';
|
||||
}
|
||||
return $result;
|
||||
|
@ -1716,7 +1716,7 @@ class Access extends LDAPUtility {
|
|||
if(!$force) {
|
||||
if($this->connection->$uuidAttr !== 'auto') {
|
||||
return true;
|
||||
} else if (is_string($uuidOverride) && trim($uuidOverride) !== '') {
|
||||
} elseif (is_string($uuidOverride) && trim($uuidOverride) !== '') {
|
||||
$this->connection->$uuidAttr = $uuidOverride;
|
||||
return true;
|
||||
}
|
||||
|
@ -2097,7 +2097,7 @@ class Access extends LDAPUtility {
|
|||
* So we added "&& !empty($this->lastCookie)" to this test to ignore pagination
|
||||
* if we don't have a previous paged search.
|
||||
*/
|
||||
} else if ($limit === 0 && !empty($this->lastCookie)) {
|
||||
} elseif ($limit === 0 && !empty($this->lastCookie)) {
|
||||
// a search without limit was requested. However, if we do use
|
||||
// Paged Search once, we always must do it. This requires us to
|
||||
// initialize it with the configured page size.
|
||||
|
|
|
@ -60,9 +60,9 @@ class TestConfig extends Command {
|
|||
$result = $this->testConfig($configID);
|
||||
if($result === 0) {
|
||||
$output->writeln('The configuration is valid and the connection could be established!');
|
||||
} else if($result === 1) {
|
||||
} elseif($result === 1) {
|
||||
$output->writeln('The configuration is invalid. Please have a look at the logs for further details.');
|
||||
} else if($result === 2) {
|
||||
} elseif($result === 2) {
|
||||
$output->writeln('The configuration is valid, but the Bind failed. Please check the server settings and credentials.');
|
||||
} else {
|
||||
$output->writeln('Your LDAP server was kidnapped by aliens.');
|
||||
|
|
|
@ -318,7 +318,7 @@ class Configuration {
|
|||
protected function setMultiLine($varName, $value) {
|
||||
if(empty($value)) {
|
||||
$value = '';
|
||||
} else if (!is_array($value)) {
|
||||
} elseif (!is_array($value)) {
|
||||
$value = preg_split('/\r\n|\r|\n|;/', $value);
|
||||
if($value === false) {
|
||||
$value = '';
|
||||
|
|
|
@ -202,7 +202,7 @@ class Connection extends LDAPUtility {
|
|||
public function getConnectionResource() {
|
||||
if(!$this->ldapConnectionRes) {
|
||||
$this->init();
|
||||
} else if(!$this->ldap->isResource($this->ldapConnectionRes)) {
|
||||
} elseif(!$this->ldap->isResource($this->ldapConnectionRes)) {
|
||||
$this->ldapConnectionRes = null;
|
||||
$this->establishConnection();
|
||||
}
|
||||
|
|
|
@ -736,7 +736,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
|
|||
|| (strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'member')
|
||||
) {
|
||||
$uid = $userDN;
|
||||
} else if(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'memberuid') {
|
||||
} elseif(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'memberuid') {
|
||||
$result = $this->access->readAttribute($userDN, 'uid');
|
||||
if ($result === false) {
|
||||
\OCP\Util::writeLog('user_ldap', 'No uid attribute found for DN ' . $userDN . ' on '.
|
||||
|
|
|
@ -208,7 +208,7 @@ class Helper {
|
|||
$domain = false;
|
||||
if(isset($uinfo['host'])) {
|
||||
$domain = $uinfo['host'];
|
||||
} else if(isset($uinfo['path'])) {
|
||||
} elseif(isset($uinfo['path'])) {
|
||||
$domain = $uinfo['path'];
|
||||
}
|
||||
|
||||
|
|
|
@ -343,19 +343,19 @@ class LDAP implements ILDAPWrapper {
|
|||
|
||||
if($this->curFunc === 'ldap_get_entries'
|
||||
&& $errorCode === -4) {
|
||||
} else if ($errorCode === 32) {
|
||||
} elseif ($errorCode === 32) {
|
||||
//for now
|
||||
} else if ($errorCode === 10) {
|
||||
} elseif ($errorCode === 10) {
|
||||
//referrals, we switch them off, but then there is AD :)
|
||||
} else if ($errorCode === -1) {
|
||||
} elseif ($errorCode === -1) {
|
||||
throw new ServerNotAvailableException('Lost connection to LDAP server.');
|
||||
} else if ($errorCode === 52) {
|
||||
} elseif ($errorCode === 52) {
|
||||
throw new ServerNotAvailableException('LDAP server is shutting down.');
|
||||
} else if ($errorCode === 48) {
|
||||
} elseif ($errorCode === 48) {
|
||||
throw new \Exception('LDAP authentication method rejected', $errorCode);
|
||||
} else if ($errorCode === 1) {
|
||||
} elseif ($errorCode === 1) {
|
||||
throw new \Exception('LDAP Operations error', $errorCode);
|
||||
} else if ($errorCode === 19) {
|
||||
} elseif ($errorCode === 19) {
|
||||
ldap_get_option($this->curArgs[0], LDAP_OPT_ERROR_STRING, $extended_error);
|
||||
throw new ConstraintViolationException(!empty($extended_error)?$extended_error:$errorMsg, $errorCode);
|
||||
} else {
|
||||
|
@ -375,7 +375,7 @@ class LDAP implements ILDAPWrapper {
|
|||
private function postFunctionCall() {
|
||||
if($this->isResource($this->curArgs[0])) {
|
||||
$resource = $this->curArgs[0];
|
||||
} else if(
|
||||
} elseif(
|
||||
$this->curFunc === 'ldap_search'
|
||||
&& is_array($this->curArgs[0])
|
||||
&& $this->isResource($this->curArgs[0][0])
|
||||
|
|
|
@ -83,7 +83,7 @@ class Notifier implements INotifier {
|
|||
$days = (int) $params[0];
|
||||
if ($days === 2) {
|
||||
$notification->setParsedSubject($l->t('Your password will expire tomorrow.'));
|
||||
} else if ($days === 1) {
|
||||
} elseif ($days === 1) {
|
||||
$notification->setParsedSubject($l->t('Your password will expire today.'));
|
||||
} else {
|
||||
$notification->setParsedSubject($l->n(
|
||||
|
|
|
@ -260,7 +260,7 @@ class Manager {
|
|||
$this->checkAccess();
|
||||
if(isset($this->usersByDN[$id])) {
|
||||
return $this->usersByDN[$id];
|
||||
} else if(isset($this->usersByUid[$id])) {
|
||||
} elseif(isset($this->usersByUid[$id])) {
|
||||
return $this->usersByUid[$id];
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ class User {
|
|||
if ($username === null) {
|
||||
$log->log("uid for '$dn' must not be null!", ILogger::ERROR);
|
||||
throw new \InvalidArgumentException('uid must not be null!');
|
||||
} else if ($username === '') {
|
||||
} elseif ($username === '') {
|
||||
$log->log("uid for '$dn' must not be an empty string", ILogger::ERROR);
|
||||
throw new \InvalidArgumentException('uid must not be an empty string!');
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ class User {
|
|||
// LDAP Username, needed for s2s sharing
|
||||
if(isset($ldapEntry['uid'])) {
|
||||
$this->storeLDAPUserName($ldapEntry['uid'][0]);
|
||||
} else if(isset($ldapEntry['samaccountname'])) {
|
||||
} elseif(isset($ldapEntry['samaccountname'])) {
|
||||
$this->storeLDAPUserName($ldapEntry['samaccountname'][0]);
|
||||
}
|
||||
|
||||
|
@ -548,10 +548,10 @@ class User {
|
|||
$aQuota = $this->access->readAttribute($this->dn, $quotaAttribute);
|
||||
if($aQuota && (count($aQuota) > 0) && $this->verifyQuotaValue($aQuota[0])) {
|
||||
$quota = $aQuota[0];
|
||||
} else if(is_array($aQuota) && isset($aQuota[0])) {
|
||||
} elseif(is_array($aQuota) && isset($aQuota[0])) {
|
||||
$this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $aQuota[0] . ']', ILogger::DEBUG);
|
||||
}
|
||||
} else if ($this->verifyQuotaValue($valueFromLDAP)) {
|
||||
} elseif ($this->verifyQuotaValue($valueFromLDAP)) {
|
||||
$quota = $valueFromLDAP;
|
||||
} else {
|
||||
$this->log->log('no suitable LDAP quota found for user ' . $this->uid . ': [' . $valueFromLDAP . ']', ILogger::DEBUG);
|
||||
|
@ -560,7 +560,7 @@ class User {
|
|||
if ($quota === false && $this->verifyQuotaValue($defaultQuota)) {
|
||||
// quota not found using the LDAP attribute (or not parseable). Try the default quota
|
||||
$quota = $defaultQuota;
|
||||
} else if($quota === false) {
|
||||
} elseif($quota === false) {
|
||||
$this->log->log('no suitable default quota found for user ' . $this->uid . ': [' . $defaultQuota . ']', ILogger::DEBUG);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -106,9 +106,9 @@ class Wizard extends LDAPUtility {
|
|||
$limit = 1001;
|
||||
if($type === 'groups') {
|
||||
$result = $this->access->countGroups($filter, $attr, $limit);
|
||||
} else if($type === 'users') {
|
||||
} elseif($type === 'users') {
|
||||
$result = $this->access->countUsers($filter, $attr, $limit);
|
||||
} else if ($type === 'objects') {
|
||||
} elseif ($type === 'objects') {
|
||||
$result = $this->access->countObjects($limit);
|
||||
} else {
|
||||
throw new \Exception('Internal error: Invalid object type', 500);
|
||||
|
@ -981,9 +981,9 @@ class Wizard extends LDAPUtility {
|
|||
$attr = '';
|
||||
if(isset($userAttributes['uid'])) {
|
||||
$attr = 'uid';
|
||||
} else if(isset($userAttributes['samaccountname'])) {
|
||||
} elseif(isset($userAttributes['samaccountname'])) {
|
||||
$attr = 'samaccountname';
|
||||
} else if(isset($userAttributes['cn'])) {
|
||||
} elseif(isset($userAttributes['cn'])) {
|
||||
//fallback
|
||||
$attr = 'cn';
|
||||
}
|
||||
|
@ -1239,7 +1239,7 @@ class Wizard extends LDAPUtility {
|
|||
if(is_array($setFeatures) && !empty($setFeatures)) {
|
||||
//something is already configured? pre-select it.
|
||||
$this->result->addChange($dbkey, $setFeatures);
|
||||
} else if ($po && $maxEntryObjC !== '') {
|
||||
} elseif ($po && $maxEntryObjC !== '') {
|
||||
//pre-select objectclass with most result entries
|
||||
$maxEntryObjC = str_replace($p, '', $maxEntryObjC);
|
||||
$this->applyFind($dbkey, $maxEntryObjC);
|
||||
|
|
|
@ -523,7 +523,7 @@ class Group_LDAPTest extends TestCase {
|
|||
->willReturnCallback(function ($dn, $attr) {
|
||||
if($attr === 'primaryGroupToken') {
|
||||
return [1337];
|
||||
} else if($attr === 'gidNumber') {
|
||||
} elseif($attr === 'gidNumber') {
|
||||
return [4211];
|
||||
}
|
||||
return [];
|
||||
|
@ -657,7 +657,7 @@ class Group_LDAPTest extends TestCase {
|
|||
->willReturnCallback(function ($name) {
|
||||
if($name === 'useMemberOfToDetectMembership') {
|
||||
return 0;
|
||||
} else if($name === 'ldapDynamicGroupMemberURL') {
|
||||
} elseif($name === 'ldapDynamicGroupMemberURL') {
|
||||
return '';
|
||||
}
|
||||
return 1;
|
||||
|
@ -1082,9 +1082,9 @@ class Group_LDAPTest extends TestCase {
|
|||
->willReturnCallback(function ($name) {
|
||||
if($name === 'ldapGroupMemberAssocAttr') {
|
||||
return 'member';
|
||||
} else if($name === 'ldapGroupFilter') {
|
||||
} elseif($name === 'ldapGroupFilter') {
|
||||
return 'objectclass=nextcloudGroup';
|
||||
} else if($name === 'ldapGroupDisplayName') {
|
||||
} elseif($name === 'ldapGroupDisplayName') {
|
||||
return 'cn';
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -871,7 +871,7 @@ class User_LDAPTest extends TestCase {
|
|||
->willReturnCallback(function ($uid) use ($user1, $user2) {
|
||||
if($uid === 'gunslinger') {
|
||||
return $user1;
|
||||
} else if($uid === 'newyorker') {
|
||||
} elseif($uid === 'newyorker') {
|
||||
return $user2;
|
||||
}
|
||||
return null;
|
||||
|
@ -950,7 +950,7 @@ class User_LDAPTest extends TestCase {
|
|||
->willReturnCallback(function ($uid) use ($user1, $user2) {
|
||||
if($uid === 'gunslinger') {
|
||||
return $user1;
|
||||
} else if($uid === 'newyorker') {
|
||||
} elseif($uid === 'newyorker') {
|
||||
return $user2;
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -282,9 +282,9 @@ class WizardTest extends TestCase {
|
|||
->willReturnCallback(function ($filter) {
|
||||
if($filter === 'myEmailAttribute') {
|
||||
return 0;
|
||||
} else if($filter === 'mail') {
|
||||
} elseif($filter === 'mail') {
|
||||
return 3;
|
||||
} else if($filter === 'mailPrimaryAddress') {
|
||||
} elseif($filter === 'mailPrimaryAddress') {
|
||||
return 17;
|
||||
}
|
||||
throw new \Exception('Untested filter: ' . $filter);
|
||||
|
@ -321,9 +321,9 @@ class WizardTest extends TestCase {
|
|||
->willReturnCallback(function ($filter) {
|
||||
if($filter === 'myEmailAttribute') {
|
||||
return 0;
|
||||
} else if($filter === 'mail') {
|
||||
} elseif($filter === 'mail') {
|
||||
return 3;
|
||||
} else if($filter === 'mailPrimaryAddress') {
|
||||
} elseif($filter === 'mailPrimaryAddress') {
|
||||
return 17;
|
||||
}
|
||||
throw new \Exception('Untested filter: ' . $filter);
|
||||
|
@ -360,9 +360,9 @@ class WizardTest extends TestCase {
|
|||
->willReturnCallback(function ($filter) {
|
||||
if($filter === 'myEmailAttribute') {
|
||||
return 0;
|
||||
} else if($filter === 'mail') {
|
||||
} elseif($filter === 'mail') {
|
||||
return 0;
|
||||
} else if($filter === 'mailPrimaryAddress') {
|
||||
} elseif($filter === 'mailPrimaryAddress') {
|
||||
return 0;
|
||||
}
|
||||
throw new \Exception('Untested filter: ' . $filter);
|
||||
|
|
|
@ -112,7 +112,7 @@ class Application extends \OCP\AppFramework\App {
|
|||
if ($event instanceof Event) {
|
||||
$entity->prepareRuleMatcher($ruleMatcher, $eventName, $event);
|
||||
$operation->onEvent($eventName, $event, $ruleMatcher);
|
||||
} else if ($entity instanceof IEntityCompat && $operation instanceof IOperationCompat) {
|
||||
} elseif ($entity instanceof IEntityCompat && $operation instanceof IOperationCompat) {
|
||||
// TODO: Remove this block (and the compat classes) in the first major release in 2023
|
||||
$entity->prepareRuleMatcherCompat($ruleMatcher, $eventName, $event);
|
||||
$operation->onEventCompat($eventName, $event, $ruleMatcher);
|
||||
|
|
|
@ -64,7 +64,7 @@ abstract class AbstractStringCheck implements ICheck {
|
|||
protected function executeStringCheck($operator, $checkValue, $actualValue) {
|
||||
if ($operator === 'is') {
|
||||
return $checkValue === $actualValue;
|
||||
} else if ($operator === '!is') {
|
||||
} elseif ($operator === '!is') {
|
||||
return $checkValue !== $actualValue;
|
||||
} else {
|
||||
$match = $this->match($checkValue, $actualValue);
|
||||
|
|
|
@ -134,7 +134,7 @@ class FileSystemTags implements ICheck, IFileCheck {
|
|||
$parentIds = [];
|
||||
if ($path !== $this->dirname($path)) {
|
||||
$parentIds = $this->getFileIds($cache, $this->dirname($path), $isExternalStorage);
|
||||
} else if (!$isExternalStorage) {
|
||||
} elseif (!$isExternalStorage) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
|
@ -53,9 +53,9 @@ class RequestRemoteAddress implements ICheck {
|
|||
|
||||
if ($operator === 'matchesIPv4') {
|
||||
return $this->matchIPv4($actualValue, $decodedValue[0], $decodedValue[1]);
|
||||
} else if ($operator === '!matchesIPv4') {
|
||||
} elseif ($operator === '!matchesIPv4') {
|
||||
return !$this->matchIPv4($actualValue, $decodedValue[0], $decodedValue[1]);
|
||||
} else if ($operator === 'matchesIPv6') {
|
||||
} elseif ($operator === 'matchesIPv6') {
|
||||
return $this->matchIPv6($actualValue, $decodedValue[0], $decodedValue[1]);
|
||||
} else {
|
||||
return !$this->matchIPv6($actualValue, $decodedValue[0], $decodedValue[1]);
|
||||
|
|
|
@ -220,7 +220,7 @@ class RuleMatcher implements IRuleMatcher {
|
|||
list($entity, $subject) = $entityInfo;
|
||||
$checkInstance->setEntitySubject($entity, $subject);
|
||||
}
|
||||
} else if(!$checkInstance instanceof ICheck) {
|
||||
} elseif(!$checkInstance instanceof ICheck) {
|
||||
// Check is invalid
|
||||
throw new \UnexpectedValueException($this->l->t('Check %s is invalid or does not exist', $check['class']));
|
||||
}
|
||||
|
|
|
@ -287,7 +287,7 @@ class ManagerTest extends TestCase {
|
|||
->willReturnCallback(function ($class) {
|
||||
if(substr($class, -2) === 'Op') {
|
||||
return $this->createMock(IOperation::class);
|
||||
} else if($class === File::class) {
|
||||
} elseif($class === File::class) {
|
||||
return $this->getMockBuilder(File::class)
|
||||
->setConstructorArgs([
|
||||
$this->l,
|
||||
|
@ -424,7 +424,7 @@ class ManagerTest extends TestCase {
|
|||
|
||||
$entityTypeCounts = array_reduce($entities, function (array $carry, IEntity $entity) {
|
||||
if($entity instanceof File) $carry[0]++;
|
||||
else if($entity instanceof IEntity) $carry[1]++;
|
||||
elseif($entity instanceof IEntity) $carry[1]++;
|
||||
return $carry;
|
||||
}, [0, 0]);
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ trait CommandLine {
|
|||
$msg .= ' Exceptions: ' . implode(', ', $exceptions);
|
||||
}
|
||||
throw new \Exception($msg);
|
||||
} else if (!empty($exceptions)) {
|
||||
} elseif (!empty($exceptions)) {
|
||||
$msg = 'The command was successful but triggered exceptions: ' . implode(', ', $exceptions);
|
||||
throw new \Exception($msg);
|
||||
}
|
||||
|
|
|
@ -616,11 +616,11 @@ trait Sharing {
|
|||
|
||||
if ($contentExpected === 'A_NUMBER') {
|
||||
Assert::assertTrue(is_numeric((string)$returnedShare->$field), "Field '$field' is not a number: " . $returnedShare->$field);
|
||||
} else if ($contentExpected === 'A_TOKEN') {
|
||||
} elseif ($contentExpected === 'A_TOKEN') {
|
||||
// A token is composed by 15 characters from
|
||||
// ISecureRandom::CHAR_HUMAN_READABLE.
|
||||
Assert::assertRegExp('/^[abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789]{15}$/', (string)$returnedShare->$field, "Field '$field' is not a token");
|
||||
} else if (strpos($contentExpected, 'REGEXP ') === 0) {
|
||||
} elseif (strpos($contentExpected, 'REGEXP ') === 0) {
|
||||
Assert::assertRegExp(substr($contentExpected, strlen('REGEXP ')), (string)$returnedShare->$field, "Field '$field' does not match");
|
||||
} else {
|
||||
Assert::assertEquals($contentExpected, (string)$returnedShare->$field, "Field '$field' does not match");
|
||||
|
|
|
@ -302,7 +302,7 @@ class TagsContext implements \Behat\Behat\Context\Context {
|
|||
|
||||
if ($can === 'can') {
|
||||
$expected = 'true';
|
||||
} else if ($can === 'cannot') {
|
||||
} elseif ($can === 'cannot') {
|
||||
$expected = 'false';
|
||||
} else {
|
||||
throw new \Exception('Invalid condition, must be "can" or "cannot"');
|
||||
|
|
|
@ -88,7 +88,7 @@ trait WebDav {
|
|||
public function makeDavRequest($user, $method, $path, $headers, $body = null, $type = "files") {
|
||||
if ($type === "files") {
|
||||
$fullUrl = substr($this->baseUrl, 0, -4) . $this->getDavFilesPath($user) . "$path";
|
||||
} else if ($type === "uploads") {
|
||||
} elseif ($type === "uploads") {
|
||||
$fullUrl = substr($this->baseUrl, 0, -4) . $this->davPath . "$path";
|
||||
}
|
||||
$client = new GClient();
|
||||
|
|
|
@ -78,7 +78,7 @@ try {
|
|||
if ($oldWorkingDir === false) {
|
||||
echo "This script can be run from the Nextcloud root directory only." . PHP_EOL;
|
||||
echo "Can't determine current working dir - the script will continue to work but be aware of the above fact." . PHP_EOL;
|
||||
} else if ($oldWorkingDir !== __DIR__ && !chdir(__DIR__)) {
|
||||
} elseif ($oldWorkingDir !== __DIR__ && !chdir(__DIR__)) {
|
||||
echo "This script can be run from the Nextcloud root directory only." . PHP_EOL;
|
||||
echo "Can't change to Nextcloud root directory." . PHP_EOL;
|
||||
exit(1);
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче