Merge pull request #3880 from owncloud/code-checker

Add classes replaced by the public api to the code checker
remotes/origin/stable6
Bart Visscher 12 years ago
commit 9bf12da750
  1. 24
      lib/installer.php
  2. 29
      lib/public/image.php
  3. 16
      lib/public/user.php
  4. 9
      lib/public/util.php

@ -436,10 +436,30 @@ class OC_Installer{
$blacklist=array(
'exec(',
'eval('
'eval(',
// more evil pattern will go here later
// will will also check if an app is using private api once the public api is in place
// classes replaced by the public api
'OC_API::',
'OC_App::',
'OC_AppConfig::',
'OC_BackgroundJob::',
'OC_Config::',
'OC_DB::',
'OC_Files::',
'OC_Helper::',
'OC_Hook::',
'OC_Image::',
'OC_JSON::',
'OC_L10N::',
'OC_Log::',
'OC_Mail::',
'OC_Preferences::',
'OC_Request::',
'OC_Response::',
'OC_Template::',
'OC_User::',
'OC_Util::',
);
// is the code checker enabled?

@ -0,0 +1,29 @@
<?php
/**
* ownCloud
*
* @author Bart Visscher
* @copyright 2013 Bart Visscher <bartv@thisnet.nl>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCP;
/**
* This class provides functions to handle images
*/
class Image extends OC_Image {
}

@ -40,7 +40,7 @@ class User {
* @return string uid or false
*/
public static function getUser() {
return \OC_USER::getUser();
return \OC_User::getUser();
}
/**
@ -50,7 +50,7 @@ class User {
* Get a list of all users.
*/
public static function getUsers($search = '', $limit = null, $offset = null) {
return \OC_USER::getUsers();
return \OC_User::getUsers($search, $limit, $offset);
}
/**
@ -58,7 +58,7 @@ class User {
* @return string display name
*/
public static function getDisplayName($user=null) {
return \OC_USER::getDisplayName($user);
return \OC_User::getDisplayName($user);
}
/**
@ -68,7 +68,7 @@ class User {
* Get a list of all display names and user ids.
*/
public static function getDisplayNames($search = '', $limit = null, $offset = null) {
return \OC_USER::getDisplayNames($search, $limit, $offset);
return \OC_User::getDisplayNames($search, $limit, $offset);
}
/**
@ -78,7 +78,7 @@ class User {
* Checks if the user is logged in
*/
public static function isLoggedIn() {
return \OC_USER::isLoggedIn();
return \OC_User::isLoggedIn();
}
/**
@ -88,14 +88,14 @@ class User {
* @return boolean
*/
public static function userExists( $uid, $excludingBackend = null ) {
return \OC_USER::userExists( $uid, $excludingBackend );
return \OC_User::userExists( $uid, $excludingBackend );
}
/**
* @brief Loggs the user out including all the session data
* Logout, destroys session
*/
public static function logout() {
\OC_USER::logout();
\OC_User::logout();
}
/**
@ -107,7 +107,7 @@ class User {
* Check if the password is correct without logging in the user
*/
public static function checkPassword( $uid, $password ) {
return \OC_USER::checkPassword( $uid, $password );
return \OC_User::checkPassword( $uid, $password );
}
/**

@ -77,6 +77,15 @@ class Util {
\OC_LOG::write( $app, $message, $level );
}
/**
* @brief get l10n object
* @param string $app
* @return OC_L10N
*/
public static function getL10N( $application ) {
\OC_L10N::get( $application );
}
/**
* @brief add a css file
* @param string $url

Loading…
Cancel
Save