Merge pull request #11604 from nextcloud/remove-unused-code

Remove unused code in legacy classes
This commit is contained in:
Roeland Jago Douma 2018-10-04 08:07:32 +02:00 committed by GitHub
commit 0630360835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 81 deletions

View File

@ -99,25 +99,6 @@ class OC_JSON{
}
}
/**
* Check if the user is a subadmin, send json error msg if not
* @deprecated Use annotation based ACLs from the AppFramework instead
* @suppress PhanDeprecatedFunction
*/
public static function checkSubAdminUser() {
$userObject = \OC::$server->getUserSession()->getUser();
$isSubAdmin = false;
if($userObject !== null) {
$isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject);
}
if(!$isSubAdmin) {
$l = \OC::$server->getL10N('lib');
self::error(array( 'data' => array( 'message' => $l->t('Authentication error'), 'error' => 'authentication_error' )));
exit();
}
}
/**
* Send json error msg
* @deprecated Use a AppFramework JSONResponse instead

View File

@ -848,14 +848,7 @@ class OC_Util {
$invalidIniSettings = [];
$moduleHint = $l->t('Please ask your server administrator to install the module.');
/**
* FIXME: The dependency check does not work properly on HHVM on the moment
* and prevents installation. Once HHVM is more compatible with our
* approach to check for these values we should re-enable those
* checks.
*/
$iniWrapper = \OC::$server->getIniWrapper();
if (!self::runningOnHhvm()) {
foreach ($dependencies['classes'] as $class => $module) {
if (!class_exists($class)) {
$missingDependencies[] = $module;
@ -888,7 +881,6 @@ class OC_Util {
}
}
}
}
foreach($missingDependencies as $missingDependency) {
$errors[] = array(
@ -1085,26 +1077,6 @@ class OC_Util {
}
}
/**
* Check if the user is a subadmin, redirects to home if not
*
* @return null|boolean $groups where the current user is subadmin
*/
public static function checkSubAdminUser() {
OC_Util::checkLoggedIn();
$userObject = \OC::$server->getUserSession()->getUser();
$isSubAdmin = false;
if($userObject !== null) {
$isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject);
}
if (!$isSubAdmin) {
header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php'));
exit();
}
return true;
}
/**
* Returns the URL of the default page
* based on the system configuration and
@ -1332,15 +1304,6 @@ class OC_Util {
return (strtoupper(substr(PHP_OS, 0, 6)) === 'DARWIN');
}
/**
* Checks whether server is running on HHVM
*
* @return bool True if running on HHVM, false otherwise
*/
public static function runningOnHhvm() {
return defined('HHVM_VERSION');
}
/**
* Handles the case that there may not be a theme, then check if a "default"
* theme exists and take that one