Code Duplication    Length = 7-8 lines in 2 locations

lib/private/util.php 2 locations

@@ 845-851 (lines=7) @@
842
	 *
843
	 * @return void
844
	 */
845
	public static function checkAdminUser() {
846
		OC_Util::checkLoggedIn();
847
		if (!OC_User::isAdminUser(OC_User::getUser())) {
848
			header('Location: ' . OC_Helper::linkToAbsolute('', 'index.php'));
849
			exit();
850
		}
851
	}
852
853
	/**
854
	 * Check if it is allowed to remember login.
@@ 879-886 (lines=8) @@
876
	 *
877
	 * @return null|boolean $groups where the current user is subadmin
878
	 */
879
	public static function checkSubAdminUser() {
880
		OC_Util::checkLoggedIn();
881
		if (!OC_SubAdmin::isSubAdmin(OC_User::getUser())) {
882
			header('Location: ' . OC_Helper::linkToAbsolute('', 'index.php'));
883
			exit();
884
		}
885
		return true;
886
	}
887
888
	/**
889
	 * Returns the URL of the default page