Code Duplication    Length = 3-4 lines in 2 locations

index.php 1 location

@@ 13-16 (lines=4) @@
10
11
// Create default calendar ...
12
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), false);
13
if( count($calendars) == 0) {
14
	OC_Calendar_Calendar::addDefaultCalendars(OCP\USER::getUser());
15
	$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
16
}
17
18
//Fix currentview for fullcalendar
19
if(OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') == "oneweekview") {

lib/calendar.php 1 location

@@ 276-278 (lines=3) @@
273
		OCP\Share::unshareAll('calendar', $id);
274
275
		OCP\Util::emitHook('OC_Calendar', 'deleteCalendar', $id);
276
		if(OCP\USER::isLoggedIn() and count(self::allCalendars(OCP\USER::getUser())) == 0) {
277
			self::addDefaultCalendars(OCP\USER::getUser());
278
		}
279
280
		return true;
281
	}