]> source.dussan.org Git - nextcloud-server.git/commitdiff
Renaming classes :-)
authorJakob Sack <kde@jakobsack.de>
Fri, 29 Jul 2011 19:36:03 +0000 (21:36 +0200)
committerJakob Sack <kde@jakobsack.de>
Fri, 29 Jul 2011 19:36:03 +0000 (21:36 +0200)
112 files changed:
3dparty/MDB2/Driver/Manager/sqlite.php
3dparty/MDB2/Driver/sqlite.php
admin/ajax/changepassword.php
admin/ajax/creategroup.php
admin/ajax/createuser.php
admin/ajax/disableapp.php
admin/ajax/enableapp.php
admin/ajax/removegroup.php
admin/ajax/removeuser.php
admin/ajax/togglegroups.php
admin/appinfo/app.php
admin/apps.php
admin/system.php
admin/templates/apps.php
admin/templates/users.php
admin/users.php
apps/files_imageviewer/appinfo/app.php
apps/files_publiclink/admin.php
apps/files_publiclink/appinfo/app.php
apps/files_publiclink/get.php
apps/files_publiclink/lib_public.php
apps/media/ajax/api.php
apps/media/ajax/autoupdate.php
apps/media/appinfo/app.php
apps/media/index.php
apps/media/lib_ampache.php
apps/media/lib_collection.php
apps/media/lib_media.php
apps/media/lib_scanner.php
apps/media/settings.php
apps/media/tomahawk.php
apps/user_ldap/appinfo/app.php
apps/user_ldap/settings.php
apps/user_ldap/user_ldap.php
apps/user_openid/appinfo/app.php
apps/user_openid/phpmyid.php
apps/user_openid/settings.php
apps/user_openid/user.php
apps/user_openid/user_openid.php
core/templates/404.php
core/templates/installation.php
docs/skeleton/admin.php
docs/skeleton/appinfo/app.sample.php
docs/skeleton/index.php
files/admin.php
files/ajax/autocomplete.php
files/ajax/delete.php
files/ajax/download.php
files/ajax/list.php
files/ajax/move.php
files/ajax/newfolder.php
files/ajax/rename.php
files/ajax/upload.php
files/appinfo/app.php
files/download.php
files/index.php
files/settings.php
files/templates/admin.php
help/appinfo/app.php
help/index.php
help/templates/index.php
index.php
lib/MDB2/Driver/Manager/sqlite3.php
lib/MDB2/Driver/sqlite3.php
lib/app.php
lib/appconfig.php
lib/base.php
lib/config.php
lib/connect.php
lib/connector/sabre/auth.php
lib/connector/sabre/directory.php
lib/connector/sabre/file.php
lib/connector/sabre/locks.php
lib/connector/sabre/node.php
lib/db.php
lib/files.php
lib/filestorage.php
lib/filestorage/local.php
lib/filestorage/remote.php
lib/filesystem.php
lib/group.php
lib/group/backend.php
lib/group/database.php
lib/helper.php
lib/hook.php
lib/installer.php
lib/l10n.php
lib/log.php
lib/ocs.php
lib/ocsclient.php
lib/preferences.php
lib/remote/cloud.php
lib/search.php
lib/search/provider.php
lib/search/provider/file.php
lib/setup.php
lib/template.php
lib/user.php
lib/user/backend.php
lib/user/database.php
lib/user/example.php
lib/util.php
log/appinfo/app.php
log/index.php
search/appinfo/app.php
search/index.php
settings/ajax/changepassword.php
settings/ajax/setlanguage.php
settings/appinfo/app.php
settings/index.php
tests/index.php
tests/lib/filesystem.php

index 5258cff891d1131c1d11a71b271cc488347a360f..64019669645a8dd31a3b07681eb0405e9c4fd83b 100644 (file)
@@ -72,7 +72,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common
     function createDatabase($name, $options = array())
     {
                global $SERVERROOT;
-               $datadir=OC_CONFIG::getValue( "datadirectory", "$SERVERROOT/data" );
+               $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
         $db =$this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
index 48f233167c702aee3025d0600e6c2d7d2e98057a..63db241b86386f83742ee19e4dd83d3ec4552d8f 100644 (file)
@@ -348,7 +348,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common
     function connect()
     {
                global $SERVERROOT;
-               $datadir=OC_CONFIG::getValue( "datadirectory", "$SERVERROOT/data" );
+               $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
         $database_file = $this->_getDatabaseFile($this->database_name);
         if (is_resource($this->connection)) {
             //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0
index 51634908a7632ce881609445708d2f73a6b2aa0f..98c2a8b37a135a30655b92cb244b4b94ca7c52d2 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -16,7 +16,7 @@ $username = $_POST["username"];
 $password = $_POST["password"];
 
 // Return Success story
-if( OC_USER::setPassword( $username, $password )){
+if( OC_User::setPassword( $username, $password )){
        echo json_encode( array( "status" => "success", "data" => array( "username" => $username )));
 }
 else{
index df9a36aaa2fa2f352566476b439f8ea0a629bb6a..2631937b14dbec9c86c6876435d6f08eee581bc8 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -15,13 +15,13 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' ))
 $groupname = $_POST["groupname"];
 
 // Does the group exist?
-if( in_array( $groupname, OC_GROUP::getGroups())){
+if( in_array( $groupname, OC_Group::getGroups())){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Group already exists" )));
        exit();
 }
 
 // Return Success story
-if( OC_GROUP::createGroup( $groupname )){
+if( OC_Group::createGroup( $groupname )){
        echo json_encode( array( "status" => "success", "data" => array( "groupname" => $groupname )));
 }
 else{
index 507ded9079f07c4ff2c0288a8cc4ff27cf609a9f..1bb655ed336a08ad905716f420d5da7d0eb58981 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -20,17 +20,17 @@ $username = $_POST["username"];
 $password = $_POST["password"];
 
 // Does the group exist?
-if( in_array( $username, OC_USER::getUsers())){
+if( in_array( $username, OC_User::getUsers())){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "User already exists" )));
        exit();
 }
 
 // Return Success story
-if( OC_USER::createUser( $username, $password )){
+if( OC_User::createUser( $username, $password )){
        foreach( $groups as $i ){
-               OC_GROUP::addToGroup( $username, $i );
+               OC_Group::addToGroup( $username, $i );
        }
-       echo json_encode( array( "status" => "success", "data" => array( "username" => $username, "groups" => implode( ", ", OC_GROUP::getUserGroups( $username )))));
+       echo json_encode( array( "status" => "success", "data" => array( "username" => $username, "groups" => implode( ", ", OC_Group::getUserGroups( $username )))));
 }
 else{
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Unable to add user" )));
index d23f8de7ef0f6c78b7ef862c159abc4977b47b3d..dce62fa11d46feb17b813b9a6fe3231e2a19763b 100644 (file)
@@ -4,6 +4,6 @@
 require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
-OC_APP::disable($_POST['appid']);
+OC_App::disable($_POST['appid']);
 
 ?>
index d988d7fd2dfd9605235705c52dffb131da3aa42b..eb1bfc54a0449c9f40e17ac7f18d32afb91d2a1e 100644 (file)
@@ -4,6 +4,6 @@
 require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
-OC_APP::enable($_POST['appid']);
+OC_App::enable($_POST['appid']);
 
 ?>
index e3d62e5fac8b0f552f33b214374cf02bcdf8c8ed..bf80da741c702d4a3a4f0e69dc91aa564561e356 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -15,7 +15,7 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' ))
 $name = $_POST["groupname"];
 
 // Return Success story
-if( OC_GROUP::deleteGroup( $name )){
+if( OC_Group::deleteGroup( $name )){
        echo json_encode( array( "status" => "success", "data" => array( "groupname" => $name )));
 }
 else{
index 6b48146ad453d07ce3272af8e2f07a45667b90a3..0a94884cb96f4b192c59c64fd94cea128dd4cf82 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -15,7 +15,7 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' ))
 $username = $_POST["username"];
 
 // Return Success story
-if( OC_USER::deleteUser( $username )){
+if( OC_User::deleteUser( $username )){
        echo json_encode( array( "status" => "success", "data" => array( "username" => $username )));
 }
 else{
index 5c7bd393e923c3d3b9bff7385e83037433d6d120..808e57dc9d63b759d709a8ed0cfc50eeca7eaac0 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -20,13 +20,13 @@ $username = $_POST["username"];
 $group = $_POST["group"];
 
 // Toggle group
-if( OC_GROUP::inGroup( $username, $group )){
+if( OC_Group::inGroup( $username, $group )){
        $action = "remove";
        $error = "remove user from";
-       $success = OC_GROUP::removeFromGroup( $username, $group );
+       $success = OC_Group::removeFromGroup( $username, $group );
 }
 else{
-       $success = OC_GROUP::addToGroup( $username, $group );
+       $success = OC_Group::addToGroup( $username, $group );
 }
 
 // Return Success story
index 7ce784cfb98ab26517731aeca8b615c67961cd65..dfb9aee8159976b0c556cae150fb38ce98fb43eb 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 
-OC_APP::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
+OC_App::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
 
-// OC_APP::addAdminPage( array( "id" => "core_system", "order" => 1, "href" => OC_HELPER::linkTo( "admin", "system.php" ), "name" =>"System", "icon" => OC_HELPER::imagePath( "admin", "administration.png" )));
-OC_APP::addAdminPage( array( "id" => "core_users", "order" => 2, "href" => OC_HELPER::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_HELPER::imagePath( "admin", "users.png" )));
-OC_APP::addAdminPage( array( "id" => "core_apps", "order" => 3, "href" => OC_HELPER::linkTo( "admin", "apps.php?installed" ), "name" => "Apps", "icon" => OC_HELPER::imagePath( "admin", "apps.png" )));
+// OC_App::addAdminPage( array( "id" => "core_system", "order" => 1, "href" => OC_Helper::linkTo( "admin", "system.php" ), "name" =>"System", "icon" => OC_Helper::imagePath( "admin", "administration.png" )));
+OC_App::addAdminPage( array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "admin", "users.php" ), "name" => "Users", "icon" => OC_Helper::imagePath( "admin", "users.png" )));
+OC_App::addAdminPage( array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "admin", "apps.php?installed" ), "name" => "Apps", "icon" => OC_Helper::imagePath( "admin", "apps.png" )));
 
 // Add subentries for App installer
-OC_APP::addNavigationSubEntry( "core_apps", array( "id" => "core_apps_get", "order" => 4, "href" => OC_HELPER::linkTo( "admin", "apps.php" ), "name" => "Get new apps", "icon" => OC_HELPER::imagePath( "admin", "navicon.png" )));
+OC_App::addNavigationSubEntry( "core_apps", array( "id" => "core_apps_get", "order" => 4, "href" => OC_Helper::linkTo( "admin", "apps.php" ), "name" => "Get new apps", "icon" => OC_Helper::imagePath( "admin", "navicon.png" )));
 
 ?>
index 4bbf1c813b00a71d3c00bf3a1ab09b8131607256..4f39feab0c580bc0ce95d7382356e3c59fc62f9b 100644 (file)
 */
 
 require_once('../lib/base.php');
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
-       header( "Location: ".OC_HELPER::linkTo( "", "index.php" ));
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
+       header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
        exit();
 }
 
 // Load the files we need
-OC_UTIL::addStyle( "admin", "apps" );
-OC_UTIL::addScript( "admin", "apps" );
+OC_Util::addStyle( "admin", "apps" );
+OC_Util::addScript( "admin", "apps" );
 
 
 if(isset($_GET['id']))  $id=$_GET['id']; else $id=0;
@@ -38,32 +38,32 @@ if(isset($_GET['installed'])) $installed=true; else $installed=false;
 
 if($installed){
        global $SERVERROOT;
-       OC_INSTALLER::installShippedApps(false);
-       $apps = OC_APPCONFIG::getApps();
+       OC_Installer::installShippedApps(false);
+       $apps = OC_Appconfig::getApps();
        $records = array();
 
-       OC_APP::setActiveNavigationEntry( "core_apps" );
+       OC_App::setActiveNavigationEntry( "core_apps" );
        foreach($apps as $app){
-               $info=OC_APP::getAppInfo("$SERVERROOT/apps/$app/appinfo/info.xml");
+               $info=OC_App::getAppInfo("$SERVERROOT/apps/$app/appinfo/info.xml");
                $record = array( 'id' => $app,
                                 'name' => $info['name'],
                                 'version' => $info['version'],
                                 'author' => $info['author'],
-                                'enabled' => OC_APP::isEnabled( $app ));
+                                'enabled' => OC_App::isEnabled( $app ));
                $records[]=$record;
        }
 
-       $tmpl = new OC_TEMPLATE( "admin", "appsinst", "admin" );
+       $tmpl = new OC_Template( "admin", "appsinst", "admin" );
        $tmpl->assign( "apps", $records );
        $tmpl->printPage();
        unset($tmpl);
        exit();
 }else{
-       $categories=OC_OCSCLIENT::getCategories();
+       $categories=OC_OCSClient::getCategories();
        if($categories==NULL){
-               OC_APP::setActiveNavigationEntry( "core_apps" );
+               OC_App::setActiveNavigationEntry( "core_apps" );
 
-               $tmpl = new OC_TEMPLATE( "admin", "app_noconn", "admin" );
+               $tmpl = new OC_Template( "admin", "app_noconn", "admin" );
                $tmpl->printPage();
                unset($tmpl);
                exit();
@@ -71,18 +71,18 @@ if($installed){
 
 
        if($id==0) {
-               OC_APP::setActiveNavigationEntry( "core_apps_get" );
+               OC_App::setActiveNavigationEntry( "core_apps_get" );
 
                if($cat==0){
                        $numcats=array();
                        foreach($categories as $key=>$value) $numcats[]=$key;
-                       $apps=OC_OCSCLIENT::getApplications($numcats);
+                       $apps=OC_OCSClient::getApplications($numcats);
                }else{
-                       $apps=OC_OCSCLIENT::getApplications($cat);
+                       $apps=OC_OCSClient::getApplications($cat);
                }
 
                // return template
-               $tmpl = new OC_TEMPLATE( "admin", "apps", "admin" );
+               $tmpl = new OC_Template( "admin", "apps", "admin" );
 
                $tmpl->assign( "categories", $categories );
                $tmpl->assign( "apps", $apps );
@@ -90,11 +90,11 @@ if($installed){
                unset($tmpl);
 
        }else{
-               OC_APP::setActiveNavigationEntry( "core_apps" );
+               OC_App::setActiveNavigationEntry( "core_apps" );
 
-               $app=OC_OCSCLIENT::getApplication($id);
+               $app=OC_OCSClient::getApplication($id);
 
-               $tmpl = new OC_TEMPLATE( "admin", "app", "admin" );
+               $tmpl = new OC_Template( "admin", "app", "admin" );
                $tmpl->assign( "categories", $categories );
                $tmpl->assign( "app", $app );
                $tmpl->printPage();
index 9286ab9c2b32822d86a2002d358e677bde07d5bc..11a76132b4c209fadfb663144a6cb8546c7789f6 100644 (file)
 */
 
 require_once('../lib/base.php');
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
-OC_APP::setActiveNavigationEntry( "administration" );
+OC_App::setActiveNavigationEntry( "administration" );
 
-$tmpl = new OC_TEMPLATE( "admin", "system", "admin" );
+$tmpl = new OC_Template( "admin", "system", "admin" );
 $tmpl->printPage();
 
 ?>
index 593aad63182e3d39ae5faa4f6aac22a77cface54..50dd497c333f64a01ab11da86214e3926d06ff57 100644 (file)
@@ -17,8 +17,8 @@
        <tbody>
                <?php foreach($_["apps"] as $app): ?>
                        <tr>
-                               <td width="1"><?php if($app["preview"] <> "") { echo('<a href="'.OC_HELPER::linkTo( "admin", "apps.php" ).'?id='.$app['id'].'"><img class="preview" border="0" src="'.$app["preview"].'" /></a>'); } ?> </a></td>
-                               <td class="name"><a href="<?php echo(OC_HELPER::linkTo( "admin", "apps.php" ).'?id='.$app['id']); ?>" title=""><?php echo $app["name"]; ?></a><br /><?php  echo('<span class="type">'.$app['typename'].'</span>'); ?></td>
+                               <td width="1"><?php if($app["preview"] <> "") { echo('<a href="'.OC_Helper::linkTo( "admin", "apps.php" ).'?id='.$app['id'].'"><img class="preview" border="0" src="'.$app["preview"].'" /></a>'); } ?> </a></td>
+                               <td class="name"><a href="<?php echo(OC_Helper::linkTo( "admin", "apps.php" ).'?id='.$app['id']); ?>" title=""><?php echo $app["name"]; ?></a><br /><?php  echo('<span class="type">'.$app['typename'].'</span>'); ?></td>
                                <td class="date"><?php echo $l->l('datetime', $app["changed"]); ?></td>
                        </tr>
                <?php endforeach; ?>
index 147db7c7aa4190926c65103a3b0de549e206aeda..6fc3e64301069dc295fa4fe69dfb0f755337647a 100644 (file)
@@ -33,7 +33,7 @@
                                        <td x-use="username"><span x-use="usernamediv"><?php echo $user["name"]; ?></span></td>
                                        <td x-use="usergroups"><div x-use="usergroupsdiv"><?php if( $user["groups"] ){ echo $user["groups"]; }else{echo "&nbsp";} ?></div></td>
                                        <td>
-                                               <?php if($user['name']!=OC_USER::getUser()):?>
+                                               <?php if($user['name']!=OC_User::getUser()):?>
                                                        <a  class="removeuserbutton" href=""><?php echo $l->t( 'remove' ); ?></a>
                                                <?php endif;?>
                                        </td>
index 4065cc471f1e4b375b25f95a511bcd251a0774e6..fd0b6fec01b120344c675e1ce5b33f56fe3b44d6 100644 (file)
 */
 
 require_once('../lib/base.php');
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
 // We have some javascript foo!
-OC_UTIL::addScript( "admin", "users" );
-OC_UTIL::addStyle( "admin", "users" );
-OC_APP::setActiveNavigationEntry( "core_users" );
+OC_Util::addScript( "admin", "users" );
+OC_Util::addStyle( "admin", "users" );
+OC_App::setActiveNavigationEntry( "core_users" );
 
 $users = array();
 $groups = array();
 
-foreach( OC_USER::getUsers() as $i ){
+foreach( OC_User::getUsers() as $i ){
        // Do some more work here soon
        $ingroups = array();
-       foreach( OC_GROUP::getUserGroups( $i ) as $userGroup ){
+       foreach( OC_Group::getUserGroups( $i ) as $userGroup ){
                $ingroups[] = $userGroup;
        }
        $users[] = array( "name" => $i, "groups" => join( ", ", $ingroups ));
 }
 
-foreach( OC_GROUP::getGroups() as $i ){
+foreach( OC_Group::getGroups() as $i ){
        // Do some more work here soon
        $groups[] = array( "name" => $i );
 }
 
-$tmpl = new OC_TEMPLATE( "admin", "users", "admin" );
+$tmpl = new OC_Template( "admin", "users", "admin" );
 $tmpl->assign( "users", $users );
 $tmpl->assign( "groups", $groups );
 $tmpl->printPage();
index 50a7253e01b6ee243f2117b889c38e140180de57..6d32e2d628e482998231f5cc73ae68cef505a5cb 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
-if(OC_APP::getCurrentApp()=='files'){
-       OC_UTIL::addScript( 'files_imageviewer', 'lightbox' );
-       OC_UTIL::addStyle( 'files_imageviewer', 'lightbox' );
+if(OC_App::getCurrentApp()=='files'){
+       OC_Util::addScript( 'files_imageviewer', 'lightbox' );
+       OC_Util::addStyle( 'files_imageviewer', 'lightbox' );
 }
 
 ?>
index 9a1a9ce03c286c56c3582ce5db8ee4d33109a8c4..8187039c3a622bb6c9a0d8c9d547fdd20c0b491a 100644 (file)
@@ -28,25 +28,25 @@ require_once( 'lib_public.php' );
 
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
-OC_APP::setActiveNavigationEntry( "files_publiclink_administration" );
+OC_App::setActiveNavigationEntry( "files_publiclink_administration" );
 
-OC_UTIL::addStyle( 'files_publiclink', 'admin' );
-OC_UTIL::addScript( 'files_publiclink', 'admin' );
+OC_Util::addStyle( 'files_publiclink', 'admin' );
+OC_Util::addScript( 'files_publiclink', 'admin' );
 
 if(isset($_SERVER['HTTPS'])) {
-       $baseUrl= "https://". $_SERVER['SERVER_NAME'] . OC_HELPER::linkTo('files_publiclink','get.php');
+       $baseUrl= "https://". $_SERVER['SERVER_NAME'] . OC_Helper::linkTo('files_publiclink','get.php');
 }else{
-       $baseUrl= "http://". $_SERVER['SERVER_NAME'] . OC_HELPER::linkTo('files_publiclink','get.php');
+       $baseUrl= "http://". $_SERVER['SERVER_NAME'] . OC_Helper::linkTo('files_publiclink','get.php');
 }
 
 
 // return template
-$tmpl = new OC_TEMPLATE( "files_publiclink", "admin", "admin" );
+$tmpl = new OC_Template( "files_publiclink", "admin", "admin" );
 $tmpl->assign( 'links', OC_PublicLink::getLinks());
 $tmpl->assign('baseUrl',$baseUrl);
 $tmpl->printPage();
index 894327e83d39501e7e6b4971eff529a43e7faed4..314a3bf896aa4bdb82218a785b891fcd1cd60019 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-OC_APP::addSettingsPage( array( "id" => "files_publiclink_administration", "order" => 1, "href" => OC_HELPER::linkTo( "files_publiclink", "admin.php" ), "name" => "Public Links", "icon" => OC_HELPER::imagePath( "files_publiclink", "share.png" )));
+OC_App::addSettingsPage( array( "id" => "files_publiclink_administration", "order" => 1, "href" => OC_Helper::linkTo( "files_publiclink", "admin.php" ), "name" => "Public Links", "icon" => OC_Helper::imagePath( "files_publiclink", "share.png" )));
 
 
 ?>
index 3bc961bc37d1e23b9419cf9e2c144d8d98a19cc2..6bcefc2e4e8ccc46e53d9b932ceb75889a7771c6 100644 (file)
@@ -18,18 +18,18 @@ if($path!==false){
                $subPath='';
        }
        $path.=$subPath;
-       if(!OC_FILESYSTEM::file_exists($path)){
+       if(!OC_Filesystem::file_exists($path)){
                header("HTTP/1.0 404 Not Found");
-               $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+               $tmpl = new OC_Template( '', '404', 'guest' );
                $tmpl->assign('file',$subPath);
                $tmpl->printPage();
                exit;
        }
-       if(OC_FILESYSTEM::is_dir($path)){
+       if(OC_Filesystem::is_dir($path)){
                $files = array();
                $rootLength=strlen($root);
-               foreach( OC_FILES::getdirectorycontent( $path ) as $i ){
-                       $i['date'] = OC_UTIL::formatDate($i['mtime'] );
+               foreach( OC_Files::getdirectorycontent( $path ) as $i ){
+                       $i['date'] = OC_Util::formatDate($i['mtime'] );
                        $i['directory']=substr($i['directory'],$rootLength);
                        if($i['directory']=='/'){
                                $i['directory']='';
@@ -47,36 +47,36 @@ if($path!==false){
                        }
                }
                
-               $breadcrumbNav = new OC_TEMPLATE( "files_publiclink", "breadcrumb", "" );
+               $breadcrumbNav = new OC_Template( "files_publiclink", "breadcrumb", "" );
                $breadcrumbNav->assign( "breadcrumb", $breadcrumb );
                $breadcrumbNav->assign('token',$token);
                
-               $list = new OC_TEMPLATE( 'files_publiclink', 'files', '' );
+               $list = new OC_Template( 'files_publiclink', 'files', '' );
                $list->assign( 'files', $files );
                $list->assign('token',$token);
                
-               $tmpl = new OC_TEMPLATE( 'files_publiclink', 'index', 'user' );
+               $tmpl = new OC_Template( 'files_publiclink', 'index', 'user' );
                $tmpl->assign('fileList', $list->fetchPage());
                $tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() );
                $tmpl->printPage();
        }else{
                //get time mimetype and set the headers
-               $mimetype=OC_FILESYSTEM::getMimeType($path);
+               $mimetype=OC_Filesystem::getMimeType($path);
                header('Content-Transfer-Encoding: binary');
                header('Content-Disposition: attachment; filename="'.basename($path).'"');
                header('Expires: 0');
                header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                header('Pragma: public');
                header('Content-Type: ' . $mimetype);
-               header('Content-Length: ' . OC_FILESYSTEM::filesize($path));
+               header('Content-Length: ' . OC_Filesystem::filesize($path));
                
                //download the file
                @ob_clean();
-               OC_FILESYSTEM::readfile($path);
+               OC_Filesystem::readfile($path);
        }
 }else{
        header("HTTP/1.0 404 Not Found");
-       $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+       $tmpl = new OC_Template( '', '404', 'guest' );
        $tmpl->printPage();
        die();
 }
index b4bc86505ae1c1294d3706196f6764aac41261a3..ff1df130834a232be060acf23c442ea6e46a2bb8 100644 (file)
@@ -6,8 +6,8 @@ class OC_PublicLink{
         * @param int (optional) expiretime time the link expires, as timestamp
         */
        public function __construct($path,$expiretime=0){
-               if($path and  OC_FILESYSTEM::file_exists($path) and OC_FILESYSTEM::is_readable($path)){
-                       $user=OC_USER::getUser();
+               if($path and  OC_Filesystem::file_exists($path) and OC_Filesystem::is_readable($path)){
+                       $user=OC_User::getUser();
                        $token=sha1("$user-$path-$expiretime");
                        $query=OC_DB::prepare("INSERT INTO *PREFIX*publiclink VALUES(?,?,?,?)");
                        $result=$query->execute(array($token,$path,$user,$expiretime));
@@ -38,7 +38,7 @@ class OC_PublicLink{
                        $user=$data[0]['user'];
                        
                        //prepare the filesystem
-                       OC_UTIL::setupFS($user);
+                       OC_Util::setupFS($user);
                        
                        return $path;
                }else{
@@ -60,7 +60,7 @@ class OC_PublicLink{
         */
        static public function getLinks(){
                $query=OC_DB::prepare("SELECT * FROM *PREFIX*publiclink WHERE user=?");
-               return $query->execute(array(OC_USER::getUser()))->fetchAll();
+               return $query->execute(array(OC_User::getUser()))->fetchAll();
        }
 
        /**
@@ -69,7 +69,7 @@ class OC_PublicLink{
        static public function delete($token){
                $query=OC_DB::prepare("SELECT user,path FROM *PREFIX*publiclink WHERE token=?");
                $result=$query->execute(array($token))->fetchAll();
-               if(count($result)>0 and $result[0]['user']==OC_USER::getUser()){
+               if(count($result)>0 and $result[0]['user']==OC_User::getUser()){
                        $query=OC_DB::prepare("DELETE FROM *PREFIX*publiclink WHERE token=?");
                        $query->execute(array($token));
                }
index 84d5dd17882139cb526dd50f025313cee89dc0b6..225bce7b092ebca36341d9d7f4a32faec50572cf 100644 (file)
@@ -52,16 +52,16 @@ if(!isset($arguments['album'])){
 if(!isset($arguments['search'])){
        $arguments['search']='';
 }
-OC_MEDIA_COLLECTION::$uid=OC_USER::getUser();
+OC_MEDIA_COLLECTION::$uid=OC_User::getUser();
 if($arguments['action']){
        switch($arguments['action']){
                case 'delete':
                        $path=$arguments['path'];
                        OC_MEDIA_COLLECTION::deleteSongByPath($path);
-                       $paths=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue(OC_USER::getUser(),'media','paths',''));
+                       $paths=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths',''));
                        if(array_search($path,$paths)!==false){
                                unset($paths[array_search($path,$paths)]);
-                               OC_PREFERENCES::setValue(OC_USER::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
+                               OC_Preferences::setValue(OC_User::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
                        }
                case 'get_collection':
                        $artists=OC_MEDIA_COLLECTION::getArtists();
@@ -78,11 +78,11 @@ if($arguments['action']){
                case 'scan':
                        set_time_limit(0); //recursive scan can take a while
                        $path=$arguments['path'];
-                       if(OC_FILESYSTEM::is_dir($path)){
-                               $paths=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue(OC_USER::getUser(),'media','paths',''));
+                       if(OC_Filesystem::is_dir($path)){
+                               $paths=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths',''));
                                if(array_search($path,$paths)===false){
                                        $paths[]=$path;
-                                       OC_PREFERENCES::setValue(OC_USER::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
+                                       OC_Preferences::setValue(OC_User::getUser(),'media','paths',implode(PATH_SEPARATOR,$paths));
                                }
                        }
                        echo OC_MEDIA_SCANNER::scanFolder($path);
@@ -103,7 +103,7 @@ if($arguments['action']){
                case 'play':
                        ob_end_clean();
                        
-                       $ftype=OC_FILESYSTEM::getMimeType( $arguments['path'] );
+                       $ftype=OC_Filesystem::getMimeType( $arguments['path'] );
                        
                        $songId=OC_MEDIA_COLLECTION::getSongByPath($arguments['path']);
                        OC_MEDIA_COLLECTION::registerPlay($songId);
@@ -112,9 +112,9 @@ if($arguments['action']){
                        header('Expires: 0');
                        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                        header('Pragma: public');
-                       header('Content-Length: '.OC_FILESYSTEM::filesize($arguments['path']));
+                       header('Content-Length: '.OC_Filesystem::filesize($arguments['path']));
                        
-                       OC_FILESYSTEM::readfile($arguments['path']);
+                       OC_Filesystem::readfile($arguments['path']);
                        exit;
        }
 }
index 97733398225545764a50968fdb4c212f4a5dd4ac..ded1fd02bc39a7abd1d6c3b8c1720ef13cd0ef8d 100644 (file)
@@ -33,7 +33,7 @@ error_log($_GET['autoupdate']);
 $autoUpdate=(isset($_GET['autoupdate']) and $_GET['autoupdate']=='true');
 error_log((integer)$autoUpdate);
 
-OC_PREFERENCES::setValue(OC_USER::getUser(),'media','autoupdate',(integer)$autoUpdate);
+OC_Preferences::setValue(OC_User::getUser(),'media','autoupdate',(integer)$autoUpdate);
 
 echo json_encode( array( "status" => "success", "data" => $autoUpdate));
 ?>
\ No newline at end of file
index a41e228be4a715f4bab62aefc6798cc506c09114..d75bac031e9040ad60d88907aadf1974edc47482 100644 (file)
 
 require_once('apps/media/lib_media.php');
 
-if(OC_APP::getCurrentApp()=='files'){
-       OC_UTIL::addScript('media','files');
+if(OC_App::getCurrentApp()=='files'){
+       OC_Util::addScript('media','files');
 }
 
-OC_APP::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
+OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' ));
 
-OC_APP::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_HELPER::linkTo( 'media', 'index.php' ), 'icon' => OC_HELPER::imagePath( 'media', 'media.png' ), 'name' => 'Media' ));
-OC_APP::addSettingsPage( array( 'id' => 'media_settings', 'order' => 5, 'href' => OC_HELPER::linkTo( 'media', 'settings.php' ), 'name' => 'Media', 'icon' => OC_HELPER::imagePath( 'media', 'media.png' )));
+OC_App::addNavigationEntry( array( 'id' => 'media_index', 'order' => 2, 'href' => OC_Helper::linkTo( 'media', 'index.php' ), 'icon' => OC_Helper::imagePath( 'media', 'media.png' ), 'name' => 'Media' ));
+OC_App::addSettingsPage( array( 'id' => 'media_settings', 'order' => 5, 'href' => OC_Helper::linkTo( 'media', 'settings.php' ), 'name' => 'Media', 'icon' => OC_Helper::imagePath( 'media', 'media.png' )));
 ?>
index fbf1c395d991db35b6e75c0925c5b9b280af607a..152c45834124ac6c9ea8efdd64ab2b40d03d0910 100644 (file)
 require_once('../../lib/base.php');
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
-       header( "Location: ".OC_HELPER::linkTo( '', 'index.php' ));
+if( !OC_User::isLoggedIn()){
+       header( "Location: ".OC_Helper::linkTo( '', 'index.php' ));
        exit();
 }
 
 require_once('lib_collection.php');
 require_once('lib_scanner.php');
 
-OC_UTIL::addScript('media','player');
-OC_UTIL::addScript('media','music');
-OC_UTIL::addScript('media','jquery.jplayer.min');
-OC_UTIL::addStyle('media','player');
-OC_UTIL::addStyle('media','music');
+OC_Util::addScript('media','player');
+OC_Util::addScript('media','music');
+OC_Util::addScript('media','jquery.jplayer.min');
+OC_Util::addStyle('media','player');
+OC_Util::addStyle('media','music');
 
-OC_APP::setActiveNavigationEntry( 'media_index' );
+OC_App::setActiveNavigationEntry( 'media_index' );
 
-$tmpl = new OC_TEMPLATE( 'media', 'music', 'user' );
+$tmpl = new OC_Template( 'media', 'music', 'user' );
 
-$player = new OC_TEMPLATE( 'media', 'player');
+$player = new OC_Template( 'media', 'player');
 $tmpl->assign('player',$player->fetchPage());
 $tmpl->printPage();
 ?>
index 3cd9bd4ab26e5ed86a347d214ba83a81361bb459..97dc004e21893a9ba04de1b70755f1931970551a 100644 (file)
@@ -319,11 +319,11 @@ class OC_MEDIA_AMPACHE{
                        return;
                }
                if($song=OC_MEDIA_COLLECTION::getSong($params['song'])){
-                       OC_UTIL::setupFS($song["song_user"]);
+                       OC_Util::setupFS($song["song_user"]);
 
-                       header('Content-type: '.OC_FILESYSTEM::getMimeType($song['song_path']));
+                       header('Content-type: '.OC_Filesystem::getMimeType($song['song_path']));
                        header('Content-Length: '.$song['song_size']);
-                       OC_FILESYSTEM::readfile($song['song_path']);
+                       OC_Filesystem::readfile($song['song_path']);
                }
        }
        
index 278e450b7787afb61d0ad609881812167e5d9f6d..d9f567aa68210f9f60a08aff6153ccaef2fb2d4e 100644 (file)
@@ -125,7 +125,7 @@ class OC_MEDIA_COLLECTION{
                }
                $query=OC_DB::prepare("SELECT DISTINCT *PREFIX*media_artists.artist_name AS name , *PREFIX*media_artists.artist_id AS id FROM *PREFIX*media_artists
                        INNER JOIN *PREFIX*media_songs ON *PREFIX*media_artists.artist_id=*PREFIX*media_songs.song_artist WHERE artist_name LIKE ? AND *PREFIX*media_songs.song_user=?");
-               $artists=$query->execute(array($search,OC_USER::getUser()))->fetchAll();
+               $artists=$query->execute(array($search,OC_User::getUser()))->fetchAll();
                $result=array();
                foreach($artists as $artist){
                        $result[$artist['id']]=array('artist_name'=>$artist['name'],'artist_id'=>$artist['id']);
index 6fde2ab748745116e370bfe956e4ca7b0635a6e9..67d111936f1481881aca99aea148b9b0a5291f52 100644 (file)
 */
 
 //we need to have the sha256 hash of passwords for ampache
-OC_HOOK::connect('OC_USER','post_login','OC_MEDIA','loginListener');
+OC_Hook::connect('OC_User','post_login','OC_MEDIA','loginListener');
 
 //connect to the filesystem for auto updating if configured
-if(OC_PREFERENCES::getValue(OC_USER::getUser(),'media','autoupdate',false)){
-       OC_HOOK::connect('OC_FILESYSTEM','post_write','OC_MEDIA','updateFile');
+if(OC_Preferences::getValue(OC_User::getUser(),'media','autoupdate',false)){
+       OC_Hook::connect('OC_Filesystem','post_write','OC_MEDIA','updateFile');
 }
 
 //listen for file deletions to clean the database if a song is deleted
-OC_HOOK::connect('OC_FILESYSTEM','delete','OC_MEDIA','deleteFile');
+OC_Hook::connect('OC_Filesystem','delete','OC_MEDIA','deleteFile');
 
 class OC_MEDIA{
        /**
         * get the sha256 hash of the password needed for ampache
-        * @param array $params, parameters passed from OC_HOOK
+        * @param array $params, parameters passed from OC_Hook
         */
        public static function loginListener($params){
                if(isset($_POST['user']) and $_POST['password']){
@@ -56,7 +56,7 @@ class OC_MEDIA{
         */
        public static function updateFile($params){
                $path=$params['path'];
-               $folderNames=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue(OC_USER::getUser(),'media','paths',''));
+               $folderNames=explode(PATH_SEPARATOR,OC_Preferences::getValue(OC_User::getUser(),'media','paths',''));
                foreach($folderNames as $folder){
                        if(substr($path,0,strlen($folder))==$folder){
                                require_once 'lib_scanner.php';
@@ -90,18 +90,18 @@ class OC_MediaSearchProvider extends OC_Search_Provider{
                $songs=OC_MEDIA_COLLECTION::getSongs(0,0,$query);
                $results=array();
                foreach($artists as $artist){
-                       $results[]=new OC_Search_Result($artist['artist_name'],'',OC_HELPER::linkTo( 'apps/media', 'index.php#artist='.urlencode($artist['artist_name']) ),'Music');
+                       $results[]=new OC_Search_Result($artist['artist_name'],'',OC_Helper::linkTo( 'apps/media', 'index.php#artist='.urlencode($artist['artist_name']) ),'Music');
                }
                foreach($albums as $album){
                        $artist=urlencode(OC_MEDIA_COLLECTION::getArtistName($album['album_artist']));
-                       $results[]=new OC_Search_Result($album['album_name'],'',OC_HELPER::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.urlencode($album['album_name']) ),'Music');
+                       $results[]=new OC_Search_Result($album['album_name'],'',OC_Helper::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.urlencode($album['album_name']) ),'Music');
                }
                foreach($songs as $song){
                        $minutes=floor($song['song_length']/60);
                        $secconds=$song['song_length']%60;
                        $artist=urlencode(OC_MEDIA_COLLECTION::getArtistName($song['song_artist']));
                        $album=urlencode(OC_MEDIA_COLLECTION::getalbumName($song['song_album']));
-                       $results[]=new OC_Search_Result($song['song_name'],"$minutes:$secconds",OC_HELPER::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.$album.'&song='.urlencode($song['song_name']) ),'Music');
+                       $results[]=new OC_Search_Result($song['song_name'],"$minutes:$secconds",OC_Helper::linkTo( 'apps/media', 'index.php#artist='.$artist.'&album='.$album.'&song='.urlencode($song['song_name']) ),'Music');
                }
                return $results;
        }
index 6ad04e7a1bec81141400aab55332b95ef549e053..e3cb2f051cea3e63a5afccaa4aa4a042d1699e3a 100644 (file)
@@ -37,15 +37,15 @@ class OC_MEDIA_SCANNER{
         * @return int the number of songs found
         */
        public static function scanFolder($path){
-               if (OC_FILESYSTEM::is_dir($path)) {
+               if (OC_Filesystem::is_dir($path)) {
                        $songs=0;
-                       if ($dh = OC_FILESYSTEM::opendir($path)) {
+                       if ($dh = OC_Filesystem::opendir($path)) {
                                while (($filename = readdir($dh)) !== false) {
                                        if($filename<>'.' and $filename<>'..' and substr($filename,0,1)!='.'){
                                                $file=$path.'/'.$filename;
-                                               if(OC_FILESYSTEM::is_dir($file)){
+                                               if(OC_Filesystem::is_dir($file)){
                                                        $songs+=self::scanFolder($file);
-                                               }elseif(OC_FILESYSTEM::is_file($file)){
+                                               }elseif(OC_Filesystem::is_file($file)){
                                                        if(self::scanFile($file)){
                                                                $songs++;
                                                        }
@@ -53,7 +53,7 @@ class OC_MEDIA_SCANNER{
                                        }
                                }
                        }
-               }elseif(OC_FILESYSTEM::is_file($path)){
+               }elseif(OC_Filesystem::is_file($path)){
                        $songs=1;
                        self::scanFile($path);
                }else{
@@ -68,8 +68,8 @@ class OC_MEDIA_SCANNER{
         * @return boolean
         */
        public static function scanFile($path){
-               $file=OC_FILESYSTEM::getLocalFile($path);
-               if(substr($path,-3)=='mp3' and OC_HELPER::canExecute("id3info") and OC_HELPER::canExecute("mp3info")){//use the command line tool id3info if possible
+               $file=OC_Filesystem::getLocalFile($path);
+               if(substr($path,-3)=='mp3' and OC_Helper::canExecute("id3info") and OC_Helper::canExecute("mp3info")){//use the command line tool id3info if possible
                        $output=array();
                        $size=filesize($file);
                        $length=0;
index 4bd9acfd80b4d320e6c1749a35374df48895ea4f..0563bc38fb3151b1de32215ecf77a8d2bb0837eb 100644 (file)
 
 require_once('../../lib/base.php');
 
-if( !OC_USER::isLoggedIn()){
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
 require( 'lib_collection.php' );
 
-OC_UTIL::addStyle('media','style');
-OC_UTIL::addScript('media','settings');
+OC_Util::addStyle('media','style');
+OC_Util::addScript('media','settings');
 
-OC_APP::setActiveNavigationEntry( 'media_settings' );
+OC_App::setActiveNavigationEntry( 'media_settings' );
 
-$folderNames=explode(PATH_SEPARATOR,OC_PREFERENCES::getValue($_SESSION['user_id'],'media','paths',''));
+$folderNames=explode(PATH_SEPARATOR,OC_Preferences::getValue($_SESSION['user_id'],'media','paths',''));
 $folders=array();
 foreach($folderNames as $folder){
        if($folder){
@@ -44,9 +44,9 @@ foreach($folderNames as $folder){
        }
 }
 
-$tmpl = new OC_TEMPLATE( 'media', 'settings', 'admin' );
+$tmpl = new OC_Template( 'media', 'settings', 'admin' );
 $tmpl->assign('folders',$folders);
-$tmpl->assign('autoupdate',OC_PREFERENCES::getValue($_SESSION['user_id'],'media','autoupdate',false));
+$tmpl->assign('autoupdate',OC_Preferences::getValue($_SESSION['user_id'],'media','autoupdate',false));
 $tmpl->printPage();
 ?>
 
index 873a4e2092c754a80dc82cbf70f904196488babe..bf0c2c2a7563b13189c04b8c9e7d73974d82fd3c 100644 (file)
@@ -28,8 +28,8 @@ require_once('lib_collection.php');
 
 $user=isset($_POST['user'])?$_POST['user']:'';
 $pass=isset($_POST['pass'])?$_POST['pass']:'';
-if(OC_USER::checkPassword($user,$pass)){
-       OC_UTIL::setupFS($user);
+if(OC_User::checkPassword($user,$pass)){
+       OC_Util::setupFS($user);
        OC_MEDIA_COLLECTION::$uid=$user;
 }else{
        exit;
@@ -40,14 +40,14 @@ if(isset($_POST['play']) and $_POST['play']=='true'){
                exit;
        }
        $song=OC_MEDIA_COLLECTION::getSong($_POST['song']);
-       $ftype=OC_FILESYSTEM::getMimeType( $song['song_path'] );
+       $ftype=OC_Filesystem::getMimeType( $song['song_path'] );
        header('Content-Type:'.$ftype);
        header('Expires: 0');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');
-       header('Content-Length: '.OC_FILESYSTEM::filesize($song['song_path']));
+       header('Content-Length: '.OC_Filesystem::filesize($song['song_path']));
 
-       OC_FILESYSTEM::readfile($song['song_path']);
+       OC_Filesystem::readfile($song['song_path']);
 }
 
 $artist=isset($_POST['artist'])?'%'.$_POST['artist'].'%':'';
@@ -59,7 +59,7 @@ $album=OC_MEDIA_COLLECTION::getAlbumId($album,$artist);
 
 $songs=OC_MEDIA_COLLECTION::getSongs($artist,$album,$song);
 
-$baseUrl=OC_UTIL::getServerURL().OC_HELPER::linkTo('media','tomahawk.php');
+$baseUrl=OC_Util::getServerURL().OC_Helper::linkTo('media','tomahawk.php');
 
 $results=array();
 foreach($songs as $song) {
@@ -68,7 +68,7 @@ foreach($songs as $song) {
                'album' => OC_MEDIA_COLLECTION::getAlbumName($song['song_album']),
                'track' => $song['song_name'],
                'source' => 'ownCloud',
-               'mimetype' => OC_FILESYSTEM::getMimeType($song['song_path']),
+               'mimetype' => OC_Filesystem::getMimeType($song['song_path']),
                'extension' => substr($song['song_path'],strrpos($song['song_path'],'.')),
                'url' => $baseUrl.'?play=true&song='.$song['song_id'],
                'bitrate' => round($song['song_id']/$song['song_length'],0),
index 67b61989f7fb2154bec5495da36c06b853943eb8..7f20372ea8dd8bde14e47ba26bec4dc283e6c456 100644 (file)
@@ -27,13 +27,13 @@ require_once('apps/user_ldap/user_ldap.php');
 define("OC_USER_BACKEND_LDAP_DEFAULT_PORT", 389);
 
 // register user backend
-OC_USER::useBackend( "LDAP" );
+OC_User::useBackend( "LDAP" );
 
 // add settings page to navigation
 $entry = array(
        'id' => "user_ldap_settings",
        'order'=>1,
-       'href' => OC_HELPER::linkTo( "user_ldap", "settings.php" ),
+       'href' => OC_Helper::linkTo( "user_ldap", "settings.php" ),
        'name' => 'LDAP'
 );
-OC_APP::addNavigationSubEntry( "core_users", $entry);
+OC_App::addNavigationSubEntry( "core_users", $entry);
index 8f9d282d2b100393dab650d1d112ed0541927679..cae3542a65be96cdbbed624ceb79db5314aab357 100644 (file)
@@ -23,8 +23,8 @@
 
 require_once('../../lib/base.php');
 
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
@@ -32,20 +32,20 @@ $params = array('ldap_host', 'ldap_port', 'ldap_dn', 'ldap_password', 'ldap_base
 
 foreach($params as $param){
        if(isset($_POST[$param])){
-               OC_APPCONFIG::setValue('user_ldap', $param, $_POST[$param]);
+               OC_Appconfig::setValue('user_ldap', $param, $_POST[$param]);
        }
 }
-OC_APP::setActiveNavigationEntry( "user_ldap_settings" );
+OC_App::setActiveNavigationEntry( "user_ldap_settings" );
 
 
 // fill template
-$tmpl = new OC_TEMPLATE( 'user_ldap', 'settings', 'admin' );
+$tmpl = new OC_Template( 'user_ldap', 'settings', 'admin' );
 foreach($params as $param){
-               $value = OC_APPCONFIG::getValue('user_ldap', $param,'');
+               $value = OC_Appconfig::getValue('user_ldap', $param,'');
                $tmpl->assign($param, $value);
 }
 
 // ldap_port has a default value
-$tmpl->assign( 'ldap_port', OC_APPCONFIG::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT));
+$tmpl->assign( 'ldap_port', OC_Appconfig::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT));
 
 $tmpl->printPage();
index a197c0a10e0995f62b3826a95d9a7f5ec748583d..54fc51fe0cd0ffb80d8e8e3cdbbec2483f445a51 100644 (file)
@@ -21,7 +21,7 @@
  *
  */
 
-class OC_USER_LDAP extends OC_USER_BACKEND {
+class OC_USER_LDAP extends OC_User_Backend {
 
        protected $ds;
        protected $configured = false;
@@ -35,12 +35,12 @@ class OC_USER_LDAP extends OC_USER_BACKEND {
        protected $ldap_filter;
 
        function __construct() {
-               $this->ldap_host = OC_APPCONFIG::getValue('user_ldap', 'ldap_host','');
-               $this->ldap_port = OC_APPCONFIG::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT   );
-               $this->ldap_dn = OC_APPCONFIG::getValue('user_ldap', 'ldap_dn','');
-               $this->ldap_password = OC_APPCONFIG::getValue('user_ldap', 'ldap_password','');
-               $this->ldap_base = OC_APPCONFIG::getValue('user_ldap', 'ldap_base','');
-               $this->ldap_filter = OC_APPCONFIG::getValue('user_ldap', 'ldap_filter','');
+               $this->ldap_host = OC_Appconfig::getValue('user_ldap', 'ldap_host','');
+               $this->ldap_port = OC_Appconfig::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT   );
+               $this->ldap_dn = OC_Appconfig::getValue('user_ldap', 'ldap_dn','');
+               $this->ldap_password = OC_Appconfig::getValue('user_ldap', 'ldap_password','');
+               $this->ldap_base = OC_Appconfig::getValue('user_ldap', 'ldap_base','');
+               $this->ldap_filter = OC_Appconfig::getValue('user_ldap', 'ldap_filter','');
 
                if( !empty($this->ldap_host)
                        && !empty($this->ldap_port)
index d6eacfc0a3a769f852634c7365c222b782d163d0..74c13402caf3c07f3315b64890ff6784373283e0 100644 (file)
@@ -6,15 +6,15 @@ if (!in_array ('curl', get_loaded_extensions())){
 }
 
 $urlBase=((isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on') ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'];
-OC_UTIL::addHeader('link',array('rel'=>'openid.server', 'href'=>$urlBase.OC_HELPER::linkTo( "user_openid", "user.php" ).'/'));
-OC_UTIL::addHeader('link',array('rel'=>'openid.delegate', 'href'=>$urlBase.OC_HELPER::linkTo( "user_openid", "user.php" ).'/'));
+OC_Util::addHeader('link',array('rel'=>'openid.server', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'));
+OC_Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>$urlBase.OC_Helper::linkTo( "user_openid", "user.php" ).'/'));
 
 require_once 'apps/user_openid/user_openid.php';
 
-OC_APP::addSettingsPage( array( "id" => "user_openid_settings", 'order'=>1, "href" => OC_HELPER::linkTo( "user_openid", "settings.php" ), "name" => "OpenID"));
+OC_App::addSettingsPage( array( "id" => "user_openid_settings", 'order'=>1, "href" => OC_Helper::linkTo( "user_openid", "settings.php" ), "name" => "OpenID"));
 
 //active the openid backend
-OC_USER::useBackend('openid');
+OC_User::useBackend('openid');
 
 //check for results from openid requests
 if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){
index 5726ca99948db922d357cfc3dbdb5adf3939223b..bcab9e55cbbf06ff733c3834dafaf459318ed5c6 100644 (file)
@@ -205,7 +205,7 @@ function authorize_mode () {
 
        $profile['idp_url']=$IDENTITY;
        if (isset($_SERVER['PHP_AUTH_USER']) && $profile['authorized'] === false && $_SERVER['PHP_AUTH_USER']==$USERNAME) {
-               if (OC_USER::checkPassword($USERNAME, $_SERVER['PHP_AUTH_PW'])) {// successful login!
+               if (OC_User::checkPassword($USERNAME, $_SERVER['PHP_AUTH_PW'])) {// successful login!
                        // return to the refresh url if they get in
                        $_SESSION['openid_auth']=true;
                        $_SESSION['openid_user']=$USERNAME;
@@ -559,7 +559,7 @@ function logout_mode () {
  */
 function no_mode () {
        global $USERNAME, $profile;
-       $tmpl = new OC_TEMPLATE( 'user_openid', 'nomode', 'guest' );
+       $tmpl = new OC_Template( 'user_openid', 'nomode', 'guest' );
        if(substr($profile['req_url'],-1,1)!=='/'){//the identity should always end with a /
                $profile['req_url'].='/';
        }
index 29c18eaa497bea5b83c9e6c25d4e3681cfb05da5..4293a6c8aaf8d46523878edba5b45f60fac5ced3 100644 (file)
@@ -1,22 +1,22 @@
 <?php
 
 require_once('../../lib/base.php');
-if( !OC_USER::isLoggedIn()){
-    header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+    header( "Location: ".OC_Helper::linkTo( "index.php" ));
     exit();
 }
 
 if(isset($_POST['input_identity'])){
-       OC_PREFERENCES::setValue(OC_USER::getUser(),'user_openid','identity',$_POST['input_identity']);
+       OC_Preferences::setValue(OC_User::getUser(),'user_openid','identity',$_POST['input_identity']);
 }
 
-OC_APP::setActiveNavigationEntry( "user_openid_settings" );
+OC_App::setActiveNavigationEntry( "user_openid_settings" );
 
-$identity=OC_PREFERENCES::getValue(OC_USER::getUser(),'user_openid','identity','');
+$identity=OC_Preferences::getValue(OC_User::getUser(),'user_openid','identity','');
 
-$tmpl = new OC_TEMPLATE( "user_openid", "settings", "admin");
+$tmpl = new OC_Template( "user_openid", "settings", "admin");
 $tmpl->assign('identity',$identity);
-$tmpl->assign('user',OC_USER::getUser());
+$tmpl->assign('user',OC_User::getUser());
 
 $tmpl->printPage();
 
index 4b5d13e3398ad2628b641da3d2f1bd0f8dfef841..3743d232b6d482066e1f70c9f3a6e054276cee88 100644 (file)
@@ -38,7 +38,7 @@ $RUNTIME_NOAPPS=true;
 $RUNTIME_NOAPPS=false;
 require_once '../../lib/base.php';
 
-if(!OC_USER::userExists($USERNAME)){
+if(!OC_User::userExists($USERNAME)){
        error_log($USERNAME.' doesn\'t exist');
        $USERNAME='';
 }
index c18edccf2dbae3952073c23525d23185c2223564..d9af94dcafa70dd006cea6b9a0cbbdb8d388bc97 100644 (file)
@@ -26,7 +26,7 @@ require_once('class.openid.v3.php');
 /**
  * Class for user management in a SQL Database (e.g. MySQL, SQLite)
  */
-class OC_USER_OPENID extends OC_USER_BACKEND {
+class OC_USER_OPENID extends OC_User_Backend {
        /**
         * @brief Check if the password is correct
         * @param $uid The username
index 65cfaec3b7ca5f42bddb0ee9e479a25c9aa3f913..d042944c193ba1b5f960b0816e1ea0a59ef2e449 100644 (file)
@@ -2,7 +2,7 @@
 if(!isset($_)){//also provide standalone error page
        require_once '../../lib/base.php';
        
-       $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+       $tmpl = new OC_Template( '', '404', 'guest' );
        $tmpl->printPage();
        exit;
 }
index 0a6dacad95583dd90e38cc261578957cdfae0c1b..8b36d14bbf5da942887db2a27bd54704102970ee 100644 (file)
 
                <fieldset>
                        <legend><?php echo $l->t( 'Create an <strong>admin account</strong>.' ); ?></legend>
-                       <p><label for="adminlogin"><?php echo $l->t( 'Username' ); ?></label><input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_HELPER::init_var('adminlogin'); ?>" autofocus /></p>
-                       <p><label for="adminpass"><?php echo $l->t( 'Password' ); ?></label><input type="password" name="adminpass" id="adminpass" value="<?php print OC_HELPER::init_var('adminpass'); ?>" /></p>
+                       <p><label for="adminlogin"><?php echo $l->t( 'Username' ); ?></label><input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" autofocus /></p>
+                       <p><label for="adminpass"><?php echo $l->t( 'Password' ); ?></label><input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" /></p>
         </fieldset>
         
-        <a id='showAdvanced'><strong><?php echo $l->t( 'Advanced' ); ?></strong> <img src='<?php echo OC_HELPER::imagePath('','drop-arrow.png'); ?>'></img></a>
+        <a id='showAdvanced'><strong><?php echo $l->t( 'Advanced' ); ?></strong> <img src='<?php echo OC_Helper::imagePath('','drop-arrow.png'); ?>'></img></a>
         
         <fieldset id='datadirField'>
                        <legend><?php echo $l->t( 'Set where to store the data.' ); ?></legend>
-                       <p><label for="directory"><?php echo $l->t( 'Data directory:' ); ?></label><input type="text" name="directory" id="directory" value="<?php print OC_HELPER::init_var('directory', $_['directory']); ?>" /></p>
+                       <p><label for="directory"><?php echo $l->t( 'Data directory:' ); ?></label><input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" /></p>
                </fieldset>
                
                <fieldset id='databaseField'>
@@ -43,7 +43,7 @@
                        <p><?php echo $l->t( 'SQLite will be used for the database. You have nothing to do.' ); ?></p>
                        <input type="hidden" id="dbtype" name="dbtype" value="sqlite" />
                        <?php else: ?>
-                       <p><label class="sqlite" for="sqlite"><?php echo $l->t( 'SQLite' ); ?></label><input type="radio" name="dbtype" value='sqlite' id="sqlite" <?php OC_HELPER::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/></p>
+                       <p><label class="sqlite" for="sqlite"><?php echo $l->t( 'SQLite' ); ?></label><input type="radio" name="dbtype" value='sqlite' id="sqlite" <?php OC_Helper::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/></p>
                        <?php endif; ?>
                        <?php endif; ?>
 
                        <p><?php echo $l->t( 'MySQL will be used for the database.' ); ?></p>
                        <input type="hidden" id="dbtype" name="dbtype" value="mysql" />
                        <?php else: ?>
-                       <p><label class="mysql" for="mysql">MySQL </label><input type="radio" name="dbtype" value='mysql' id="mysql" <?php OC_HELPER::init_radio('dbtype', 'mysql', 'sqlite'); ?>/></p>
+                       <p><label class="mysql" for="mysql">MySQL </label><input type="radio" name="dbtype" value='mysql' id="mysql" <?php OC_Helper::init_radio('dbtype', 'mysql', 'sqlite'); ?>/></p>
                        <?php endif; ?>
                        <div id="use_mysql">
-                               <p><label for="dbuser"><?php echo $l->t( 'MySQL username:' ); ?></label><input type="text" name="dbuser" id="dbuser" value="<?php print OC_HELPER::init_var('dbuser'); ?>" /></p>
-                               <p><label for="dbpass"><?php echo $l->t( 'MySQL password:' ); ?></label><input type="password" name="dbpass" id="dbpass" value="<?php print OC_HELPER::init_var('dbpass'); ?>" /></p>
-                               <p><label for="dbname"><?php echo $l->t( 'Database name:' ); ?></label><input type="text" name="dbname" id="dbname" value="<?php print OC_HELPER::init_var('dbname'); ?>" /></p>
-                               <p><label for="dbhost"><?php echo $l->t( 'Host:' ); ?></label><input type="text" name="dbhost" id="dbhost" value="<?php print OC_HELPER::init_var('dbhost', 'localhost'); ?>" /></p>
-                               <p><label for="dbtableprefix"><?php echo $l->t( 'Table prefix:' ); ?></label><input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_HELPER::init_var('dbtableprefix', 'oc_'); ?>" /></p>
+                               <p><label for="dbuser"><?php echo $l->t( 'MySQL username:' ); ?></label><input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" /></p>
+                               <p><label for="dbpass"><?php echo $l->t( 'MySQL password:' ); ?></label><input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" /></p>
+                               <p><label for="dbname"><?php echo $l->t( 'Database name:' ); ?></label><input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" /></p>
+                               <p><label for="dbhost"><?php echo $l->t( 'Host:' ); ?></label><input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" /></p>
+                               <p><label for="dbtableprefix"><?php echo $l->t( 'Table prefix:' ); ?></label><input type="text" name="dbtableprefix" id="dbtableprefix" value="<?php print OC_Helper::init_var('dbtableprefix', 'oc_'); ?>" /></p>
                                
                        </div>
                        <?php endif; ?>
index 723c7f7612bc4aa9a438d76c047cba39dacbb93f..20df8a0c71d82b58ef9ece575a26ec26ac0be45b 100644 (file)
@@ -29,12 +29,12 @@ $RUNTIME_NOSETUPFS = true;
 require_once('../lib/base.php');
 
 // We need the file system although we said do not load it! Do it by hand now
-OC_UTIL::setupFS();
+OC_Util::setupFS();
 
 // The user should have admin rights. This is an admin page!
-if( !OC_USER::isLoggedIn() || !OC_USER::ingroup( $_SESSION['username'], 'admin' )){
+if( !OC_User::isLoggedIn() || !OC_User::ingroup( $_SESSION['username'], 'admin' )){
        // Bad boy! Go to the very first page of owncloud
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
@@ -43,7 +43,7 @@ $myvar = 2;
 $myarray = array( "foo" => array( 0, 1, 2 ), "bar" => "baz" );
 
 // Preparing for output!
-$tmpl = new OC_TEMPLATE( "skeleton", "admin", "admin" ); // Programname, template, mode
+$tmpl = new OC_Template( "skeleton", "admin", "admin" ); // Programname, template, mode
 // Assign the vars
 $tmpl->assign( "var", $myvar );
 $tmpl->assign( "array", $myarray );
index 12db7154c2baa5dd5d3cefdf2ad4f085b8edbeef..ce310996b05083ffd6951420b6dc39e4c41c5250 100644 (file)
@@ -4,12 +4,12 @@
  */
 
 // Hello, we are here
-OC_APP::register( array( "id" => "skeleton", "name" => "Files", "order" => 1000 ));
+OC_App::register( array( "id" => "skeleton", "name" => "Files", "order" => 1000 ));
 
 // Add application to navigation
-OC_UTIL::addNavigationEntry( array( "id" => "skeleton_index", "order" => 1000, "href" => OC_HELPER::linkTo( "skeleton", "index.php" ), "icon" => OC_HELPER::imagePath( "skeleton", "app.png" ), "name" => "Example app" ));
+OC_Util::addNavigationEntry( array( "id" => "skeleton_index", "order" => 1000, "href" => OC_Helper::linkTo( "skeleton", "index.php" ), "icon" => OC_Helper::imagePath( "skeleton", "app.png" ), "name" => "Example app" ));
 
 // Add an admin page
-OC_UTIL::addAdminPage( array( "order" => 1, "href" => OC_HELPER::linkTo( "skeleton", "admin.php" ), "name" => "Example app options" ));
+OC_Util::addAdminPage( array( "order" => 1, "href" => OC_Helper::linkTo( "skeleton", "admin.php" ), "name" => "Example app options" ));
 
 ?>
index 5402990e4c92685b11a726e44e8357b814767958..10043887845e0a0882d12cde7ed7a5a6570391d0 100644 (file)
 require_once('../lib/base.php');
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
 // Load the files we need
-OC_UTIL::addStyle( "files", "files" );
-OC_UTIL::addScript( "files", "files" );
+OC_Util::addStyle( "files", "files" );
+OC_Util::addScript( "files", "files" );
 
 // Load the files
 $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
 
 $files = array();
-foreach( OC_FILES::getdirectorycontent( $dir ) as $i ){
+foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
        $i["date"] = date( $CONFIG_DATEFORMAT, $i["mtime"] );
        $files[] = $i;
 }
@@ -55,7 +55,7 @@ foreach( explode( "/", $dir ) as $i ){
 }
 
 // return template
-$tmpl = new OC_TEMPLATE( "files", "index", "user" );
+$tmpl = new OC_Template( "files", "index", "user" );
 $tmpl->assign( "files", $files );
 $tmpl->assign( "breadcrumb", $breadcrumb );
 $tmpl->printPage();
index c0a41335f5e0b0559b24cce4e00a69717ac20484..0b8639f38ca605d8837205226ed2424a0e8e5e90 100644 (file)
@@ -27,22 +27,22 @@ require_once('../lib/base.php');
 
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( OC_USER::getUser(), 'admin' )){
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
 $htaccessWorking=(getenv('htaccessWorking')=='true');
 if(isset($_POST['maxUploadSize'])){
        $maxUploadFilesize=$_POST['maxUploadSize'];
-       OC_FILES::setUploadLimit(OC_HELPER::computerFileSize($maxUploadFilesize));
+       OC_Files::setUploadLimit(OC_Helper::computerFileSize($maxUploadFilesize));
 }else{
        $maxUploadFilesize = ini_get('upload_max_filesize').'B';
 }
 
-OC_APP::setActiveNavigationEntry( "files_administration" );
+OC_App::setActiveNavigationEntry( "files_administration" );
 // return template
-$tmpl = new OC_TEMPLATE( "files", "admin", "admin" );
+$tmpl = new OC_Template( "files", "admin", "admin" );
 $tmpl->assign( 'htaccessWorking', $htaccessWorking );
 $tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
 $tmpl->printPage();
index 2c2f665fd6cc9571f5be057e3a3ab999fb209a2a..183ee86c7889d119c5fc1c586de95f673c6112ef 100644 (file)
@@ -9,7 +9,7 @@ require_once('../../lib/base.php');
 // header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -40,8 +40,8 @@ $query=strtolower($query);
 
 $files=array();
 
-if(OC_FILESYSTEM::file_exists($base) and OC_FILESYSTEM::is_dir($base)){
-       $dh = OC_FILESYSTEM::opendir($base);
+if(OC_Filesystem::file_exists($base) and OC_Filesystem::is_dir($base)){
+       $dh = OC_Filesystem::opendir($base);
        if($dh){
                if(substr($base,-1,1)!='/'){
                        $base=$base.'/';
@@ -50,7 +50,7 @@ if(OC_FILESYSTEM::file_exists($base) and OC_FILESYSTEM::is_dir($base)){
                        if ($file != "." && $file != ".."){
                                if(substr(strtolower($file),0,$queryLen)==$query){
                                        $item=$base.$file;
-                                       if((!$dirOnly or OC_FILESYSTEM::is_dir($item))){
+                                       if((!$dirOnly or OC_Filesystem::is_dir($item))){
                                                $files[]=(object)array('id'=>$item,'label'=>$item,'name'=>$item);
                                        }
                                }
index 79caf4d0bb2c37788574da480d7fde8aef66d14e..782db215dfc2ef74eefd0ec32203efacbb357c4c 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -21,7 +21,7 @@ $filesWithError = '';
 $status = 'success';
 //Now delete
 foreach($files as $file) {
-    if( !OC_FILES::delete( $dir, $file )){
+    if( !OC_Files::delete( $dir, $file )){
                $filesWithError .= $file . "\n";
                $status = 'error';
        }
index 0b2f894a11ba1854f110a516b8b325e7f9b9c629..2bbf1df4ecace9c62d576cc9dfc10bc3a997a93c 100644 (file)
 require_once('../../lib/base.php');
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
 $files = $_GET["files"];
 $dir = $_GET["dir"];
 
-OC_FILES::get($dir,$files);
+OC_Files::get($dir,$files);
 ?>
index 26462eb5ab998418edc071dc89113ed3a8e1dafa..547bc91fb052ab1f1ca8e5bdc99c6ef36baa9bf6 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -28,7 +28,7 @@ if($doBreadcrumb){
                }
        }
        
-       $breadcrumbNav = new OC_TEMPLATE( "files", "part.breadcrumb", "" );
+       $breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" );
        $breadcrumbNav->assign( "breadcrumb", $breadcrumb );
        
        $data['breadcrumb'] = $breadcrumbNav->fetchPage();
@@ -36,12 +36,12 @@ if($doBreadcrumb){
 
 // make filelist
 $files = array();
-foreach( OC_FILES::getdirectorycontent( $dir ) as $i ){
-       $i["date"] = OC_UTIL::formatDate($i["mtime"] );
+foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
+       $i["date"] = OC_Util::formatDate($i["mtime"] );
        $files[] = $i;
 }
 
-$list = new OC_TEMPLATE( "files", "part.list", "" );
+$list = new OC_Template( "files", "part.list", "" );
 $list->assign( "files", $files );
 $data = array('files' => $list->fetchPage());
 
index b1ba641c5b10c18305be33ba3b8161cf70d32b99..4224cbce6d0b4f9d282b98cd9d8ae0de99581ed0 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -18,7 +18,7 @@ $file = $_GET["file"];
 $target = $_GET["target"];
 
 
-if(OC_FILES::move($dir,$file,$target,$file)){
+if(OC_Files::move($dir,$file,$target,$file)){
        echo json_encode( array( "status" => 'success', "data" => array( "dir" => $dir, "files" => $file )));
 }else{
        echo json_encode( array( "status" => 'error', "data" => array( "message" => "Could move $file" )));
index 988e7f040121099e47309ab4ceca530e7fcb80bf..610418583bd680bfb334047ef59f506fb4f4a7dd 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -21,7 +21,7 @@ if($foldername == '') {
        exit();
 }
 error_log('try to create ' . $foldername . ' in ' . $dir);
-if(OC_FILES::newFile($dir, $foldername, 'dir')) {
+if(OC_Files::newFile($dir, $foldername, 'dir')) {
        echo json_encode( array( "status" => "success", "data" => array()));
        exit();
 }
index 7554aa0dd623eca0c27e1e832efddf380804f444..516077f6fda08b3d6799b9cead6e07515316b5ff 100644 (file)
@@ -7,7 +7,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -18,7 +18,7 @@ $file = $_GET["file"];
 $newname = $_GET["newname"];
 
 // Delete
-if( OC_FILES::move( $dir, $file, $dir, $newname )) {
+if( OC_Files::move( $dir, $file, $dir, $newname )) {
        echo json_encode( array( "status" => "success", "data" => array( "dir" => $dir, "file" => $file, "newname" => $newname )));
 }
 else{
index f47f9b3d28276d24a4d2843ade5f9533ee32375e..5dcd2f2b6af722ae68c771d6addfd234234a79a8 100644 (file)
@@ -9,7 +9,7 @@ require_once('../../lib/base.php');
 header( "Content-Type: text/plain" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
        echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
        exit();
 }
@@ -24,8 +24,8 @@ if(strpos($dir,'..') === false){
        $fileCount=count($files['name']);
        for($i=0;$i<$fileCount;$i++){
                $target='/' . stripslashes($dir) . $files['name'][$i];
-               if(OC_FILESYSTEM::fromUploadedFile($files['tmp_name'][$i],$target)){
-                       $result[]=array( "status" => "success", 'mime'=>OC_FILESYSTEM::getMimeType($target),'size'=>OC_FILESYSTEM::filesize($target),'name'=>$files['name'][$i]);
+               if(OC_Filesystem::fromUploadedFile($files['tmp_name'][$i],$target)){
+                       $result[]=array( "status" => "success", 'mime'=>OC_Filesystem::getMimeType($target),'size'=>OC_Filesystem::filesize($target),'name'=>$files['name'][$i]);
                }
        }
        echo json_encode($result);
index 06ca16e82d4d8c3c2ee69f76f26b820882372204..0f95b19f59226d001e31717eaaacdfa51f09925b 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 
-OC_APP::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
+OC_App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
 
-OC_APP::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_HELPER::linkTo( "files", "index.php" ), "icon" => OC_HELPER::imagePath( "files", "home.png" ), "name" => "Files" ));
-OC_APP::addAdminPage( array( "id" => "files_administration", "order" => 3, "href" => OC_HELPER::linkTo( "files", "admin.php" ), "name" => "Files", "icon" => OC_HELPER::imagePath( "files", "folder.png" )));
+OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_Helper::linkTo( "files", "index.php" ), "icon" => OC_Helper::imagePath( "files", "home.png" ), "name" => "Files" ));
+OC_App::addAdminPage( array( "id" => "files_administration", "order" => 3, "href" => OC_Helper::linkTo( "files", "admin.php" ), "name" => "Files", "icon" => OC_Helper::imagePath( "files", "folder.png" )));
 
 
 // To add navigation sub entries use
-// OC_APP::addNavigationSubEntry( "files_index", array( ... ));
+// OC_App::addNavigationSubEntry( "files_index", array( ... ));
 
 ?>
index ab3dee51348c2191ff817f1403789e4607c1a98a..cc52b930f7230876ec766559a90f62df7578278c 100644 (file)
 require_once('../lib/base.php');
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
 $filename = $_GET["file"];
 
-if(!OC_FILESYSTEM::file_exists($filename)){
+if(!OC_Filesystem::file_exists($filename)){
        header("HTTP/1.0 404 Not Found");
-       $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+       $tmpl = new OC_Template( '', '404', 'guest' );
        $tmpl->assign('file',$filename);
        $tmpl->printPage();
        exit;
 }
 
-$ftype=OC_FILESYSTEM::getMimeType( $filename );
+$ftype=OC_Filesystem::getMimeType( $filename );
 
 header('Content-Type:'.$ftype);
 header('Content-Disposition: attachment; filename="'.basename($filename).'"');
 header('Expires: 0');
 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
 header('Pragma: public');
-header('Content-Length: '.OC_FILESYSTEM::filesize($filename));
+header('Content-Length: '.OC_Filesystem::filesize($filename));
 
 ob_end_clean();
-OC_FILESYSTEM::readfile( $filename );
+OC_Filesystem::readfile( $filename );
 ?>
index 4f40e70393b5312a4222b86d02030fbf248d7071..821879b03463672a9020ec4ea1c4522f43bf660c 100644 (file)
 require_once('../lib/base.php');
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
-       header( "Location: ".OC_HELPER::linkTo( '', 'index.php' ));
+if( !OC_User::isLoggedIn()){
+       header( "Location: ".OC_Helper::linkTo( '', 'index.php' ));
        exit();
 }
 
 // Load the files we need
-OC_UTIL::addStyle( "files", "files" );
-OC_UTIL::addScript( "files", "files" );
-OC_UTIL::addScript( 'files', 'filelist' );
-OC_UTIL::addScript( 'files', 'fileactions' );
+OC_Util::addStyle( "files", "files" );
+OC_Util::addScript( "files", "files" );
+OC_Util::addScript( 'files', 'filelist' );
+OC_Util::addScript( 'files', 'fileactions' );
 if(!isset($_SESSION['timezone'])){
-       OC_UTIL::addScript( 'files', 'timezone' );
+       OC_Util::addScript( 'files', 'timezone' );
 }
-OC_APP::setActiveNavigationEntry( "files_index" );
+OC_App::setActiveNavigationEntry( "files_index" );
 // Load the files
 $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
 
 $files = array();
-foreach( OC_FILES::getdirectorycontent( $dir ) as $i ){
-       $i["date"] = OC_UTIL::formatDate($i["mtime"] );
+foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
+       $i["date"] = OC_Util::formatDate($i["mtime"] );
        if($i['type']=='file'){
                $i['extention']=substr($i['name'],strrpos($i['name'],'.'));
                $i['basename']=substr($i['name'],0,strrpos($i['name'],'.'));
@@ -67,19 +67,19 @@ foreach( explode( "/", $dir ) as $i ){
 }
 
 // make breadcrumb und filelist markup
-$list = new OC_TEMPLATE( "files", "part.list", "" );
+$list = new OC_Template( "files", "part.list", "" );
 $list->assign( "files", $files );
-$breadcrumbNav = new OC_TEMPLATE( "files", "part.breadcrumb", "" );
+$breadcrumbNav = new OC_Template( "files", "part.breadcrumb", "" );
 $breadcrumbNav->assign( "breadcrumb", $breadcrumb );
 
-$maxUploadFilesize = OC_HELPER::computerFileSize(ini_get('upload_max_filesize'));
+$maxUploadFilesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
 
-$tmpl = new OC_TEMPLATE( "files", "index", "user" );
+$tmpl = new OC_Template( "files", "index", "user" );
 $tmpl->assign( "fileList", $list->fetchPage() );
 $tmpl->assign( "breadcrumb", $breadcrumbNav->fetchPage() );
 $tmpl->assign( 'dir', $dir);
 $tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
-$tmpl->assign( 'uploadMaxHumanFilesize', OC_HELPER::humanFileSize($maxUploadFilesize));
+$tmpl->assign( 'uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize));
 $tmpl->printPage();
 
 ?>
index 447a38b1815c5971fc0c7bdcdbf34120351d8986..1f2e9d9868cc63fcd090b506f3305648094ffbe4 100644 (file)
 require_once('../lib/base.php');
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
-       header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+       header( "Location: ".OC_Helper::linkTo( "index.php" ));
        exit();
 }
 
 // Load the files we need
-OC_UTIL::addStyle( "files", "files" );
-OC_UTIL::addScript( "files", "files" );
+OC_Util::addStyle( "files", "files" );
+OC_Util::addScript( "files", "files" );
 
 // Load the files
 $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
 
 $files = array();
-foreach( OC_FILES::getdirectorycontent( $dir ) as $i ){
+foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
        $i["date"] = date( $CONFIG_DATEFORMAT, $i["mtime"] );
        $files[] = $i;
 }
@@ -55,7 +55,7 @@ foreach( explode( "/", $dir ) as $i ){
 }
 
 // return template
-$tmpl = new OC_TEMPLATE( "files", "index", "user" );
+$tmpl = new OC_Template( "files", "index", "user" );
 $tmpl->assign( 'files', $files );
 $tmpl->assign( "breadcrumb", $breadcrumb );
 $tmpl->printPage();
index 40880d34911697295b344ad1efe8a6e0e9823d09..e0cf260830189f3e3a7bb44770c636fcb0d2401d 100644 (file)
@@ -1,4 +1,4 @@
-<?php OC_UTIL::addScript('files','admin'); ?>
+<?php OC_Util::addScript('files','admin'); ?>
 
 <form name="filesForm" action='#' method='post'>
        <?php if($_['htaccessWorking']):?>
index fd46085ef77f75e7ec4d3bab8e8226ba567ddb9a..2e82c0cd18178b5bbe36d2ca5e73907b6b797433 100644 (file)
@@ -1,14 +1,14 @@
 <?php
 
-OC_APP::register( array( "order" => 1, "id" => "help", "name" => "Help" ));
+OC_App::register( array( "order" => 1, "id" => "help", "name" => "Help" ));
 
 // Workaround for having help as the last entry always
-$entry = array( "id" => "help", "order" => 1000, "href" => OC_HELPER::linkTo( "help", "index.php" ), "name" => "Help", "icon" => OC_HELPER::imagePath( "help", "help.png" ));
-if( isset( $_SESSION["user_id"] ) && OC_GROUP::inGroup( $_SESSION["user_id"], "admin" )){
-       OC_APP::addAdminPage( $entry );
+$entry = array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "help", "index.php" ), "name" => "Help", "icon" => OC_Helper::imagePath( "help", "help.png" ));
+if( isset( $_SESSION["user_id"] ) && OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
+       OC_App::addAdminPage( $entry );
 }
 else{
-       OC_APP::addSettingsPage( $entry );
+       OC_App::addSettingsPage( $entry );
 }
 
 ?>
index adcb47f08f617e696b6c4db6003293dc6a0c4cde..f1adea0be0118de2c43c474db68f36f8c16b6c4c 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
 require_once('../lib/base.php');
-if( !OC_USER::isLoggedIn()){
-    header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+    header( "Location: ".OC_Helper::linkTo( "index.php" ));
     exit();
 }
 
@@ -12,13 +12,13 @@ $page=2;
 
 
 // Load the files we need
-OC_UTIL::addStyle( "help", "help" );
-OC_APP::setActiveNavigationEntry( "help" );
+OC_Util::addStyle( "help", "help" );
+OC_App::setActiveNavigationEntry( "help" );
 
-$kbe=OC_OCSCLIENT::getKnownledgebaseEntries();
+$kbe=OC_OCSClient::getKnownledgebaseEntries();
 
 
-$tmpl = new OC_TEMPLATE( "help", "index", "admin" );
+$tmpl = new OC_Template( "help", "index", "admin" );
 $tmpl->assign( "kbe", $kbe );
 $tmpl->assign( "pagecount", $pagecount );
 $tmpl->assign( "page", $page );
index 7105507f5ebb2f0859021cebcde815d3866b3565..f239de217d0d9880ee43641efc04f698ffa50da5 100644 (file)
@@ -17,8 +17,8 @@
                </tbody>
        </table>
        <?php
-               $url=OC_HELPER::linkTo( "help", "index.php" ).'?page=';
-               $pageNavi=OC_UTIL::getPageNavi($_['pagecount'],$_['page'],$url);
+               $url=OC_Helper::linkTo( "help", "index.php" ).'?page=';
+               $pageNavi=OC_Util::getPageNavi($_['pagecount'],$_['page'],$url);
                $pageNavi->printPage();
        ?>
        <a target="_blank" class="prettybutton" href="http://apps.owncloud.com/knowledgebase/editquestion.php?action=new"><?php echo $l->t( 'ASK A QUESTION' ); ?></a>
index 6e580a508c82a03e58820a76930988394d1c404b..46dc990af68fb2c04b795b44b5491301228266ea 100644 (file)
--- a/index.php
+++ b/index.php
@@ -25,14 +25,14 @@ $RUNTIME_NOAPPS = TRUE; //no apps, yet
 
 require_once('lib/base.php');
 
-OC_UTIL::addScript('setup');
+OC_Util::addScript('setup');
 
-$not_installed = !OC_CONFIG::getValue('installed', false);
+$not_installed = !OC_Config::getValue('installed', false);
 $install_called = (isset($_POST['install']) AND $_POST['install']=='true');
 // First step : check if the server is correctly configured for ownCloud :
-$errors = OC_UTIL::checkServer();
+$errors = OC_Util::checkServer();
 if(count($errors) > 0) {
-       OC_TEMPLATE::printGuestPage("", "error", array("errors" => $errors));
+       OC_Template::printGuestPage("", "error", array("errors" => $errors));
 }
 
 // Setup required :
@@ -41,47 +41,47 @@ elseif($not_installed OR $install_called) {
 }
 
 // Someone is logged in :
-elseif(OC_USER::isLoggedIn()) {
+elseif(OC_User::isLoggedIn()) {
        if(isset($_GET["logout"]) and ($_GET["logout"])) {
-               OC_USER::logout();
+               OC_User::logout();
                header("Location: ".$WEBROOT.'/');
                exit();
        }
        else {
-               header("Location: ".$WEBROOT.'/'.OC_APPCONFIG::getValue("core", "defaultpage", "files/index.php"));
+               header("Location: ".$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
                exit();
        }
 }
 
 // Someone wants to log in :
 elseif(isset($_POST["user"])) {
-       OC_APP::loadApps();
-       if(OC_USER::login($_POST["user"], $_POST["password"])) {
-               header("Location: ".$WEBROOT.'/'.OC_APPCONFIG::getValue("core", "defaultpage", "files/index.php"));
+       OC_App::loadApps();
+       if(OC_User::login($_POST["user"], $_POST["password"])) {
+               header("Location: ".$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
                if(!empty($_POST["remember_login"])){
-                       OC_USER::setUsernameInCookie($_POST["user"]);
+                       OC_User::setUsernameInCookie($_POST["user"]);
                }
                else {
-                       OC_USER::unsetUsernameInCookie();
+                       OC_User::unsetUsernameInCookie();
                }
                exit();
        }
        else {
                if(isset($_COOKIE["username"])){
-                       OC_TEMPLATE::printGuestPage("", "login", array("error" => true, "username" => $_COOKIE["username"]));
+                       OC_Template::printGuestPage("", "login", array("error" => true, "username" => $_COOKIE["username"]));
                }else{
-                       OC_TEMPLATE::printGuestPage("", "login", array("error" => true));
+                       OC_Template::printGuestPage("", "login", array("error" => true));
                }
        }
 }
 
 // For all others cases, we display the guest page :
 else {
-       OC_APP::loadApps();
+       OC_App::loadApps();
        if(isset($_COOKIE["username"])){
-               OC_TEMPLATE::printGuestPage("", "login", array("error" => false, "username" => $_COOKIE["username"]));
+               OC_Template::printGuestPage("", "login", array("error" => false, "username" => $_COOKIE["username"]));
        }else{
-               OC_TEMPLATE::printGuestPage("", "login", array("error" => false));
+               OC_Template::printGuestPage("", "login", array("error" => false));
        }
 }
 
index 7096126a52338e628197c43798366ae4d5d47b7a..4e420b5d0b2c50feb4d167d0151e14cfd307d49f 100644 (file)
@@ -70,7 +70,7 @@ class MDB2_Driver_Manager_sqlite3 extends MDB2_Driver_Manager_Common
     function createDatabase($name, $options = array())
     {
                global $SERVERROOT;
-               $datadir=OC_CONFIG::getValue( "datadirectory", "$SERVERROOT/data" );
+               $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
         $db =$this->getDBInstance();
         if (PEAR::isError($db)) {
             return $db;
index 3b74afed1466c870e48833be01c28499b8834d47..ccf6bb5368854dd66dedbe61d211fa7998ec2cc9 100644 (file)
@@ -352,7 +352,7 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common
                        return MDB2_OK;
                }
                global $SERVERROOT;
-               $datadir=OC_CONFIG::getValue( "datadirectory", "$SERVERROOT/data" );
+               $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
         $database_file = $this->_getDatabaseFile($this->database_name);
         if (is_resource($this->connection)) {
             //if (count(array_diff($this->connected_dsn, $this->dsn)) == 0
index fad0714c3f43c4054d154be79265b76743b70796..9e81ed8184eb5b4e1aae7de865957d1abfbe4923 100644 (file)
@@ -26,7 +26,7 @@
  * owncloud ecosystem. Furthermore, this class is responsible for installing,
  * upgrading and removing apps.
  */
-class OC_APP{
+class OC_App{
        static private $init = false;
        static private $apps = array();
        static private $activeapp = '';
@@ -57,7 +57,7 @@ class OC_APP{
                }
 
                // The rest comes here
-               $apps = OC_APPCONFIG::getApps();
+               $apps = OC_Appconfig::getApps();
                foreach( $apps as $app ){
                        if( self::isEnabled( $app )){
                                if(is_file($SERVERROOT.'/apps/'.$app.'/appinfo/app.php')){
@@ -80,7 +80,7 @@ class OC_APP{
         * This function checks whether or not an app is enabled.
         */
        public static function isEnabled( $app ){
-               if( 'yes' == OC_APPCONFIG::getValue( $app, 'enabled' )){
+               if( 'yes' == OC_Appconfig::getValue( $app, 'enabled' )){
                        return true;
                }
 
@@ -95,7 +95,7 @@ class OC_APP{
         * This function set an app as enabled in appconfig.
         */
        public static function enable( $app ){
-               OC_APPCONFIG::setValue( $app, 'enabled', 'yes' );
+               OC_Appconfig::setValue( $app, 'enabled', 'yes' );
        }
 
        /**
@@ -106,7 +106,7 @@ class OC_APP{
         * This function set an app as enabled in appconfig.
         */
        public static function disable( $app ){
-               OC_APPCONFIG::setValue( $app, 'enabled', 'no' );
+               OC_Appconfig::setValue( $app, 'enabled', 'no' );
        }
 
        /**
@@ -126,7 +126,7 @@ class OC_APP{
         *
         */
        public static function register( $data ){
-               OC_APP::$apps[] = $data;
+               OC_App::$apps[] = $data;
        }
 
        /**
@@ -137,7 +137,7 @@ class OC_APP{
         */
        public static function get(){
                // TODO: write function
-               return OC_APP::$apps;
+               return OC_App::$apps;
        }
 
        /**
@@ -162,7 +162,7 @@ class OC_APP{
                if(!isset($data['icon'])){
                        $data['icon']='';
                }
-               OC_APP::$navigation[] = $data;
+               OC_App::$navigation[] = $data;
                return true;
        }
 
@@ -241,7 +241,7 @@ class OC_APP{
         */
        public static function addAdminPage( $data = array()){
                // TODO: write function
-               OC_APP::$adminpages[] = $data;
+               OC_App::$adminpages[] = $data;
                return true;
        }
 
@@ -266,7 +266,7 @@ class OC_APP{
         */
        public static function addSettingsPage( $data = array()){
                // TODO: write function
-               OC_APP::$settingspages[] = $data;
+               OC_App::$settingspages[] = $data;
                return true;
        }
 
index b4735a309bc9b35084d2da3283d437116e7cb0c4..06281d385856695f057e0ad794367c6e14926a75 100644 (file)
@@ -37,7 +37,7 @@
  * This class provides an easy way for apps to store config values in the
  * database.
  */
-class OC_APPCONFIG{
+class OC_Appconfig{
        /**
         * @brief Get all apps using the config
         * @returns array with app ids
index 236b5d926a4c9f61d2f428c72a48ad7a2e20254a..5b88bd899e901ff649f41da25c21da501a9f272d 100644 (file)
@@ -70,10 +70,10 @@ if( !isset( $RUNTIME_NOAPPS )){
 // WARNING: to make everything even more confusing, DATADIRECTORY is a var that
 //   changes and DATATIRECTORY_ROOT stays the same, but is set by
 //   "datadirectory". Any questions?
-$CONFIG_DATADIRECTORY = OC_CONFIG::getValue( "datadirectory", "$SERVERROOT/data" );
+$CONFIG_DATADIRECTORY = OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
 
 // redirect to https site if configured
-if( OC_CONFIG::getValue( "forcessl", false )){
+if( OC_Config::getValue( "forcessl", false )){
        if(!isset($_SERVER['HTTPS']) or $_SERVER['HTTPS'] != 'on') {
                $url = "https://". $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
                header("Location: $url");
@@ -81,40 +81,40 @@ if( OC_CONFIG::getValue( "forcessl", false )){
        }
 }
 
-$error=(count(OC_UTIL::checkServer())>0);
+$error=(count(OC_Util::checkServer())>0);
 
 // User and Groups
-if( !OC_CONFIG::getValue( "installed", false )){
+if( !OC_Config::getValue( "installed", false )){
        $_SESSION['user_id'] = '';
 }
 
-OC_USER::useBackend( OC_CONFIG::getValue( "userbackend", "database" ));
-OC_GROUP::setBackend( OC_CONFIG::getValue( "groupbackend", "database" ));
+OC_User::useBackend( OC_Config::getValue( "userbackend", "database" ));
+OC_Group::setBackend( OC_Config::getValue( "groupbackend", "database" ));
 
 // Was in required file ... put it here
-OC_FILESYSTEM::registerStorageType('local','OC_FILESTORAGE_LOCAL',array('datadir'=>'string'));
+OC_Filesystem::registerStorageType('local','OC_Filestorage_Local',array('datadir'=>'string'));
 
 // Set up file system unless forbidden
 if(!$error and !$RUNTIME_NOSETUPFS ){
-       OC_UTIL::setupFS();
+       OC_Util::setupFS();
 }
 
 // Add the stuff we need always
-OC_UTIL::addScript( "jquery-1.6.2.min" );
-OC_UTIL::addScript( "jquery-ui-1.8.14.custom.min" );
-OC_UTIL::addScript( "js" );
-OC_UTIL::addStyle( "jquery-ui-1.8.14.custom" );
-OC_UTIL::addStyle( "styles" );
+OC_Util::addScript( "jquery-1.6.2.min" );
+OC_Util::addScript( "jquery-ui-1.8.14.custom.min" );
+OC_Util::addScript( "js" );
+OC_Util::addStyle( "jquery-ui-1.8.14.custom" );
+OC_Util::addStyle( "styles" );
 
 // Load Apps
 if(!$error and !$RUNTIME_NOAPPS ){
-       OC_APP::loadApps();
+       OC_App::loadApps();
 }
 
 // FROM Connect.php
 function OC_CONNECT_TEST($path,$user,$password){
        echo 'connecting...';
-       $remote=OC_CONNECT::connect($path,$user,$password);
+       $remote=OC_Connect::connect($path,$user,$password);
        if($remote->connected){
                echo 'done<br/>';
                if($remote->isLoggedIn()){
@@ -138,7 +138,7 @@ function OC_CONNECT_TEST($path,$user,$password){
                                                unlink($file);
                                                return;
                                        }
-                                       OC_FILESYSTEM::fromTmpFile($file,'/remoteFile');
+                                       OC_Filesystem::fromTmpFile($file,'/remoteFile');
                                        echo 'done<br/>';
                                        echo 'sending file "burning_avatar.png"...';
                                        $res=$remote->sendFile('','burning_avatar.png','','burning_avatar.png');
@@ -168,15 +168,15 @@ function zipAddDir($dir,$zip,$internalDir=''){
     $dirname=basename($dir);
     $zip->addEmptyDir($internalDir.$dirname);
     $internalDir.=$dirname.='/';
-    $files=OC_FILES::getdirectorycontent($dir);
+    $files=OC_Files::getdirectorycontent($dir);
     foreach($files as $file){
         $filename=$file['name'];
         $file=$dir.'/'.$filename;
-        if(OC_FILESYSTEM::is_file($file)){
-                       $tmpFile=OC_FILESYSTEM::toTmpFile($file);
-                       OC_FILES::$tmpFiles[]=$tmpFile;
+        if(OC_Filesystem::is_file($file)){
+                       $tmpFile=OC_Filesystem::toTmpFile($file);
+                       OC_Files::$tmpFiles[]=$tmpFile;
             $zip->addFile($tmpFile,$internalDir.$filename);
-        }elseif(OC_FILESYSTEM::is_dir($file)){
+        }elseif(OC_Filesystem::is_dir($file)){
             zipAddDir($file,$zip,$internalDir);
         }
     }
index ea3647858edb62ed2b0dc0d31e908d58c9d71e18..16e9ea441d5581776ae94e63819dd90be039681d 100644 (file)
@@ -38,7 +38,7 @@
  * This class is responsible for reading and writing config.php, the very basic
  * configuration file of owncloud.
  */
-class OC_CONFIG{
+class OC_Config{
        // associative array key => value
        private static $cache = array();
 
index c02b999ffc2b5f101d78a4057be4af592514914f..22e48750a622ba0211f0bfb63c2207cf88b92722 100644 (file)
@@ -25,7 +25,7 @@
  * Class for connecting multiply ownCloud installations
  *
  */
-class OC_CONNECT{
+class OC_Connect{
        static private $clouds=array();
 
        static function connect($path,$user,$password){
index 4e974ad821dbf44c88ff22220a4a092a98ddb550..1e87c7cee08422484a229fc2e1b93b02c43447a9 100644 (file)
@@ -23,8 +23,8 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic {
         * @return bool
         */
        protected function validateUserPass($username, $password){
-               if(OC_USER::login($username,$password)){
-                       OC_UTIL::setUpFS();
+               if(OC_User::login($username,$password)){
+                       OC_Util::setUpFS();
                        return true;
                }
                else{
index a73888ca732901bba666d230c73b21f117c9e9e6..139c6b784b1625e3a7a1a93a0a64ed94207fa6a9 100644 (file)
@@ -22,7 +22,7 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
        public function createFile($name, $data = null) {
 
                $newPath = $this->path . '/' . $name;
-               OC_FILESYSTEM::file_put_contents($newPath,$data);
+               OC_Filesystem::file_put_contents($newPath,$data);
 
        }
 
@@ -35,7 +35,7 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
        public function createDirectory($name) {
 
                $newPath = $this->path . '/' . $name;
-               OC_FILESYSTEM::mkdir($newPath);
+               OC_Filesystem::mkdir($newPath);
 
        }
 
@@ -50,9 +50,9 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
 
                $path = $this->path . '/' . $name;
 
-               if (!OC_FILESYSTEM::file_exists($path)) throw new Sabre_DAV_Exception_FileNotFound('File with name ' . $path . ' could not be located');
+               if (!OC_Filesystem::file_exists($path)) throw new Sabre_DAV_Exception_FileNotFound('File with name ' . $path . ' could not be located');
 
-               if (OC_FILESYSTEM::is_dir($path)) {
+               if (OC_Filesystem::is_dir($path)) {
 
                        return new OC_Connector_Sabre_Directory($path);
 
@@ -73,8 +73,8 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
 
                $nodes = array();
                // foreach(scandir($this->path) as $node) if($node!='.' && $node!='..') $nodes[] = $this->getChild($node);
-               if( OC_FILESYSTEM::is_dir($this->path)){
-                       $dh = OC_FILESYSTEM::opendir($this->path);
+               if( OC_Filesystem::is_dir($this->path)){
+                       $dh = OC_Filesystem::opendir($this->path);
                        while(( $node = readdir($dh)) !== false ){
                                if($node!='.' && $node!='..'){
                                        $nodes[] = $this->getChild($node);
@@ -94,7 +94,7 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
        public function childExists($name) {
 
                $path = $this->path . '/' . $name;
-               return OC_FILESYSTEM::file_exists($path);
+               return OC_Filesystem::file_exists($path);
 
        }
 
@@ -106,7 +106,7 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
        public function delete() {
 
                foreach($this->getChildren() as $child) $child->delete();
-               OC_FILESYSTEM::rmdir($this->path);
+               OC_Filesystem::rmdir($this->path);
 
        }
 
@@ -118,8 +118,8 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
        public function getQuotaInfo() {
 
                return array(
-                       OC_FILESYSTEM::filesize('/'),
-                       OC_FILESYSTEM::free_space()
+                       OC_Filesystem::filesize('/'),
+                       OC_Filesystem::free_space()
                        );
 
        }
index fb4e559aa507749fef64af9846f28b81abd15c9e..b049f39c171aa8f39f686c1d268a1e56b3730059 100644 (file)
@@ -18,7 +18,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
         */
        public function put($data) {
 
-               OC_FILESYSTEM::file_put_contents($this->path,$data);
+               OC_Filesystem::file_put_contents($this->path,$data);
 
        }
 
@@ -29,7 +29,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
         */
        public function get() {
 
-               return OC_FILESYSTEM::file_get_contents($this->path);
+               return OC_Filesystem::file_get_contents($this->path);
 
        }
 
@@ -40,7 +40,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
         */
        public function delete() {
 
-               OC_FILESYSTEM::unlink($this->path);
+               OC_Filesystem::unlink($this->path);
 
        }
 
@@ -51,7 +51,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
         */
        public function getSize() {
        
-               return OC_FILESYSTEM::filesize($this->path);
+               return OC_Filesystem::filesize($this->path);
 
        }
 
@@ -80,7 +80,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
         */
        public function getContentType() {
 
-               return OC_FILESYSTEM::getMimeType($this->path);
+               return OC_Filesystem::getMimeType($this->path);
 
        }
 }
index 9f0b983a5cc19c4ffa660b37c4a43366f5af30f1..7164d9a09c12b0fbf5dee90c33971f80abb921ad 100644 (file)
@@ -50,7 +50,7 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
                // pure sql. MySQL's non-standard string concatination prevents us
                // from doing this though.
                $query = 'SELECT * FROM *PREFIX*locks WHERE userid = ? AND (created + timeout) > ? AND ((uri = ?)';
-               $params = array(OC_USER::getUser(),time(),$uri);
+               $params = array(OC_User::getUser(),time(),$uri);
 
                // We need to check locks for every part in the uri.
                $uriParts = explode('/',$uri);
@@ -122,10 +122,10 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
        
                if ($exists) {
                        $query = OC_DB::prepare( 'UPDATE *PREFIX*locks SET owner = ?, timeout = ?, scope = ?, depth = ?, uri = ?, created = ? WHERE userid = ? AND token = ?' );
-                       $result = $query->execute( array($lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,OC_USER::getUser(),$lockInfo->token));
+                       $result = $query->execute( array($lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,OC_User::getUser(),$lockInfo->token));
                } else {
                        $query = OC_DB::prepare( 'INSERT INTO *PREFIX*locks (userid,owner,timeout,scope,depth,uri,created,token) VALUES (?,?,?,?,?,?,?,?)' );
-                       $result = $query->execute( array(OC_USER::getUser(),$lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,$lockInfo->token));
+                       $result = $query->execute( array(OC_User::getUser(),$lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,$lockInfo->token));
                }
 
                return true;
@@ -142,7 +142,7 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
        public function unlock($uri,Sabre_DAV_Locks_LockInfo $lockInfo) {
 
                $query = OC_DB::prepare( 'DELETE FROM *PREFIX*locks WHERE userid = ? AND uri=? AND token=?' );
-               $result = $query->execute( array(OC_USER::getUser(),$uri,$lockInfo->token));
+               $result = $query->execute( array(OC_User::getUser(),$uri,$lockInfo->token));
 
                return $result->numRows() === 1;
 
index 0edd9b7816185f503012ff893c12f42fcc4b47d6..ace572a1ee3511e4f293d9045245288df91f91d2 100644 (file)
@@ -70,12 +70,12 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
                $newPath = $parentPath . '/' . $newName;
                $oldPath = $this->path;
 
-               OC_FILESYSTEM::rename($this->path,$newPath);
+               OC_Filesystem::rename($this->path,$newPath);
        
                $this->path = $newPath;
                
                $query = OC_DB::prepare( 'UPDATE *PREFIX*properties SET propertypath = ? WHERE userid = ? AND propertypath = ?' );
-               $query->execute( array( $newPath,OC_USER::getUser(), $oldPath ));
+               $query->execute( array( $newPath,OC_User::getUser(), $oldPath ));
 
        }
 
@@ -88,7 +88,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
         */
        public function getLastModified() {
 
-               return OC_FILESYSTEM::filemtime($this->path);
+               return OC_Filesystem::filemtime($this->path);
 
        }
 
@@ -106,17 +106,17 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
                        if (is_null($propertyValue)) {
                                if(array_key_exists( $propertyName, $existing )){
                                        $query = OC_DB::prepare( 'DELETE FROM *PREFIX*properties WHERE userid = ? AND propertypath = ? AND propertyname = ?' );
-                                       $query->execute( array( OC_USER::getUser(), $this->path, $propertyName ));
+                                       $query->execute( array( OC_User::getUser(), $this->path, $propertyName ));
                                }
                        }
                        else {
                                if(!array_key_exists( $propertyName, $existing )){
                                        $query = OC_DB::prepare( 'INSERT INTO *PREFIX*properties (userid,propertypath,propertyname,propertyvalue) VALUES(?,?,?,?)' );
-                                       $query->execute( array( OC_USER::getUser(), $this->path, $propertyName,$propertyValue ));
+                                       $query->execute( array( OC_User::getUser(), $this->path, $propertyName,$propertyValue ));
                                }
                                else{
                                        $query = OC_DB::prepare( 'UPDATE *PREFIX*properties SET propertyvalue = ? WHERE userid = ? AND propertypath = ? AND propertyname = ?' );
-                                       $query->execute( array( $propertyValue,OC_USER::getUser(), $this->path, $propertyName ));
+                                       $query->execute( array( $propertyValue,OC_User::getUser(), $this->path, $propertyName ));
                                }
                        }
 
@@ -136,7 +136,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
        function getProperties($properties) {
                // At least some magic in here :-)
                $query = OC_DB::prepare( 'SELECT * FROM *PREFIX*properties WHERE userid = ? AND propertypath = ?' );
-               $result = $query->execute( array( OC_USER::getUser(), $this->path ));
+               $result = $query->execute( array( OC_User::getUser(), $this->path ));
 
                $existing = array();
                while( $row = $result->fetchRow()){
index f5f877176e927e40c615a9171670235350a6fa41..858db09b7643e8eab834aaf289067240678a179a 100644 (file)
@@ -38,13 +38,13 @@ class OC_DB {
         */
        static public function connect(){
                // The global data we need
-               $CONFIG_DBNAME = OC_CONFIG::getValue( "dbname", "owncloud" );;
-               $CONFIG_DBHOST = OC_CONFIG::getValue( "dbhost", "" );;
-               $CONFIG_DBUSER = OC_CONFIG::getValue( "dbuser", "" );;
-               $CONFIG_DBPASSWORD = OC_CONFIG::getValue( "dbpassword", "" );;
-               $CONFIG_DBTYPE = OC_CONFIG::getValue( "dbtype", "sqlite" );;
+               $CONFIG_DBNAME = OC_Config::getValue( "dbname", "owncloud" );;
+               $CONFIG_DBHOST = OC_Config::getValue( "dbhost", "" );;
+               $CONFIG_DBUSER = OC_Config::getValue( "dbuser", "" );;
+               $CONFIG_DBPASSWORD = OC_Config::getValue( "dbpassword", "" );;
+               $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );;
                global $SERVERROOT;
-               $datadir=OC_CONFIG::getValue( "datadirectory", "$SERVERROOT/data" );
+               $datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
 
                // do nothing if the connection already has been established
                if(!self::$DBConnection){
@@ -235,8 +235,8 @@ class OC_DB {
         * TODO: write more documentation
         */
        public static function createDbFromStructure( $file ){
-               $CONFIG_DBNAME  = OC_CONFIG::getValue( "dbname", "owncloud" );
-               $CONFIG_DBTABLEPREFIX = OC_CONFIG::getValue( "dbtableprefix", "oc_" );
+               $CONFIG_DBNAME  = OC_Config::getValue( "dbname", "owncloud" );
+               $CONFIG_DBTABLEPREFIX = OC_Config::getValue( "dbtableprefix", "oc_" );
 
                self::connectScheme();
 
@@ -259,7 +259,7 @@ class OC_DB {
                if( $definition instanceof MDB2_Schema_Error ){
                        die( $definition->getMessage().': '.$definition->getUserInfo());
                }
-//             if(OC_CONFIG::getValue('dbtype','sqlite')=='sqlite'){
+//             if(OC_Config::getValue('dbtype','sqlite')=='sqlite'){
 //                     $definition['overwrite']=true;//always overwrite for sqlite
 //             }
                $ret=self::$schema->createDatabase( $definition );
@@ -302,8 +302,8 @@ class OC_DB {
        private static function processQuery( $query ){
                self::connect();
                // We need Database type and table prefix
-               $CONFIG_DBTYPE = OC_CONFIG::getValue( "dbtype", "sqlite" );
-               $CONFIG_DBTABLEPREFIX = OC_CONFIG::getValue( "dbtableprefix", "oc_" );
+               $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
+               $CONFIG_DBTABLEPREFIX = OC_Config::getValue( "dbtableprefix", "oc_" );
                
                // differences is getting the current timestamp
                $query = str_replace( 'NOW()', self::$DBConnection->now(), $query );
@@ -339,8 +339,8 @@ class OC_DB {
         * @param string $file the xml file describing the tables
         */
        public static function removeDBStructure($file){
-               $CONFIG_DBNAME  = OC_CONFIG::getValue( "dbname", "owncloud" );
-               $CONFIG_DBTABLEPREFIX = OC_CONFIG::getValue( "dbtableprefix", "oc_" );
+               $CONFIG_DBNAME  = OC_Config::getValue( "dbname", "owncloud" );
+               $CONFIG_DBTABLEPREFIX = OC_Config::getValue( "dbtableprefix", "oc_" );
                self::connectScheme();
 
                // read file
index 03e159f9bee8d567c180300900e1a60ee63f4cd7..d189a96fd8907319c37d3942596d9fc8fe0eabf7 100644 (file)
@@ -25,7 +25,7 @@
  * Class for fileserver access
  *
  */
-class OC_FILES {
+class OC_Files {
        static $tmpFiles=array();
 
        /**
@@ -42,21 +42,21 @@ class OC_FILES {
                $dirs=array();
                $file=array();
                $files=array();
-               if(OC_FILESYSTEM::is_dir($directory)) {
-                       if ($dh = OC_FILESYSTEM::opendir($directory)) {
+               if(OC_Filesystem::is_dir($directory)) {
+                       if ($dh = OC_Filesystem::opendir($directory)) {
                        while (($filename = readdir($dh)) !== false) {
                                if($filename<>'.' and $filename<>'..' and substr($filename,0,1)!='.'){
                                        $file=array();
                                        $filesfound=true;
                                        $file['name']=$filename;
                                        $file['directory']=$directory;
-                                       $stat=OC_FILESYSTEM::stat($directory.'/'.$filename);
+                                       $stat=OC_Filesystem::stat($directory.'/'.$filename);
                                        $file=array_merge($file,$stat);
-                                       $file['size']=OC_FILESYSTEM::filesize($directory.'/'.$filename);
-                                       $file['mime']=OC_FILES::getMimeType($directory .'/'. $filename);
-                                       $file['readable']=OC_FILESYSTEM::is_readable($directory .'/'. $filename);
-                                       $file['writeable']=OC_FILESYSTEM::is_writeable($directory .'/'. $filename);
-                                       $file['type']=OC_FILESYSTEM::filetype($directory .'/'. $filename);
+                                       $file['size']=OC_Filesystem::filesize($directory.'/'.$filename);
+                                       $file['mime']=OC_Files::getMimeType($directory .'/'. $filename);
+                                       $file['readable']=OC_Filesystem::is_readable($directory .'/'. $filename);
+                                       $file['writeable']=OC_Filesystem::is_writeable($directory .'/'. $filename);
+                                       $file['type']=OC_Filesystem::filetype($directory .'/'. $filename);
                                        if($file['type']=='dir'){
                                                $dirs[$file['name']]=$file;
                                        }else{
@@ -98,16 +98,16 @@ class OC_FILES {
                        }
                        foreach($files as $file){
                                $file=$dir.'/'.$file;
-                               if(OC_FILESYSTEM::is_file($file)){
-                                       $tmpFile=OC_FILESYSTEM::toTmpFile($file);
+                               if(OC_Filesystem::is_file($file)){
+                                       $tmpFile=OC_Filesystem::toTmpFile($file);
                                        self::$tmpFiles[]=$tmpFile;
                                        $zip->addFile($tmpFile,basename($file));
-                               }elseif(OC_FILESYSTEM::is_dir($file)){
+                               }elseif(OC_Filesystem::is_dir($file)){
                                        zipAddDir($file,$zip);
                                }
                        }
                        $zip->close();
-               }elseif(OC_FILESYSTEM::is_dir($dir.'/'.$files)){
+               }elseif(OC_Filesystem::is_dir($dir.'/'.$files)){
                        $zip = new ZipArchive();
                        $filename = sys_get_temp_dir()."/ownCloud.zip";
                        if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
@@ -120,7 +120,7 @@ class OC_FILES {
                        $zip=false;
                        $filename=$dir.'/'.$files;
                }
-               if($zip or OC_FILESYSTEM::is_readable($filename)){
+               if($zip or OC_Filesystem::is_readable($filename)){
                        header('Content-Disposition: attachment; filename='.basename($filename));
                        header('Content-Transfer-Encoding: binary');
                        header('Expires: 0');
@@ -130,12 +130,12 @@ class OC_FILES {
                                header('Content-Type: application/zip');
                                header('Content-Length: ' . filesize($filename));
                        }else{
-                               header('Content-Type: ' . OC_FILESYSTEM::getMimeType($filename));
-                               header('Content-Length: ' . OC_FILESYSTEM::filesize($filename));
+                               header('Content-Type: ' . OC_Filesystem::getMimeType($filename));
+                               header('Content-Length: ' . OC_Filesystem::filesize($filename));
                        }
-               }elseif($zip or !OC_FILESYSTEM::file_exists($filename)){
+               }elseif($zip or !OC_Filesystem::file_exists($filename)){
                        header("HTTP/1.0 404 Not Found");
-                       $tmpl = new OC_TEMPLATE( '', '404', 'guest' );
+                       $tmpl = new OC_Template( '', '404', 'guest' );
                        $tmpl->assign('file',$filename);
                        $tmpl->printPage();
 //                     die('404 Not Found');
@@ -144,12 +144,12 @@ class OC_FILES {
                        die('403 Forbidden');
                }
                ob_end_clean();
-//             OC_LOG::event($_SESSION['username'],3,"$dir/$files");
+//             OC_Log::event($_SESSION['username'],3,"$dir/$files");
                if($zip){
                        readfile($filename);
                        unlink($filename);
                }else{
-                       OC_FILESYSTEM::readfile($filename);
+                       OC_Filesystem::readfile($filename);
                }
                foreach(self::$tmpFiles as $tmpFile){
                        if(file_exists($tmpFile) and is_file($tmpFile)){
@@ -167,10 +167,10 @@ class OC_FILES {
        * @param file $target
        */
        public static function move($sourceDir,$source,$targetDir,$target){
-               if(OC_USER::isLoggedIn()){
+               if(OC_User::isLoggedIn()){
                        $targetFile=$targetDir.'/'.$target;
                        $sourceFile=$sourceDir.'/'.$source;
-                       return OC_FILESYSTEM::rename($sourceFile,$targetFile);
+                       return OC_Filesystem::rename($sourceFile,$targetFile);
                }
        }
 
@@ -183,10 +183,10 @@ class OC_FILES {
        * @param file $target
        */
        public static function copy($sourceDir,$source,$targetDir,$target){
-               if(OC_USER::isLoggedIn()){
+               if(OC_User::isLoggedIn()){
                        $targetFile=$targetDir.'/'.$target;
                        $sourceFile=$sourceDir.'/'.$source;
-                       return OC_FILESYSTEM::copy($sourceFile,$targetFile);
+                       return OC_Filesystem::copy($sourceFile,$targetFile);
                }
        }
 
@@ -198,15 +198,15 @@ class OC_FILES {
        * @param type $type
        */
        public static function newFile($dir,$name,$type){
-               if(OC_USER::isLoggedIn()){
+               if(OC_User::isLoggedIn()){
                        $file=$dir.'/'.$name;
                        if($type=='dir'){
-                               return OC_FILESYSTEM::mkdir($file);
+                               return OC_Filesystem::mkdir($file);
                        }elseif($type=='file'){
-                               $fileHandle=OC_FILESYSTEM::fopen($file, 'w');
+                               $fileHandle=OC_Filesystem::fopen($file, 'w');
                                if($fileHandle){
                                        fclose($fileHandle);
-//                                     OC_LOG::event($_SESSION['username'],4,"$dir/$name");
+//                                     OC_Log::event($_SESSION['username'],4,"$dir/$name");
                                        return true;
                                }else{
                                        return false;
@@ -222,12 +222,12 @@ class OC_FILES {
        * @param file $name
        */
        public static function delete($dir,$file){
-               if(OC_USER::isLoggedIn()){
+               if(OC_User::isLoggedIn()){
                        $file=$dir.'/'.$file;
-                       if(OC_FILESYSTEM::is_file($file)){
-                               return OC_FILESYSTEM::unlink($file);
-                       }elseif(OC_FILESYSTEM::is_dir($file)){
-                               return OC_FILESYSTEM::delTree($file);
+                       if(OC_Filesystem::is_file($file)){
+                               return OC_Filesystem::unlink($file);
+                       }elseif(OC_Filesystem::is_dir($file)){
+                               return OC_Filesystem::delTree($file);
                        }
                }
        }
@@ -239,7 +239,7 @@ class OC_FILES {
        * @return string  guessed mime type
        */
        static function getMimeType($path){
-               return OC_FILESYSTEM::getMimeType($path);
+               return OC_Filesystem::getMimeType($path);
        }
 
        /**
@@ -249,7 +249,7 @@ class OC_FILES {
        * @return array
        */
        static function getTree($path){
-               return OC_FILESYSTEM::getTree($path);
+               return OC_Filesystem::getTree($path);
        }
 
        /**
@@ -273,7 +273,7 @@ class OC_FILES {
                $httpCode=$info['http_code'];
                curl_close($ch);
                if($httpCode==200 or $httpCode==0){
-                       OC_FILESYSTEM::fromTmpFile($tmpfile,$dir.'/'.$file);
+                       OC_Filesystem::fromTmpFile($tmpfile,$dir.'/'.$file);
                        return true;
                }else{
                        return false;
@@ -287,7 +287,7 @@ class OC_FILES {
        static function setUploadLimit($size){
                global $SERVERROOT;
                global $WEBROOT;
-               $size=OC_HELPER::humanFileSize($size);
+               $size=OC_Helper::humanFileSize($size);
                $size=substr($size,0,-1);//strip the B
                $size=str_replace(' ','',$size); //remove the space between the size and the postfix
                $content = "ErrorDocument 404 /$WEBROOT/core/templates/404.php\n";//custom 404 error page
index ba1a4b295aa3cb5fd548dfb2be3e24ac5cdc53ab..b398285d3406f72528ea7e05385fe207d978ed5f 100644 (file)
@@ -23,7 +23,7 @@
 /**
  * Privde a common interface to all different storage options
  */
-class OC_FILESTORAGE{
+class OC_Filestorage{
        public function __construct($parameters){}
        public function mkdir($path){}
        public function rmdir($path){}
index fd3f043de3b8e18d9cf580c9a238fef8b12bb80b..3bbdd6b41377f388e1d3040f07b681bf1afa07f8 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * for local filestore, we only have to map the paths
  */
-class OC_FILESTORAGE_LOCAL extends OC_FILESTORAGE{
+class OC_Filestorage_Local extends OC_Filestorage{
        private $datadir;
        private static $mimetypes=null;
        public function __construct($arguments){
@@ -138,7 +138,7 @@ class OC_FILESTORAGE_LOCAL extends OC_FILESTORAGE{
                        } else if (function_exists("mime_content_type")) {
                                // use mime magic extension if available
                                $mime_type = mime_content_type($this->datadir.$fspath);
-                       } else if (OC_HELPER::canExecute("file")) {
+                       } else if (OC_Helper::canExecute("file")) {
                                // it looks like we have a 'file' command,
                                // lets see it it does have mime support
                                $fp = popen("file -i -b '{$this->datadir}$fspath' 2>/dev/null", "r");
index 74234f4d8dbbc0b3f05b168c715f83c690c411a8..fb14c4121a2d633951dc4a7149f3ebbd00582292 100644 (file)
@@ -21,7 +21,7 @@
 * 
 */
 
-class OC_FILESTORAGE_REMOTE extends OC_FILESTORAGE{
+class OC_Filestorage_Remote extends OC_Filestorage{
        private $url;
        private $username;
        private $password;
@@ -45,7 +45,7 @@ class OC_FILESTORAGE_REMOTE extends OC_FILESTORAGE{
        }
        private function connect(){
                if($this->remote===false){
-                       $this->remote=OC_CONNECT::connect($this->url,$this->username,$this->password);
+                       $this->remote=OC_Connect::connect($this->url,$this->username,$this->password);
                }
        }
        public function mkdir($path){
index d44416cf9cbec5118ca31a22dcfadbe22910b46b..6022aa585ba1df9b8072d9be13f9367ddea88b7a 100644 (file)
@@ -24,7 +24,7 @@
 
 /**
  * Class for abstraction of filesystem functions
- * This class won't call any filesystem functions for itself but but will pass them to the correct OC_FILESTORAGE object
+ * This class won't call any filesystem functions for itself but but will pass them to the correct OC_Filestorage object
  * this class should also handle all the file premission related stuff
  *
  * Hooks provided:
@@ -42,7 +42,7 @@
  *
  *   the &run parameter can be set to false to prevent the operation from occuring
  */
-class OC_FILESYSTEM{
+class OC_Filesystem{
        static private $storages=array();
        static private $fakeRoot='';
        static private $storageTypes=array();
@@ -89,7 +89,7 @@ class OC_FILESYSTEM{
        * create a new storage of a specific type
        * @param  string  type
        * @param  array  arguments
-       * @return OC_FILESTORAGE
+       * @return OC_Filestorage
        */
        static public function createStorage($type,$arguments){
                if(!self::hasStorageType($type)){
@@ -159,8 +159,8 @@ class OC_FILESYSTEM{
        }
        
        /**
-       * mount an OC_FILESTORAGE in our virtual filesystem
-       * @param OC_FILESTORAGE storage
+       * mount an OC_Filestorage in our virtual filesystem
+       * @param OC_Filestorage storage
        * @param string mountpoint
        */
        static public function mount($storage,$mountpoint){
@@ -173,7 +173,7 @@ class OC_FILESYSTEM{
        /**
        * get the storage object for a path
        * @param string path
-       * @return OC_FILESTORAGE
+       * @return OC_Filestorage
        */
        static private function getStorage($path){
                $mountpoint=self::getMountPoint($path);
@@ -231,14 +231,14 @@ class OC_FILESYSTEM{
                $parent=substr($path,0,strrpos($path,'/'));
                if(self::canWrite($parent) and $storage=self::getStorage($path)){
                        $run=true;
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'create', array( 'path' => $path, 'run' => &$run));
+                       OC_Hook::emit( 'OC_Filesystem', 'create', array( 'path' => $path, 'run' => &$run));
                        if($run){
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'write', array( 'path' => $path, 'run' => &$run));
+                               OC_Hook::emit( 'OC_Filesystem', 'write', array( 'path' => $path, 'run' => &$run));
                        }
                        if($run){
                                $result=$storage->mkdir(self::getInternalPath($path));
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'post_create', array( 'path' => $path));
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'post_write', array( 'path' => $path));
+                               OC_Hook::emit( 'OC_Filesystem', 'post_create', array( 'path' => $path));
+                               OC_Hook::emit( 'OC_Filesystem', 'post_write', array( 'path' => $path));
                                return $result;
                        }
                }
@@ -246,17 +246,17 @@ class OC_FILESYSTEM{
        static public function rmdir($path){
                if(self::canWrite($path) and $storage=self::getStorage($path)){
                        $run=true;
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'delete', array( 'path' => $path, 'run' => &$run));
+                       OC_Hook::emit( 'OC_Filesystem', 'delete', array( 'path' => $path, 'run' => &$run));
                        if($run){
                                $result=$storage->rmdir(self::getInternalPath($path));
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'post_delete', array( 'path' => $path));
+                               OC_Hook::emit( 'OC_Filesystem', 'post_delete', array( 'path' => $path));
                                return $result;
                        }
                }
        }
        static public function opendir($path){
                if(self::canRead($path) and $storage=self::getStorage($path)){
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'read', array( 'path' => $path));
+                       OC_Hook::emit( 'OC_Filesystem', 'read', array( 'path' => $path));
                        return $storage->opendir(self::getInternalPath($path));
                }
        }
@@ -293,7 +293,7 @@ class OC_FILESYSTEM{
        }
        static public function readfile($path){
                if(self::canRead($path) and $storage=self::getStorage($path)){
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'read', array( 'path' => $path));
+                       OC_Hook::emit( 'OC_Filesystem', 'read', array( 'path' => $path));
                        return $storage->readfile(self::getInternalPath($path));
                }
        }
@@ -335,7 +335,7 @@ class OC_FILESYSTEM{
        }
        static public function file_get_contents($path){
                if(self::canRead($path) and $storage=self::getStorage($path)){
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'read', array( 'path' => $path));
+                       OC_Hook::emit( 'OC_Filesystem', 'read', array( 'path' => $path));
                        return $storage->file_get_contents(self::getInternalPath($path));
                }
        }
@@ -344,17 +344,17 @@ class OC_FILESYSTEM{
                        $run=true;
                        $exists=self::file_exists($path);
                        if(!$exists){
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'create', array( 'path' => $path, 'run' => &$run));
+                               OC_Hook::emit( 'OC_Filesystem', 'create', array( 'path' => $path, 'run' => &$run));
                        }
                        if($run){
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'write', array( 'path' => $path, 'run' => &$run));
+                               OC_Hook::emit( 'OC_Filesystem', 'write', array( 'path' => $path, 'run' => &$run));
                        }
                        if($run){
                                $result=$storage->file_put_contents(self::getInternalPath($path),$data);
                                if(!$exists){
-                                       OC_HOOK::emit( 'OC_FILESYSTEM', 'post_create', array( 'path' => $path));
+                                       OC_Hook::emit( 'OC_Filesystem', 'post_create', array( 'path' => $path));
                                }
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'post_write', array( 'path' => $path));
+                               OC_Hook::emit( 'OC_Filesystem', 'post_write', array( 'path' => $path));
                                return $result;
                        }
                }
@@ -362,10 +362,10 @@ class OC_FILESYSTEM{
        static public function unlink($path){
                if(self::canWrite($path) and $storage=self::getStorage($path)){
                        $run=true;
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'delete', array( 'path' => $path, 'run' => &$run));
+                       OC_Hook::emit( 'OC_Filesystem', 'delete', array( 'path' => $path, 'run' => &$run));
                        if($run){
                                $result=$storage->unlink(self::getInternalPath($path));
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'post_delete', array( 'path' => $path));
+                               OC_Hook::emit( 'OC_Filesystem', 'post_delete', array( 'path' => $path));
                                return $result;
                        }
                }
@@ -373,7 +373,7 @@ class OC_FILESYSTEM{
        static public function rename($path1,$path2){
                if(self::canWrite($path1) and self::canWrite($path2)){
                        $run=true;
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'rename', array( 'oldpath' => $path1 ,'newpath'=>$path2, 'run' => &$run));
+                       OC_Hook::emit( 'OC_Filesystem', 'rename', array( 'oldpath' => $path1 ,'newpath'=>$path2, 'run' => &$run));
                        if($run){
                                $mp1=self::getMountPoint($path1);
                                $mp2=self::getMountPoint($path2);
@@ -386,7 +386,7 @@ class OC_FILESYSTEM{
                                        $result=$storage2->fromTmpFile($tmpFile,self::getInternalPath($path2));
                                        $storage1->unlink(self::getInternalPath($path1));
                                }
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'post_rename', array( 'oldpath' => $path1, 'newpath'=>$path2));
+                               OC_Hook::emit( 'OC_Filesystem', 'post_rename', array( 'oldpath' => $path1, 'newpath'=>$path2));
                                return $result;
                        }
                }
@@ -394,13 +394,13 @@ class OC_FILESYSTEM{
        static public function copy($path1,$path2){
                if(self::canRead($path1) and self::canWrite($path2)){
                        $run=true;
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'copy', array( 'oldpath' => $path1 ,'newpath'=>$path2, 'run' => &$run));
+                       OC_Hook::emit( 'OC_Filesystem', 'copy', array( 'oldpath' => $path1 ,'newpath'=>$path2, 'run' => &$run));
                        $exists=self::file_exists($path2);
                        if($run and !$exists){
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'create', array( 'path' => $path2, 'run' => &$run));
+                               OC_Hook::emit( 'OC_Filesystem', 'create', array( 'path' => $path2, 'run' => &$run));
                        }
                        if($run){
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'write', array( 'path' => $path2, 'run' => &$run));
+                               OC_Hook::emit( 'OC_Filesystem', 'write', array( 'path' => $path2, 'run' => &$run));
                        }
                        if($run){
                                $mp1=self::getMountPoint($path1);
@@ -413,11 +413,11 @@ class OC_FILESYSTEM{
                                        $tmpFile=$storage1->toTmpFile(self::getInternalPath($path1));
                                        $result=$storage2->fromTmpFile($tmpFile,self::getInternalPath($path2));
                                }
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'post_copy', array( 'oldpath' => $path1 ,'newpath'=>$path2));
+                               OC_Hook::emit( 'OC_Filesystem', 'post_copy', array( 'oldpath' => $path1 ,'newpath'=>$path2));
                                if(!$exists){
-                                       OC_HOOK::emit( 'OC_FILESYSTEM', 'post_create', array( 'path' => $path2));
+                                       OC_Hook::emit( 'OC_Filesystem', 'post_create', array( 'path' => $path2));
                                }
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'post_write', array( 'path' => $path2));
+                               OC_Hook::emit( 'OC_Filesystem', 'post_write', array( 'path' => $path2));
                                return $result;
                        }
                }
@@ -431,13 +431,13 @@ class OC_FILESYSTEM{
                                $write=false;
                                switch($mode){
                                        case 'r':
-                                               OC_HOOK::emit( 'OC_FILESYSTEM', 'read', array( 'path' => $path));
+                                               OC_Hook::emit( 'OC_Filesystem', 'read', array( 'path' => $path));
                                                break;
                                        case 'r+':
                                        case 'w+':
                                        case 'x+':
                                        case 'a+':
-                                               OC_HOOK::emit( 'OC_FILESYSTEM', 'read', array( 'path' => $path));
+                                               OC_Hook::emit( 'OC_Filesystem', 'read', array( 'path' => $path));
                                                $write=true;
                                                break;
                                        case 'w':
@@ -448,20 +448,20 @@ class OC_FILESYSTEM{
                                }
                                if($write){
                                        if(!$exists){
-                                               OC_HOOK::emit( 'OC_FILESYSTEM', 'create', array( 'path' => $path));
+                                               OC_Hook::emit( 'OC_Filesystem', 'create', array( 'path' => $path));
                                        }
                                        if($run){
-                                               OC_HOOK::emit( 'OC_FILESYSTEM', 'write', array( 'path' => $path, 'run' => &$run));
+                                               OC_Hook::emit( 'OC_Filesystem', 'write', array( 'path' => $path, 'run' => &$run));
                                        }
                                }
                                if($run){
                                        $result=$storage->fopen(self::getInternalPath($path),$mode);
                                        if($write){
                                                if(!$exists){
-                                                       OC_HOOK::emit( 'OC_FILESYSTEM', 'post_create', array( 'path' => $path));
+                                                       OC_Hook::emit( 'OC_Filesystem', 'post_create', array( 'path' => $path));
                                                }
                                                if($run){
-                                                       OC_HOOK::emit( 'OC_FILESYSTEM', 'post_write', array( 'path' => $path));
+                                                       OC_Hook::emit( 'OC_Filesystem', 'post_write', array( 'path' => $path));
                                                }
                                        }
                                        return $result;
@@ -471,7 +471,7 @@ class OC_FILESYSTEM{
        }
        static public function toTmpFile($path){
                if(self::canRead($path) and $storage=self::getStorage($path)){
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'read', array( 'path' => $path));
+                       OC_Hook::emit( 'OC_Filesystem', 'read', array( 'path' => $path));
                        return $storage->toTmpFile(self::getInternalPath($path));
                }
        }
@@ -480,17 +480,17 @@ class OC_FILESYSTEM{
                        $run=true;
                        $exists=self::file_exists($path);
                        if(!$exists){
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'create', array( 'path' => $path, 'run' => &$run));
+                               OC_Hook::emit( 'OC_Filesystem', 'create', array( 'path' => $path, 'run' => &$run));
                        }
                        if($run){
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'write', array( 'path' => $path, 'run' => &$run));
+                               OC_Hook::emit( 'OC_Filesystem', 'write', array( 'path' => $path, 'run' => &$run));
                        }
                        if($run){
                                $result=$storage->fromTmpFile($tmpFile,self::getInternalPath($path));
                                if(!$exists){
-                                       OC_HOOK::emit( 'OC_FILESYSTEM', 'post_create', array( 'path' => $path));
+                                       OC_Hook::emit( 'OC_Filesystem', 'post_create', array( 'path' => $path));
                                }
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'post_write', array( 'path' => $path));
+                               OC_Hook::emit( 'OC_Filesystem', 'post_write', array( 'path' => $path));
                                return $result;
                        }
                }
@@ -501,18 +501,18 @@ class OC_FILESYSTEM{
                        $run=true;
                        $exists=self::file_exists($path);
                        if(!$exists){
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'create', array( 'path' => $path, 'run' => &$run));
+                               OC_Hook::emit( 'OC_Filesystem', 'create', array( 'path' => $path, 'run' => &$run));
                        }
                        if($run){
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'write', array( 'path' => $path, 'run' => &$run));
+                               OC_Hook::emit( 'OC_Filesystem', 'write', array( 'path' => $path, 'run' => &$run));
                        }
                        error_log('upload2');
                        if($run){
                                $result=$storage->fromUploadedFile($tmpFile,self::getInternalPath($path));
                                if(!$exists){
-                                       OC_HOOK::emit( 'OC_FILESYSTEM', 'post_create', array( 'path' => $path));
+                                       OC_Hook::emit( 'OC_Filesystem', 'post_create', array( 'path' => $path));
                                }
-                               OC_HOOK::emit( 'OC_FILESYSTEM', 'post_write', array( 'path' => $path));
+                               OC_Hook::emit( 'OC_Filesystem', 'post_write', array( 'path' => $path));
                                return $result;
                        }
                }
@@ -525,7 +525,7 @@ class OC_FILESYSTEM{
        static public function delTree($path){
                if(self::canWrite($path) and $storage=self::getStorage($path)){
                        $run=true;
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'delete', array( 'path' => $path, 'run' => &$run));
+                       OC_Hook::emit( 'OC_Filesystem', 'delete', array( 'path' => $path, 'run' => &$run));
                        if($run){
                                return $storage->delTree(self::getInternalPath($path));
                        }
@@ -560,7 +560,7 @@ class OC_FILESYSTEM{
        }
        static public function hash($type,$path,$raw=false){
                if(self::canRead($path) and $storage=self::getStorage($path)){
-                       OC_HOOK::emit( 'OC_FILESYSTEM', 'read', array( 'path' => $path));
+                       OC_Hook::emit( 'OC_Filesystem', 'read', array( 'path' => $path));
                        return $storage->hash($type,self::getInternalPath($path),$raw);
                }
        }
index 71caaee613263b27882a64b4b121629750ca65ae..1161b9035fa43237327a5953b5c9f233a1732f98 100644 (file)
@@ -33,7 +33,7 @@
  *   pre_removeFromGroup(&run, uid, gid)
  *   post_removeFromGroup(uid, gid)
  */
-class OC_GROUP {
+class OC_Group {
        // The backend used for user management
        private static $_backend;
 
@@ -78,7 +78,7 @@ class OC_GROUP {
                        case 'database':
                        case 'mysql':
                        case 'sqlite':
-                               self::$_backend = new OC_GROUP_DATABASE();
+                               self::$_backend = new OC_Group_Database();
                                break;
                        default:
                                $className = 'OC_GROUP_' . strToUpper($backend);
@@ -113,10 +113,10 @@ class OC_GROUP {
                }
 
                $run = true;
-               OC_HOOK::emit( "OC_GROUP", "pre_createGroup", array( "run" => &$run, "gid" => $gid ));
+               OC_Hook::emit( "OC_Group", "pre_createGroup", array( "run" => &$run, "gid" => $gid ));
 
                if( $run && self::$_backend->createGroup( $gid )){
-                       OC_HOOK::emit( "OC_GROUP", "post_createGroup", array( "gid" => $gid ));
+                       OC_Hook::emit( "OC_Group", "post_createGroup", array( "gid" => $gid ));
                        return true;
                }
                else{
@@ -138,10 +138,10 @@ class OC_GROUP {
                }
 
                $run = true;
-               OC_HOOK::emit( "OC_GROUP", "pre_deleteGroup", array( "run" => &$run, "gid" => $gid ));
+               OC_Hook::emit( "OC_Group", "pre_deleteGroup", array( "run" => &$run, "gid" => $gid ));
 
                if( $run && self::$_backend->deleteGroup( $gid )){
-                       OC_HOOK::emit( "OC_GROUP", "post_deleteGroup", array( "gid" => $gid ));
+                       OC_Hook::emit( "OC_Group", "post_deleteGroup", array( "gid" => $gid ));
                        return true;
                }
                else{
@@ -171,7 +171,7 @@ class OC_GROUP {
         */
        public static function addToGroup( $uid, $gid ){
                // Does the user exist?
-               if( !in_array( $uid, OC_USER::getUsers())){
+               if( !in_array( $uid, OC_User::getUsers())){
                        return false;
                }
                // Does the group exist?
@@ -181,10 +181,10 @@ class OC_GROUP {
 
                // Go go go
                $run = true;
-               OC_HOOK::emit( "OC_GROUP", "pre_addToGroup", array( "run" => &$run, "uid" => $uid, "gid" => $gid ));
+               OC_Hook::emit( "OC_Group", "pre_addToGroup", array( "run" => &$run, "uid" => $uid, "gid" => $gid ));
 
                if( $run && self::$_backend->addToGroup( $uid, $gid )){
-                       OC_HOOK::emit( "OC_GROUP", "post_addToGroup", array( "uid" => $uid, "gid" => $gid ));
+                       OC_Hook::emit( "OC_Group", "post_addToGroup", array( "uid" => $uid, "gid" => $gid ));
                        return true;
                }
                else{
@@ -202,10 +202,10 @@ class OC_GROUP {
         */
        public static function removeFromGroup( $uid, $gid ){
                $run = true;
-               OC_HOOK::emit( "OC_GROUP", "pre_removeFromGroup", array( "run" => &$run, "uid" => $uid, "gid" => $gid ));
+               OC_Hook::emit( "OC_Group", "pre_removeFromGroup", array( "run" => &$run, "uid" => $uid, "gid" => $gid ));
 
                if( $run && self::$_backend->removeFromGroup( $uid, $gid )){
-                       OC_HOOK::emit( "OC_GROUP", "post_removeFromGroup", array( "uid" => $uid, "gid" => $gid ));
+                       OC_Hook::emit( "OC_Group", "post_removeFromGroup", array( "uid" => $uid, "gid" => $gid ));
                        return true;
                }
                else{
index 298cced7ff51a5ab148f3e4bac58839954456d71..ebee8aacb91b4b36028ffa185291407794987515 100644 (file)
@@ -26,7 +26,7 @@
 /**
  * Abstract base class for user management
  */
-abstract class OC_GROUP_BACKEND {
+abstract class OC_Group_Backend {
        /**
         * @brief Try to create a new group
         * @param $gid The name of the group to create
index 8c04ca5d36bdda03d42da5999b7063c122574c95..6ca80b93985f059e7fd5551c017fc7a1fa79e25c 100644 (file)
@@ -40,7 +40,7 @@
 /**
  * Class for group management in a SQL Database (e.g. MySQL, SQLite)
  */
-class OC_GROUP_DATABASE extends OC_GROUP_BACKEND {
+class OC_Group_Database extends OC_Group_Backend {
        static private $userGroupCache=array();
 
        /**
index b976705a7cf45865d0c5467fbfe824b871cc71e0..5dc3dd44a15d7e7b874ede948a539b1ac75c4e67 100755 (executable)
@@ -24,7 +24,7 @@
 /**
  * Collection of useful functions
  */
-class OC_HELPER {
+class OC_Helper {
        /**
         * @brief Creates an url
         * @param $app app
index 08b6d5e8b6b8d191cf848d47f1872f5468880c92..b069a7da6c0f36988fb270b4935107190025cc97 100644 (file)
@@ -4,7 +4,7 @@
  * This class manages the hooks. It basically provides two functions: adding
  * slots and emitting signals.
  */
-class OC_HOOK{
+class OC_Hook{
        static private $registered = array();
 
        /**
index a237caa0983f203df4393f4b76d22ee91f682c77..e25f9d9c4ce8a24e1a3f698491262d75bc62936d 100644 (file)
@@ -23,7 +23,7 @@
 /**
  * This class provides the functionality needed to install, update and remove plugins/apps
  */
-class OC_INSTALLER{
+class OC_Installer{
        /**
         * @brief Installs an app
         * @param $data array with all information
@@ -88,7 +88,7 @@ class OC_INSTALLER{
                        $zip->close();
                } else {
                        error_log("Failed to open archive when installing app");
-                       OC_HELPER::rmdirr($extractDir);
+                       OC_Helper::rmdirr($extractDir);
                        if($data['source']=='http'){
                                unlink($path);
                        }
@@ -98,19 +98,19 @@ class OC_INSTALLER{
                //load the info.xml file of the app
                if(!is_file($extractDir.'/appinfo/info.xml')){
                        error_log("App does not provide an info.xml file");
-                       OC_HELPER::rmdirr($extractDir);
+                       OC_Helper::rmdirr($extractDir);
                        if($data['source']=='http'){
                                unlink($path);
                        }
                        return false;
                }
-               $info=OC_APP::getAppInfo($extractDir.'/appinfo/info.xml');
+               $info=OC_App::getAppInfo($extractDir.'/appinfo/info.xml');
                $basedir=$SERVERROOT.'/apps/'.$info['id'];
                
                //check if an app with the same id is already installed
                if(self::isInstalled( $info['id'] )){
                        error_log("App already installed");
-                       OC_HELPER::rmdirr($extractDir);
+                       OC_Helper::rmdirr($extractDir);
                        if($data['source']=='http'){
                                unlink($path);
                        }
@@ -120,7 +120,7 @@ class OC_INSTALLER{
                //check if the destination directory already exists
                if(is_dir($basedir)){
                        error_log("App's directory already exists");
-                       OC_HELPER::rmdirr($extractDir);
+                       OC_Helper::rmdirr($extractDir);
                        if($data['source']=='http'){
                                unlink($path);
                        }
@@ -134,16 +134,16 @@ class OC_INSTALLER{
                //copy the app to the correct place
                if(!mkdir($basedir)){
                        error_log('Can\'t create app folder ('.$basedir.')');
-                       OC_HELPER::rmdirr($extractDir);
+                       OC_Helper::rmdirr($extractDir);
                        if($data['source']=='http'){
                                unlink($path);
                        }
                        return false;
                }
-               OC_HELPER::copyr($extractDir,$basedir);
+               OC_Helper::copyr($extractDir,$basedir);
                
                //remove temporary files
-               OC_HELPER::rmdirr($extractDir);
+               OC_Helper::rmdirr($extractDir);
                if($data['source']=='http'){
                        unlink($path);
                }
@@ -159,8 +159,8 @@ class OC_INSTALLER{
                }
                
                //set the installed version
-               OC_APPCONFIG::setValue($info['id'],'installed_version',$info['version']);
-               OC_APPCONFIG::setValue($info['id'],'enabled','no');
+               OC_Appconfig::setValue($info['id'],'installed_version',$info['version']);
+               OC_Appconfig::setValue($info['id'],'enabled','no');
                return true;
        }
 
@@ -173,7 +173,7 @@ class OC_INSTALLER{
         */
        public static function isInstalled( $app ){
 
-               if( null == OC_APPCONFIG::getValue( $app, "installed_version" )){
+               if( null == OC_Appconfig::getValue( $app, "installed_version" )){
                        return false;
                }
 
@@ -205,7 +205,7 @@ class OC_INSTALLER{
         *   -# including appinfo/upgrade.php
         *   -# setting the installed version
         *
-        * upgrade.php can determine the current installed version of the app using "OC_APPCONFIG::getValue($appid,'installed_version')"
+        * upgrade.php can determine the current installed version of the app using "OC_Appconfig::getValue($appid,'installed_version')"
         */
        public static function upgradeApp( $data = array()){
                // TODO: write function
@@ -251,7 +251,7 @@ class OC_INSTALLER{
                while( false !== ( $filename = readdir( $dir ))){
                        if( substr( $filename, 0, 1 ) != '.' and is_dir("$SERVERROOT/apps/$filename") ){
                                if( file_exists( "$SERVERROOT/apps/$filename/appinfo/app.php" )){
-                                       if(!OC_INSTALLER::isInstalled($filename)){
+                                       if(!OC_Installer::isInstalled($filename)){
                                                //install the database
                                                if(is_file("$SERVERROOT/apps/$filename/appinfo/database.xml")){
                                                        OC_DB::createDbFromStructure("$SERVERROOT/apps/$filename/appinfo/database.xml");
@@ -261,12 +261,12 @@ class OC_INSTALLER{
                                                if(is_file("$SERVERROOT/apps/$filename/appinfo/install.php")){
                                                        include("$SERVERROOT/apps/$filename/appinfo/install.php");
                                                }
-                                               $info=OC_APP::getAppInfo("$SERVERROOT/apps/$filename/appinfo/info.xml");
-                                               OC_APPCONFIG::setValue($filename,'installed_version',$info['version']);
+                                               $info=OC_App::getAppInfo("$SERVERROOT/apps/$filename/appinfo/info.xml");
+                                               OC_Appconfig::setValue($filename,'installed_version',$info['version']);
                                                if( $enabled ){
-                                                       OC_APPCONFIG::setValue($filename,'enabled','yes');
+                                                       OC_Appconfig::setValue($filename,'enabled','yes');
                                                }else{
-                                                       OC_APPCONFIG::setValue($filename,'enabled','no');
+                                                       OC_Appconfig::setValue($filename,'enabled','no');
                                                }
                                        }
                                }
index 053c6fbc10e5966786239448cae16cb1abc4ee7c..4e65af66c4f7cd406c84e8df9e6eb151e89621bf 100644 (file)
@@ -200,8 +200,8 @@ class OC_L10N{
                else{
                        $available=self::findAvailableLanguages( $app );
                }
-               if( OC_USER::getUser() && OC_PREFERENCES::getValue( OC_USER::getUser(), 'core', 'lang' )){
-                       $lang = OC_PREFERENCES::getValue( OC_USER::getUser(), 'core', 'lang' );
+               if( OC_User::getUser() && OC_Preferences::getValue( OC_User::getUser(), 'core', 'lang' )){
+                       $lang = OC_Preferences::getValue( OC_User::getUser(), 'core', 'lang' );
                        self::$language = $lang;
                        if( array_search( $lang, $available ) !== false ){
                                return $lang;
index d7c280ea65ed238c315add313d889b11b7e793fb..d51b2ef0785c7a8a4d428f6db8247b32341b54d0 100644 (file)
@@ -39,7 +39,7 @@
 /**
  * This class is for logging
  */
-class OC_LOG {
+class OC_Log {
        /**
         * @brief adds an entry to the log
         * @param $appid id of the app
@@ -101,7 +101,7 @@ class OC_LOG {
                $result=$query->execute($params)->fetchAll();
                if(count($result)>0 and is_numeric($result[0]['moment'])){
                        foreach($result as &$row){
-                               $row['moment']=OC_UTIL::formatDate($row['moment']);
+                               $row['moment']=OC_Util::formatDate($row['moment']);
                        }
                }
                return $result;
index c91871377a0a1dd5b10e71a538a9d33ba6efeed6..8c7556a173bed797e01453fe8aaaef92cf76713b 100644 (file)
@@ -207,7 +207,7 @@ class OC_OCS {
         $identifieduser='';
       }
     }else{
-      if(!OC_USER::login($authuser,$authpw)){
+      if(!OC_User::login($authuser,$authpw)){
         if($forceuser){
           header('WWW-Authenticate: Basic realm="your valid user account or api key"');
           header('HTTP/1.0 401 Unauthorized');
@@ -377,7 +377,7 @@ class OC_OCS {
    */
   private static function personCheck($format,$login,$passwd) {
     if($login<>''){
-      if(OC_USER::login($login,$passwd)){
+      if(OC_User::login($login,$passwd)){
         $xml['person']['personid']=$login;
         echo(OC_OCS::generatexml($format,'ok',100,'',$xml,'person','check',2));
       }else{
@@ -426,7 +426,7 @@ class OC_OCS {
 
       $xml[$i]['timestamp']=date('c',$log['timestamp']);
       $xml[$i]['type']=1;
-      $xml[$i]['message']=OC_LOG::$TYPE[$log['type']].' '.strip_tags($log['message']);
+      $xml[$i]['message']=OC_Log::$TYPE[$log['type']].' '.strip_tags($log['message']);
       $xml[$i]['link']=$url;
     }
 
@@ -514,19 +514,19 @@ class OC_OCS {
                if($app){
                        $apps=array($app);
                }else{
-                       $apps=OC_PREFERENCES::getApps($user);
+                       $apps=OC_Preferences::getApps($user);
                }
                if($key){
                        $keys=array($key);
                }else{
                        foreach($apps as $app){
-                               $keys=OC_PREFERENCES::getKeys($user,$app);
+                               $keys=OC_Preferences::getKeys($user,$app);
                        }
                }
                $result=array();
                foreach($apps as $app){
                        foreach($keys as $key){
-                               $value=OC_PREFERENCES::getValue($user,$app,$key);
+                               $value=OC_Preferences::getValue($user,$app,$key);
                                $result[]=array('app'=>$app,'key'=>$key,'value'=>$value);
                        }
                }
@@ -542,7 +542,7 @@ class OC_OCS {
        * @return bool
        */
        public static function setData($user, $app, $key, $value) {
-               return OC_PREFERENCES::setValue($user,$app,$key,$value);
+               return OC_Preferences::setValue($user,$app,$key,$value);
        }
 
        /**
@@ -553,6 +553,6 @@ class OC_OCS {
        * @return string xml/json
        */
        public static function deleteData($user, $app, $key) {
-               return OC_PREFERENCES::deleteKey($user,$app,$key);
+               return OC_Preferences::deleteKey($user,$app,$key);
        }
 }
index 1b6280e25872ef0ab12e47846bda34ccbe3c34e2..2d85e715090aa69ab69f3466487ca3fd1349bc5b 100644 (file)
@@ -26,7 +26,7 @@
  * database.
  */
 
-class OC_OCSCLIENT{
+class OC_OCSClient{
 
        /**
         * @brief Get all the categories from the OCS server
index 89598f478d1af03d9274ef716f5a462401442425..d53cdd538e0c4dec0d872e54b066b77211a774d6 100644 (file)
@@ -37,7 +37,7 @@
 /**
  * This class provides an easy way for storing user preferences.
  */
-class OC_PREFERENCES{
+class OC_Preferences{
        /**
         * @brief Get all users using the preferences
         * @returns array with user ids
index 1acd48ea5afe69c8acd59844dff7d5922a32d953..2d3dee47b1ce5c76fb2cb47701a78018f6cf4b23 100644 (file)
@@ -186,7 +186,7 @@ class OC_REMOTE_CLOUD{
        public function sendFile($sourceDir,$sourceFile,$targetDir,$targetFile){
                global $WEBROOT;
                $source=$sourceDir.'/'.$sourceFile;
-               $tmp=OC_FILESYSTEM::toTmpFile($source);
+               $tmp=OC_Filesystem::toTmpFile($source);
                return $this->sendTmpFile($tmp,$targetDir,$targetFile);
        }
 
@@ -195,7 +195,7 @@ class OC_REMOTE_CLOUD{
                global $WEBROOT;
                $file=sys_get_temp_dir().'/'.'remoteCloudFile'.$token;
                rename($tmp,$file);
-               if( OC_CONFIG::getValue( "forcessl", false ) or isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') {
+               if( OC_Config::getValue( "forcessl", false ) or isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') {
                        $url = "https://". $_SERVER['SERVER_NAME'] . $WEBROOT;
                }else{
                        $url = "http://". $_SERVER['SERVER_NAME'] . $WEBROOT;
index cb5e5eee78b5fa06469fb714658f32310d161c9c..f6f805bfe6587e2dc76ac25a91aad504f0e045bc 100644 (file)
@@ -24,7 +24,7 @@
 /**
  * provides an interface to all search providers
  */
-class OC_SEARCH{
+class OC_Search{
        static private $providers=array();
        
        /**
index f0e0ba852492a5eb2e38e72d0ecea508c30d2a38..cceed8b04a38f7353003650a54b61dcddc3994e2 100644 (file)
@@ -4,7 +4,7 @@
  */
 abstract class OC_Search_Provider{
        public function __construct(){
-               OC_SEARCH::registerProvider($this);
+               OC_Search::registerProvider($this);
        }
 
        /**
index 892c431e05a15533b7180443f6cd8c36730606c0..e257b82a694b27f331fc940918a8e565f3190325 100644 (file)
@@ -2,13 +2,13 @@
 
 class OC_Search_Provider_File extends OC_Search_Provider{
        function search($query){
-               $files=OC_FILESYSTEM::search($query);
+               $files=OC_Filesystem::search($query);
                $results=array();
                foreach($files as $file){
-                       if(OC_FILESYSTEM::is_dir($file)){
-                               $results[]=new OC_Search_Result(basename($file),$file,OC_HELPER::linkTo( 'files', 'index.php?dir='.$file ),'Files');
+                       if(OC_Filesystem::is_dir($file)){
+                               $results[]=new OC_Search_Result(basename($file),$file,OC_Helper::linkTo( 'files', 'index.php?dir='.$file ),'Files');
                        }else{
-                               $results[]=new OC_Search_Result(basename($file),$file,OC_HELPER::linkTo( 'files', 'download.php?file='.$file ),'Files');
+                               $results[]=new OC_Search_Result(basename($file),$file,OC_Helper::linkTo( 'files', 'download.php?file='.$file ),'Files');
                        }
                }
                return $results;
index bf7166016d4e61f4c7be969cac5998433cc9ae8b..41cfa1750abb5b5ab5492a5887f1b607467bd386 100644 (file)
@@ -2,7 +2,7 @@
 
 $hasSQLite = (is_callable('sqlite_open') or class_exists('SQLite3'));
 $hasMySQL = is_callable('mysql_connect');
-$datadir = OC_CONFIG::getValue('datadir', $SERVERROOT.'/data');
+$datadir = OC_Config::getValue('datadir', $SERVERROOT.'/data');
 $opts = array(
        'hasSQLite' => $hasSQLite,
        'hasMySQL' => $hasMySQL,
@@ -12,13 +12,13 @@ $opts = array(
 
 if(isset($_POST['install']) AND $_POST['install']=='true') {
        // We have to launch the installation process :
-       $e = OC_SETUP::install($_POST);
+       $e = OC_Setup::install($_POST);
        $errors = array('errors' => $e);
        
        if(count($e) > 0) {
-               //OC_TEMPLATE::printGuestPage("", "error", array("errors" => $errors));
+               //OC_Template::printGuestPage("", "error", array("errors" => $errors));
                $options = array_merge($_POST, $opts, $errors);
-               OC_TEMPLATE::printGuestPage("", "installation", $options);
+               OC_Template::printGuestPage("", "installation", $options);
        }
        else {
                header("Location: ".$WEBROOT.'/');
@@ -26,10 +26,10 @@ if(isset($_POST['install']) AND $_POST['install']=='true') {
        }
 }
 else {
-       OC_TEMPLATE::printGuestPage("", "installation", $opts);
+       OC_Template::printGuestPage("", "installation", $opts);
 }
 
-class OC_SETUP {
+class OC_Setup {
        public static function install($options) {
                $error = array();
                $dbtype = $options['dbtype'];
@@ -72,18 +72,18 @@ class OC_SETUP {
                        }
 
                        //write the config file
-                       OC_CONFIG::setValue('datadirectory', $datadir);
-                       OC_CONFIG::setValue('dbtype', $dbtype);
-                       OC_CONFIG::setValue('version',implode('.',OC_UTIL::getVersion()));
+                       OC_Config::setValue('datadirectory', $datadir);
+                       OC_Config::setValue('dbtype', $dbtype);
+                       OC_Config::setValue('version',implode('.',OC_Util::getVersion()));
                        if($dbtype == 'mysql') {
                                $dbuser = $options['dbuser'];
                                $dbpass = $options['dbpass'];
                                $dbname = $options['dbname'];
                                $dbhost = $options['dbhost'];
                                $dbtableprefix = $options['dbtableprefix'];
-                               OC_CONFIG::setValue('dbname', $dbname);
-                               OC_CONFIG::setValue('dbhost', $dbhost);
-                               OC_CONFIG::setValue('dbtableprefix', $dbtableprefix);
+                               OC_Config::setValue('dbname', $dbname);
+                               OC_Config::setValue('dbhost', $dbhost);
+                               OC_Config::setValue('dbtableprefix', $dbtableprefix);
 
                                //check if the database user has admin right
                                $connection = @mysql_connect($dbhost, $dbuser, $dbpass);
@@ -105,15 +105,15 @@ class OC_SETUP {
                                                
                                                self::createDBUser($dbusername, $dbpassword, $connection);
                                                
-                                               OC_CONFIG::setValue('dbuser', $dbusername);
-                                               OC_CONFIG::setValue('dbpassword', $dbpassword);
+                                               OC_Config::setValue('dbuser', $dbusername);
+                                               OC_Config::setValue('dbpassword', $dbpassword);
 
                                                //create the database
                                                self::createDatabase($dbname, $dbusername, $connection);
                                        }
                                        else {
-                                               OC_CONFIG::setValue('dbuser', $dbuser);
-                                               OC_CONFIG::setValue('dbpassword', $dbpass);
+                                               OC_Config::setValue('dbuser', $dbuser);
+                                               OC_Config::setValue('dbpassword', $dbpass);
 
                                                //create the database
                                                self::createDatabase($dbname, $dbuser, $connection);
@@ -139,18 +139,18 @@ class OC_SETUP {
 
                        if(count($error) == 0) {
                                //create the user and group
-                               OC_USER::createUser($username, $password);
-                               OC_GROUP::createGroup('admin');
-                               OC_GROUP::addToGroup($username, 'admin');
+                               OC_User::createUser($username, $password);
+                               OC_Group::createGroup('admin');
+                               OC_Group::addToGroup($username, 'admin');
 
                                //guess what this does
-                               OC_INSTALLER::installShippedApps(true);
+                               OC_Installer::installShippedApps(true);
 
                                //create htaccess files for apache hosts
                                self::createHtaccess(); //TODO detect if apache is used
 
                                //and we are done
-                               OC_CONFIG::setValue('installed', true);
+                               OC_Config::setValue('installed', true);
                        }
                }
 
@@ -193,7 +193,7 @@ class OC_SETUP {
                @file_put_contents($SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it
 
                $content = "deny from all";
-               file_put_contents(OC_CONFIG::getValue('datadirectory', $SERVERROOT.'/data').'/.htaccess', $content);
+               file_put_contents(OC_Config::getValue('datadirectory', $SERVERROOT.'/data').'/.htaccess', $content);
        }
 }
 
index edfdf3bda80477f37a07fd13c69ca6e43b4d9ae0..fe173f609b21b63f8cb915cd359ac3b2e4fff997 100644 (file)
  */
 
 /**
- * @brief make OC_HELPER::linkTo available as a simple function
+ * @brief make OC_Helper::linkTo available as a simple function
  * @param $app app
  * @param $file file
  * @returns link to the file
  *
- * For further information have a look at OC_HELPER::linkTo
+ * For further information have a look at OC_Helper::linkTo
  */
 function link_to( $app, $file ){
-       return OC_HELPER::linkTo( $app, $file );
+       return OC_Helper::linkTo( $app, $file );
 }
 
 /**
- * @brief make OC_HELPER::imagePath available as a simple function
+ * @brief make OC_Helper::imagePath available as a simple function
  * @param $app app
  * @param $image image
  * @returns link to the image
  *
- * For further information have a look at OC_HELPER::imagePath
+ * For further information have a look at OC_Helper::imagePath
  */
 function image_path( $app, $image ){
-       return OC_HELPER::imagePath( $app, $image );
+       return OC_Helper::imagePath( $app, $image );
 }
 
 /**
- * @brief make OC_HELPER::mimetypeIcon available as a simple function
+ * @brief make OC_Helper::mimetypeIcon available as a simple function
  * @param $mimetype mimetype
  * @returns link to the image
  *
- * For further information have a look at OC_HELPER::mimetypeIcon
+ * For further information have a look at OC_Helper::mimetypeIcon
  */
 function mimetype_icon( $mimetype ){
-       return OC_HELPER::mimetypeIcon( $mimetype );
+       return OC_Helper::mimetypeIcon( $mimetype );
 }
 
 /**
- * @brief make OC_HELPER::humanFileSize available as a simple function
+ * @brief make OC_Helper::humanFileSize available as a simple function
  * @param $bytes size in bytes
  * @returns size as string
  *
- * For further information have a look at OC_HELPER::humanFileSize
+ * For further information have a look at OC_Helper::humanFileSize
  */
 function human_file_size( $bytes ){
-       return OC_HELPER::humanFileSize( $bytes );
+       return OC_Helper::humanFileSize( $bytes );
 }
 
 function simple_file_size($bytes) {
@@ -101,7 +101,7 @@ function relative_modified_date($timestamp) {
 /**
  * This class provides the templates for owncloud.
  */
-class OC_TEMPLATE{
+class OC_Template{
        private $renderas; // Create a full page?
        private $application; // template Application
        private $vars; // Vars
@@ -114,11 +114,11 @@ class OC_TEMPLATE{
         * @param $app app providing the template
         * @param $file name of the tempalte file (without suffix)
         * @param $renderas = ""; produce a full page
-        * @returns OC_TEMPLATE object
+        * @returns OC_Template object
         *
-        * This function creates an OC_TEMPLATE object.
+        * This function creates an OC_Template object.
         *
-        * If $renderas is set, OC_TEMPLATE will try to produce a full page in the
+        * If $renderas is set, OC_Template will try to produce a full page in the
         * according layout. For now, renderas can be set to "guest", "user" or
         * "admin".
         */
@@ -233,34 +233,34 @@ class OC_TEMPLATE{
                        // Decide which page we show
                        if( $this->renderas == "user" )
                        {
-                               $page = new OC_TEMPLATE( "core", "layout.user" );
-                               $search=new OC_TEMPLATE( 'core', 'part.searchbox');
-                               $search->assign('searchurl',OC_HELPER::linkTo( 'search', 'index.php' ));
+                               $page = new OC_Template( "core", "layout.user" );
+                               $search=new OC_Template( 'core', 'part.searchbox');
+                               $search->assign('searchurl',OC_Helper::linkTo( 'search', 'index.php' ));
                                $page->assign('searchbox', $search->fetchPage());
 
                                // Add navigation entry
-                               $page->assign( "navigation", OC_APP::getNavigation());
+                               $page->assign( "navigation", OC_App::getNavigation());
                        }
                        elseif( $this->renderas == "admin" )
                        {
-                               $page = new OC_TEMPLATE( "core", "layout.admin" );
-                               $search=new OC_TEMPLATE( 'core', 'part.searchbox');
-                               $search->assign('searchurl',OC_HELPER::linkTo( 'search', 'index.php' ));
+                               $page = new OC_Template( "core", "layout.admin" );
+                               $search=new OC_Template( 'core', 'part.searchbox');
+                               $search->assign('searchurl',OC_Helper::linkTo( 'search', 'index.php' ));
                                $page->assign('searchbox', $search->fetchPage());
                                
                                // Add menu data
-                               if( OC_GROUP::inGroup( $_SESSION["user_id"], "admin" )){
-                                       $page->assign( "adminnavigation", OC_APP::getAdminNavigation());
+                               if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
+                                       $page->assign( "adminnavigation", OC_App::getAdminNavigation());
                                }
-                               $page->assign( "settingsnavigation", OC_APP::getSettingsNavigation());
+                               $page->assign( "settingsnavigation", OC_App::getSettingsNavigation());
                        }
                        else
                        {
-                               $page = new OC_TEMPLATE( "core", "layout.guest" );
+                               $page = new OC_Template( "core", "layout.guest" );
                        }
 
                        // Add the css and js files
-                       foreach(OC_UTIL::$scripts as $script){
+                       foreach(OC_Util::$scripts as $script){
                                if(is_file("$SERVERROOT/apps/$script.js" )){
                                        $page->append( "jsfiles", "$WEBROOT/apps/$script.js" );
                                }
@@ -271,7 +271,7 @@ class OC_TEMPLATE{
                                        $page->append( "jsfiles", "$WEBROOT/core/$script.js" );
                                }
                        }
-                       foreach(OC_UTIL::$styles as $style){
+                       foreach(OC_Util::$styles as $style){
                                if(is_file("$SERVERROOT/apps/$style.css" )){
                                        $page->append( "cssfiles", "$WEBROOT/apps/$style.css" );
                                }
@@ -285,7 +285,7 @@ class OC_TEMPLATE{
                        
                        // Add custom headers
                        $page->assign('headers',$this->headers);
-                       foreach(OC_UTIL::$headers as $header){
+                       foreach(OC_Util::$headers as $header){
                                $page->append('headers',$header);
                        }
                        
@@ -328,7 +328,7 @@ class OC_TEMPLATE{
         * @returns true/false
         */
        public static function printUserPage( $application, $name, $parameters = array() ){
-               $content = new OC_TEMPLATE( $application, $name, "user" );
+               $content = new OC_Template( $application, $name, "user" );
                foreach( $parameters as $key => $value ){
                        $content->assign( $key, $value );
                }
@@ -343,7 +343,7 @@ class OC_TEMPLATE{
         * @returns true/false
         */
        public static function printAdminPage( $application, $name, $parameters = array() ){
-               $content = new OC_TEMPLATE( $application, $name, "admin" );
+               $content = new OC_Template( $application, $name, "admin" );
                foreach( $parameters as $key => $value ){
                        $content->assign( $key, $value );
                }
@@ -358,7 +358,7 @@ class OC_TEMPLATE{
         * @returns true/false
         */
        public static function printGuestPage( $application, $name, $parameters = array() ){
-               $content = new OC_TEMPLATE( $application, $name, "guest" );
+               $content = new OC_Template( $application, $name, "guest" );
                foreach( $parameters as $key => $value ){
                        $content->assign( $key, $value );
                }
index f6fbc33f64050e58e36bdcff7833e92cb10c43fe..9b8f5fb13e709604d6daa3846357baf98936cc4f 100644 (file)
@@ -34,7 +34,7 @@
  *   post_login(uid)
  *   logout()
  */
-class OC_USER {
+class OC_User {
        // The backend used for user management
        private static $_usedBackends = array();
 
@@ -91,7 +91,7 @@ class OC_USER {
                        case 'database':
                        case 'mysql':
                        case 'sqlite':
-                               self::$_usedBackends[$backend] = new OC_USER_DATABASE();
+                               self::$_usedBackends[$backend] = new OC_User_Database();
                                break;
                        default:
                                $className = 'OC_USER_' . strToUpper($backend);
@@ -108,7 +108,7 @@ class OC_USER {
         * @param $password The password of the new user
         * @returns true/false
         *
-        * Creates a new user. Basic checking of username is done in OC_USER
+        * Creates a new user. Basic checking of username is done in OC_User
         * itself, not in its subclasses.
         *
         * Allowed characters in the username are: "a-z", "A-Z", "0-9" and "_.@-"
@@ -130,7 +130,7 @@ class OC_USER {
 
 
                $run = true;
-               OC_HOOK::emit( "OC_USER", "pre_createUser", array( "run" => &$run, "uid" => $uid, "password" => $password ));
+               OC_Hook::emit( "OC_User", "pre_createUser", array( "run" => &$run, "uid" => $uid, "password" => $password ));
 
                if( $run ){
                        //create the user in the first backend that supports creating users
@@ -139,7 +139,7 @@ class OC_USER {
                                        continue;
 
                                $backend->createUser($uid,$password);
-                               OC_HOOK::emit( "OC_USER", "post_createUser", array( "uid" => $uid, "password" => $password ));
+                               OC_Hook::emit( "OC_User", "post_createUser", array( "uid" => $uid, "password" => $password ));
 
                                return true;
                        }
@@ -156,7 +156,7 @@ class OC_USER {
         */
        public static function deleteUser( $uid ){
                $run = true;
-               OC_HOOK::emit( "OC_USER", "pre_deleteUser", array( "run" => &$run, "uid" => $uid ));
+               OC_Hook::emit( "OC_User", "pre_deleteUser", array( "run" => &$run, "uid" => $uid ));
 
                if( $run ){
                        //delete the user from all backends
@@ -166,12 +166,12 @@ class OC_USER {
                                }
                        }
                        // We have to delete the user from all groups
-                       foreach( OC_GROUP::getUserGroups( $uid ) as $i ){
-                               OC_GROUP::removeFromGroup( $uid, $i );
+                       foreach( OC_Group::getUserGroups( $uid ) as $i ){
+                               OC_Group::removeFromGroup( $uid, $i );
                        }
 
                        // Emit and exit
-                       OC_HOOK::emit( "OC_USER", "post_deleteUser", array( "uid" => $uid ));
+                       OC_Hook::emit( "OC_User", "post_deleteUser", array( "uid" => $uid ));
                        return true;
                }
                else{
@@ -189,12 +189,12 @@ class OC_USER {
         */
        public static function login( $uid, $password ){
                $run = true;
-               OC_HOOK::emit( "OC_USER", "pre_login", array( "run" => &$run, "uid" => $uid ));
+               OC_Hook::emit( "OC_User", "pre_login", array( "run" => &$run, "uid" => $uid ));
 
                if( $run && self::checkPassword( $uid, $password )){
                        $_SESSION['user_id'] = $uid;
-                       OC_LOG::add( "core", $_SESSION['user_id'], "login" );
-                       OC_HOOK::emit( "OC_USER", "post_login", array( "uid" => $uid ));
+                       OC_Log::add( "core", $_SESSION['user_id'], "login" );
+                       OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid ));
                        return true;
                }
                else{
@@ -209,8 +209,8 @@ class OC_USER {
         * Logout, destroys session
         */
        public static function logout(){
-               OC_HOOK::emit( "OC_USER", "logout", array());
-               OC_LOG::add( "core", $_SESSION['user_id'], "logout" );
+               OC_Hook::emit( "OC_User", "logout", array());
+               OC_Log::add( "core", $_SESSION['user_id'], "logout" );
                $_SESSION['user_id'] = false;
                return true;
        }
@@ -263,7 +263,7 @@ class OC_USER {
         */
        public static function setPassword( $uid, $password ){
                $run = true;
-               OC_HOOK::emit( "OC_USER", "pre_setPassword", array( "run" => &$run, "uid" => $uid, "password" => $password ));
+               OC_Hook::emit( "OC_User", "pre_setPassword", array( "run" => &$run, "uid" => $uid, "password" => $password ));
 
                if( $run ){
                        foreach(self::$_usedBackends as $backend){
@@ -273,7 +273,7 @@ class OC_USER {
                                        }
                                }
                        }
-                       OC_HOOK::emit( "OC_USER", "post_setPassword", array( "uid" => $uid, "password" => $password ));
+                       OC_Hook::emit( "OC_User", "post_setPassword", array( "uid" => $uid, "password" => $password ));
                        return true;
                }
                else{
index 1797d0c475acf074afdeeb8084aeb16bbf909193..4afdf152150f2015af6b135d7651c177f2a492cb 100644 (file)
@@ -41,9 +41,9 @@ define('OC_USER_BACKEND_USER_EXISTS',       0x100000);
 
 /**
  * abstract base class for user management
- * subclass this for your own backends and see OC_USER_EXAMPLE for descriptions
+ * subclass this for your own backends and see OC_User_Example for descriptions
  */
-abstract class OC_USER_BACKEND {
+abstract class OC_User_Backend {
 
        protected $possibleActions = array(
                OC_USER_BACKEND_CREATE_USER => 'createUser',
index ace3c897703605b8837108f5477170ce4c2e6547..4992c2aa1649c4c6702cde3d3a923220b102b463 100644 (file)
@@ -36,7 +36,7 @@
 /**
  * Class for user management in a SQL Database (e.g. MySQL, SQLite)
  */
-class OC_USER_DATABASE extends OC_USER_BACKEND {
+class OC_User_Database extends OC_User_Backend {
        static private $userGroupCache=array();
 
        /**
@@ -45,7 +45,7 @@ class OC_USER_DATABASE extends OC_USER_BACKEND {
         * @param $password The password of the new user
         * @returns true/false
         *
-        * Creates a new user. Basic checking of username is done in OC_USER
+        * Creates a new user. Basic checking of username is done in OC_User
         * itself, not in its subclasses.
         */
        public function createUser( $uid, $password ){
index 069f14492a4b67caaa1d3664e56641c052e078f1..7481014de77c5fb54ff8183abfdd529886e10573 100644 (file)
  * abstract reference class for user management
  * this class should only be used as a reference for method signatures and their descriptions
  */
-abstract class OC_USER_EXAMPLE extends OC_USER_BACKEND {
+abstract class OC_User_Example extends OC_User_Backend {
        /**
                * @brief Create a new user
                * @param $uid The username of the user to create
                * @param $password The password of the new user
                * @returns true/false
                *
-               * Creates a new user. Basic checking of username is done in OC_USER
+               * Creates a new user. Basic checking of username is done in OC_User
                * itself, not in its subclasses.
                */
        public function createUser($uid, $password){
index 2a50114b05337ecfdc44c36f4fd98ac408a19a01..d9c749521ea4dcfcc27f344c144ea97f6b2f03aa 100644 (file)
@@ -4,7 +4,7 @@
  * Class for utility functions
  *
  */
-class OC_UTIL {
+class OC_Util {
        public static $scripts=array();
        public static $styles=array();
        public static $headers=array();
@@ -20,8 +20,8 @@ class OC_UTIL {
                global $SERVERROOT;
                global $CONFIG_DATADIRECTORY;
 
-               $CONFIG_DATADIRECTORY_ROOT = OC_CONFIG::getValue( "datadirectory", "$SERVERROOT/data" );
-               $CONFIG_BACKUPDIRECTORY = OC_CONFIG::getValue( "backupdirectory", "$SERVERROOT/backup" );
+               $CONFIG_DATADIRECTORY_ROOT = OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
+               $CONFIG_BACKUPDIRECTORY = OC_Config::getValue( "backupdirectory", "$SERVERROOT/backup" );
 
                // Create root dir
                if(!is_dir($CONFIG_DATADIRECTORY_ROOT)){
@@ -29,23 +29,23 @@ class OC_UTIL {
                }
 
                // If we are not forced to load a specific user we load the one that is logged in
-               if( $user == "" && OC_USER::isLoggedIn()){
-                       $user = OC_USER::getUser();
+               if( $user == "" && OC_User::isLoggedIn()){
+                       $user = OC_User::getUser();
                }
 
                if( $user != "" ){ //if we aren't logged in, there is no use to set up the filesystem
                        //first set up the local "root" storage and the backupstorage if needed
-                       $rootStorage=OC_FILESYSTEM::createStorage('local',array('datadir'=>$CONFIG_DATADIRECTORY_ROOT));
-//                     if( OC_CONFIG::getValue( "enablebackup", false )){
+                       $rootStorage=OC_Filesystem::createStorage('local',array('datadir'=>$CONFIG_DATADIRECTORY_ROOT));
+//                     if( OC_Config::getValue( "enablebackup", false )){
 //                             // This creates the Directorys recursively
 //                             if(!is_dir( "$CONFIG_BACKUPDIRECTORY/$user/$root" )){
 //                                     mkdir( "$CONFIG_BACKUPDIRECTORY/$user/$root", 0755, true );
 //                             }
-//                             $backupStorage=OC_FILESYSTEM::createStorage('local',array('datadir'=>$CONFIG_BACKUPDIRECTORY));
+//                             $backupStorage=OC_Filesystem::createStorage('local',array('datadir'=>$CONFIG_BACKUPDIRECTORY));
 //                             $backup=new OC_FILEOBSERVER_BACKUP(array('storage'=>$backupStorage));
 //                             $rootStorage->addObserver($backup);
 //                     }
-                       OC_FILESYSTEM::mount($rootStorage,'/');
+                       OC_Filesystem::mount($rootStorage,'/');
 
                        $CONFIG_DATADIRECTORY = "$CONFIG_DATADIRECTORY_ROOT/$user/$root";
                        if( !is_dir( $CONFIG_DATADIRECTORY )){
@@ -55,25 +55,25 @@ class OC_UTIL {
 // TODO: find a cool way for doing this
 //                     //set up the other storages according to the system settings
 //                     foreach($CONFIG_FILESYSTEM as $storageConfig){
-//                             if(OC_FILESYSTEM::hasStorageType($storageConfig['type'])){
+//                             if(OC_Filesystem::hasStorageType($storageConfig['type'])){
 //                                     $arguments=$storageConfig;
 //                                     unset($arguments['type']);
 //                                     unset($arguments['mountpoint']);
-//                                     $storage=OC_FILESYSTEM::createStorage($storageConfig['type'],$arguments);
+//                                     $storage=OC_Filesystem::createStorage($storageConfig['type'],$arguments);
 //                                     if($storage){
-//                                             OC_FILESYSTEM::mount($storage,$storageConfig['mountpoint']);
+//                                             OC_Filesystem::mount($storage,$storageConfig['mountpoint']);
 //                                     }
 //                             }
 //                     }
 
                        //jail the user into his "home" directory
-                       OC_FILESYSTEM::chroot("/$user/$root");
+                       OC_Filesystem::chroot("/$user/$root");
                        self::$fsSetup=true;
                }
        }
 
        public static function tearDownFS(){
-               OC_FILESYSTEM::tearDown();
+               OC_Filesystem::tearDown();
                self::$fsSetup=false;
        }
 
@@ -153,7 +153,7 @@ class OC_UTIL {
         * @param int $pagecount
         * @param int $page
         * @param string $url
-        * @return OC_TEMPLATE
+        * @return OC_Template
         */
        public static function getPageNavi($pagecount,$page,$url) {
 
@@ -164,7 +164,7 @@ class OC_UTIL {
                        $pagestop=$page+$pagelinkcount;
                        if($pagestop>$pagecount) $pagestop=$pagecount;
 
-                       $tmpl = new OC_TEMPLATE( '', 'part.pagenavi', '' );
+                       $tmpl = new OC_Template( '', 'part.pagenavi', '' );
                        $tmpl->assign('page',$page);
                        $tmpl->assign('pagecount',$pagecount);
                        $tmpl->assign('pagestart',$pagestart);
@@ -184,17 +184,17 @@ class OC_UTIL {
                global $SERVERROOT;
                global $CONFIG_DATADIRECTORY;
 
-               $CONFIG_DATADIRECTORY_ROOT = OC_CONFIG::getValue( "datadirectory", "$SERVERROOT/data" );;
-               $CONFIG_BACKUPDIRECTORY = OC_CONFIG::getValue( "backupdirectory", "$SERVERROOT/backup" );
-               $CONFIG_INSTALLED = OC_CONFIG::getValue( "installed", false );
+               $CONFIG_DATADIRECTORY_ROOT = OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );;
+               $CONFIG_BACKUPDIRECTORY = OC_Config::getValue( "backupdirectory", "$SERVERROOT/backup" );
+               $CONFIG_INSTALLED = OC_Config::getValue( "installed", false );
                $errors=array();
 
                //check for database drivers
                if(!is_callable('sqlite_open') and !is_callable('mysql_connect')){
                        $errors[]=array('error'=>'No database drivers (sqlite or mysql) installed.<br/>','hint'=>'');//TODO: sane hint
                }
-               $CONFIG_DBTYPE = OC_CONFIG::getValue( "dbtype", "sqlite" );
-               $CONFIG_DBNAME = OC_CONFIG::getValue( "dbname", "owncloud" );
+               $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
+               $CONFIG_DBNAME = OC_Config::getValue( "dbname", "owncloud" );
 
                //try to get the username the httpd server runs on, used in hints
                $stat=stat($_SERVER['DOCUMENT_ROOT']);
@@ -212,17 +212,17 @@ class OC_UTIL {
                if(!stristr(PHP_OS, 'WIN')){
                        $prems=substr(decoct(fileperms($CONFIG_DATADIRECTORY_ROOT)),-3);
                        if(substr($prems,-1)!='0'){
-                               OC_HELPER::chmodr($CONFIG_DATADIRECTORY_ROOT,0770);
+                               OC_Helper::chmodr($CONFIG_DATADIRECTORY_ROOT,0770);
                                clearstatcache();
                                $prems=substr(decoct(fileperms($CONFIG_DATADIRECTORY_ROOT)),-3);
                                if(substr($prems,2,1)!='0'){
                                        $errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY_ROOT.') is readable from the web<br/>','hint'=>$permissionsHint);
                                }
                        }
-                       if( OC_CONFIG::getValue( "enablebackup", false )){
+                       if( OC_Config::getValue( "enablebackup", false )){
                                $prems=substr(decoct(fileperms($CONFIG_BACKUPDIRECTORY)),-3);
                                if(substr($prems,-1)!='0'){
-                                       OC_HELPER::chmodr($CONFIG_BACKUPDIRECTORY,0770);
+                                       OC_Helper::chmodr($CONFIG_BACKUPDIRECTORY,0770);
                                        clearstatcache();
                                        $prems=substr(decoct(fileperms($CONFIG_BACKUPDIRECTORY)),-3);
                                        if(substr($prems,2,1)!='0'){
index 7247104b95d8334d43a35ffa5f3aa842d1f96445..f3ef650704da817e81fb43429897e9a7e83d3469 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-OC_APP::register( array( "order" => 1, "id" => "log", "name" => "Log" ));
-OC_APP::addSettingsPage( array( "id" => "log", "order" => 999, "href" => OC_HELPER::linkTo( "log", "index.php" ), "name" => "Log", "icon" => OC_HELPER::imagePath( "log", "logs.png" )));
+OC_App::register( array( "order" => 1, "id" => "log", "name" => "Log" ));
+OC_App::addSettingsPage( array( "id" => "log", "order" => 999, "href" => OC_Helper::linkTo( "log", "index.php" ), "name" => "Log", "icon" => OC_Helper::imagePath( "log", "logs.png" )));
 
 ?>
index 096180347e5cb94db67f99858c973843d75223dc..e201411e483a2e0c621f8e75b9540f00aa3379fb 100644 (file)
 //require_once('../../config/config.php');
 require_once('../lib/base.php');
 
-if( !OC_USER::isLoggedIn()){
-       header( 'Location: '.OC_HELPER::linkTo( 'index.php' ));
+if( !OC_User::isLoggedIn()){
+       header( 'Location: '.OC_Helper::linkTo( 'index.php' ));
        exit();
 }
 
 //load the script
-OC_UTIL::addScript( "log", "log" );
+OC_Util::addScript( "log", "log" );
 
 $allActions=array('login','logout','read','write','create','delete');
 
@@ -42,29 +42,29 @@ if(isset($_POST['save'])){
                        $selectedActions[]=$action;
                }
        }
-       OC_PREFERENCES::setValue(OC_USER::getUser(),'log','actions',implode(',',$selectedActions));
-       OC_PREFERENCES::setValue(OC_USER::getUser(),'log','pagesize',$_POST['size']);
+       OC_Preferences::setValue(OC_User::getUser(),'log','actions',implode(',',$selectedActions));
+       OC_Preferences::setValue(OC_User::getUser(),'log','pagesize',$_POST['size']);
 }
 //clear log entries
 elseif(isset($_POST['clear'])){
        $removeBeforeDate=(isset($_POST['removeBeforeDate']))?$_POST['removeBeforeDate']:0;
        if($removeBeforeDate!==0){
                $removeBeforeDate=strtotime($removeBeforeDate);
-               OC_LOG::deleteBefore($removeBeforeDate);
+               OC_Log::deleteBefore($removeBeforeDate);
        }
 }
 elseif(isset($_POST['clearall'])){
-       OC_LOG::deleteAll();
+       OC_Log::deleteAll();
 }
 
-OC_APP::setActiveNavigationEntry( 'log' );
-$logs=OC_LOG::get();
+OC_App::setActiveNavigationEntry( 'log' );
+$logs=OC_Log::get();
 
 
-$selectedActions=explode(',',OC_PREFERENCES::getValue(OC_USER::getUser(),'log','actions',implode(',',$allActions)));
-$logs=OC_LOG::filterAction($logs,$selectedActions);
+$selectedActions=explode(',',OC_Preferences::getValue(OC_User::getUser(),'log','actions',implode(',',$allActions)));
+$logs=OC_Log::filterAction($logs,$selectedActions);
 
-$pageSize=OC_PREFERENCES::getValue(OC_USER::getUser(),'log','pagesize',20);
+$pageSize=OC_Preferences::getValue(OC_User::getUser(),'log','pagesize',20);
 $pageCount=ceil(count($logs)/$pageSize);
 $page=isset($_GET['page'])?$_GET['page']:0;
 if($page>=$pageCount){
@@ -77,8 +77,8 @@ foreach( $logs as &$i ){
        $i['date'] =$i['moment'];
 }
 
-$url=OC_HELPER::linkTo( 'log', 'index.php' ).'?page=';
-$pager=OC_UTIL::getPageNavi($pageCount,$page,$url);
+$url=OC_Helper::linkTo( 'log', 'index.php' ).'?page=';
+$pager=OC_Util::getPageNavi($pageCount,$page,$url);
 if($pager){
        $pagerHTML=$pager->fetchPage();
 }
@@ -96,7 +96,7 @@ foreach($allActions as $action){
        }
 }
 
-$tmpl = new OC_TEMPLATE( 'log', 'index', 'admin' );
+$tmpl = new OC_Template( 'log', 'index', 'admin' );
 $tmpl->assign( 'logs', $logs );
 $tmpl->assign( 'pager', $pagerHTML );
 $tmpl->assign( 'size', $pageSize );
index 44834498fec14999f915fdd8a4b8fb6f23465a1a..b91341643f25dd9a59c26d45fe58910c6b6ce403 100644 (file)
@@ -1,5 +1,5 @@
 <?php
 
-OC_APP::register( array( 'order' => 2, "id" => 'search', 'name' => 'Search' ));
+OC_App::register( array( 'order' => 2, "id" => 'search', 'name' => 'Search' ));
 
 ?>
index b9aca57cdece4f457dfedd0504a396f5e6f37f91..7369a6d81ce5aede7e2483e4f9290feb457158b9 100644 (file)
 require_once('../lib/base.php');
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
-       header( "Location: ".OC_HELPER::linkTo( '', 'index.php' ));
+if( !OC_User::isLoggedIn()){
+       header( "Location: ".OC_Helper::linkTo( '', 'index.php' ));
        exit();
 }
 
 // Load the files we need
-OC_UTIL::addStyle( 'search', 'search' );
+OC_Util::addStyle( 'search', 'search' );
 
 $query=(isset($_POST['query']))?$_POST['query']:'';
 if($query){
-       $results=OC_SEARCH::search($query);
+       $results=OC_Search::search($query);
 }else{
-       header("Location: ".$WEBROOT.'/'.OC_APPCONFIG::getValue("core", "defaultpage", "files/index.php"));
+       header("Location: ".$WEBROOT.'/'.OC_Appconfig::getValue("core", "defaultpage", "files/index.php"));
        exit();
 }
 
@@ -50,7 +50,7 @@ foreach($results as $result){
        $resultTypes[$result->type][]=$result;
 }
 
-$tmpl = new OC_TEMPLATE( 'search', 'index', 'user' );
+$tmpl = new OC_Template( 'search', 'index', 'user' );
 $tmpl->assign('resultTypes',$resultTypes);
 $tmpl->printPage();
 
index f568d3ef876c4b2158169201ba44220e5553dab6..c8c1f7408891d39baeff2a45ec87381c21f5f989 100644 (file)
@@ -9,7 +9,7 @@ $l=new OC_L10N('settings');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
        echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t( "Authentication error" ) )));
        exit();
 }
@@ -21,13 +21,13 @@ if( !isset( $_POST["password"] ) && !isset( $_POST["oldpassword"] )){
 }
 
 // Check if the old password is correct
-if( !OC_USER::checkPassword( $_SESSION["user_id"], $_POST["oldpassword"] )){
+if( !OC_User::checkPassword( $_SESSION["user_id"], $_POST["oldpassword"] )){
        echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Your old password is wrong!") )));
        exit();
 }
 
 // Change password
-if( OC_USER::setPassword( $_SESSION["user_id"], $_POST["password"] )){
+if( OC_User::setPassword( $_SESSION["user_id"], $_POST["password"] )){
        echo json_encode( array( "status" => "success", "data" => array( "message" => $l->t("Password changed") )));
 }
 else{
index bc467fb90040ce328633048b23157c20cf27e4bc..a5ba3d81ba37a9086cfba8f59b8e75002ffd429e 100644 (file)
@@ -9,7 +9,7 @@ $l=new OC_L10N('settings');
 header( "Content-Type: application/jsonrequest" );
 
 // Check if we are a user
-if( !OC_USER::isLoggedIn()){
+if( !OC_User::isLoggedIn()){
        echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Authentication error") )));
        exit();
 }
@@ -17,7 +17,7 @@ if( !OC_USER::isLoggedIn()){
 // Get data
 if( isset( $_POST['lang'] ) ){
        $lang=$_POST['lang'];
-       OC_PREFERENCES::setValue( OC_USER::getUser(), 'core', 'lang', $lang );
+       OC_Preferences::setValue( OC_User::getUser(), 'core', 'lang', $lang );
        echo json_encode( array( "status" => "success", "data" => array( "message" => $l->t("Language changed") )));
 }else{
        echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Invalid request") )));
index f0bf1c71bb4229ca77a38cb0bba08d86e8b7b670..db4594dcc2db4098e08b0a719724df971801876f 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-OC_APP::register( array( "id" => "settings", "name" => "Settings" ));
-OC_APP::addSettingsPage( array( "id" => "settings", "order" => -1000, "href" => OC_HELPER::linkTo( "settings", "index.php" ), "name" => "Personal", "icon" => OC_HELPER::imagePath( "settings", "personal.png" )));
+OC_App::register( array( "id" => "settings", "name" => "Settings" ));
+OC_App::addSettingsPage( array( "id" => "settings", "order" => -1000, "href" => OC_Helper::linkTo( "settings", "index.php" ), "name" => "Personal", "icon" => OC_Helper::imagePath( "settings", "personal.png" )));
 
 ?>
index 17c878b1a25e3fe65f95532d862972b9b9b72fab..a37ae7e6ea2e3d12cfde569e25a9bb14299a1b7a 100644 (file)
@@ -1,32 +1,32 @@
 <?php
 
 require_once('../lib/base.php');
-if( !OC_USER::isLoggedIn()){
-    header( "Location: ".OC_HELPER::linkTo( "index.php" ));
+if( !OC_User::isLoggedIn()){
+    header( "Location: ".OC_Helper::linkTo( "index.php" ));
     exit();
 }
 
 // Highlight navigation entry
-OC_APP::setActiveNavigationEntry( "settings" );
-OC_UTIL::addScript( "settings", "main" );
-OC_UTIL::addStyle( "settings", "settings" );
+OC_App::setActiveNavigationEntry( "settings" );
+OC_Util::addScript( "settings", "main" );
+OC_Util::addStyle( "settings", "settings" );
 
 // calculate the disc space
-$used=OC_FILESYSTEM::filesize('/');
-$free=OC_FILESYSTEM::free_space();
+$used=OC_Filesystem::filesize('/');
+$free=OC_Filesystem::free_space();
 $total=$free+$used;
 $relative=round(($used/$total)*100);
 
-$lang=OC_PREFERENCES::getValue( OC_USER::getUser(), 'core', 'lang', 'en' );
+$lang=OC_Preferences::getValue( OC_User::getUser(), 'core', 'lang', 'en' );
 $languages=OC_L10N::findAvailableLanguages();
 //put the current language in the front
 unset($languages[array_search($lang,$languages)]);
 array_unshift($languages,$lang);
 
 // Return template
-$tmpl = new OC_TEMPLATE( "settings", "index", "admin");
-$tmpl->assign('usage',OC_HELPER::humanFileSize($used));
-$tmpl->assign('total_space',OC_HELPER::humanFileSize($total));
+$tmpl = new OC_Template( "settings", "index", "admin");
+$tmpl->assign('usage',OC_Helper::humanFileSize($used));
+$tmpl->assign('total_space',OC_Helper::humanFileSize($total));
 $tmpl->assign('usage_relative',$relative);
 $tmpl->assign('languages',$languages);
 $tmpl->printPage();
index 3d410cd433069d57b6d8856225ecc89adb174e94..efa730f6f8f88b35883a9e5e9c5473ed48a9a38c 100644 (file)
@@ -46,7 +46,7 @@ foreach($testCases as $testCaseClass){
        $testResults[$testCaseClass]=$results;
 }
 
-$tmpl = new OC_TEMPLATE( 'tests', 'index');
+$tmpl = new OC_Template( 'tests', 'index');
 $tmpl->assign('tests',$testResults);
 $tmpl->printPage();
 
index 1b1703a06d74d8ca4d317ce1eb170debee3df1ae..4bfa23884f4ea74e88cad28694b03d1cbfd859ce 100644 (file)
@@ -2,46 +2,46 @@
 class OC_FILEYSYSTEM_Test extends OC_TestCase
 {
        public function setup(){
-               OC_UTIL::setupFS('testuser','testcase');
+               OC_Util::setupFS('testuser','testcase');
        }
        public function tearDown(){
-               OC_FILESYSTEM::chroot('');
-               OC_FILESYSTEM::delTree('/testuser');
-               OC_UTIL::tearDownFS();
+               OC_Filesystem::chroot('');
+               OC_Filesystem::delTree('/testuser');
+               OC_Util::tearDownFS();
        }
        
        public function isDir(){
-               $this->assertEquals(true, OC_FILESYSTEM::is_dir('/'),'Root is not a directory');
+               $this->assertEquals(true, OC_Filesystem::is_dir('/'),'Root is not a directory');
        }
        
        public function fileExists(){
-               $this->assertEquals(false, OC_FILESYSTEM::file_exists('/dummy'),'Unexpected result with non-existing file');
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $this->assertEquals(true, OC_FILESYSTEM::file_exists('/dummy'),'Unexpected result with existing file');
+               $this->assertEquals(false, OC_Filesystem::file_exists('/dummy'),'Unexpected result with non-existing file');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $this->assertEquals(true, OC_Filesystem::file_exists('/dummy'),'Unexpected result with existing file');
        }
 
        public function mkdir(){
-               OC_FILESYSTEM::mkdir('/dummy');
-               $this->assertEquals(true, OC_FILESYSTEM::file_exists('/dummy'),'No such file or directory after creating folder');
-               $this->assertEquals(true, OC_FILESYSTEM::is_dir('/dummy'),'File created instead of filder');
+               OC_Filesystem::mkdir('/dummy');
+               $this->assertEquals(true, OC_Filesystem::file_exists('/dummy'),'No such file or directory after creating folder');
+               $this->assertEquals(true, OC_Filesystem::is_dir('/dummy'),'File created instead of filder');
        }
 
        public function rmdir(){
-               OC_FILESYSTEM::mkdir('/dummy');
-               OC_FILESYSTEM::rmdir('/dummy');
-               $this->assertEquals(false, OC_FILESYSTEM::file_exists('/dummy'),'Folder still exists after removing');
+               OC_Filesystem::mkdir('/dummy');
+               OC_Filesystem::rmdir('/dummy');
+               $this->assertEquals(false, OC_Filesystem::file_exists('/dummy'),'Folder still exists after removing');
        }
 
        public function isFile(){
-               $this->assertEquals(false, OC_FILESYSTEM::is_file('/'),'Root is a file');
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $this->assertEquals(true, OC_FILESYSTEM::is_file('/dummy'),'Created file is not said to be a file');
+               $this->assertEquals(false, OC_Filesystem::is_file('/'),'Root is a file');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $this->assertEquals(true, OC_Filesystem::is_file('/dummy'),'Created file is not said to be a file');
        }
 
        public function opendir(){
-               OC_FILESYSTEM::file_put_contents('/dummy1','foo');
-               OC_FILESYSTEM::file_put_contents('/dummy2','foo');
-               $dh=OC_FILESYSTEM::opendir('/');
+               OC_Filesystem::file_put_contents('/dummy1','foo');
+               OC_Filesystem::file_put_contents('/dummy2','foo');
+               $dh=OC_Filesystem::opendir('/');
                if(!$dh){
                        $this->fail('Failed to open root');
                }
@@ -61,14 +61,14 @@ class OC_FILEYSYSTEM_Test extends OC_TestCase
        }
 
        public function filesize(){
-               OC_FILESYSTEM::file_put_contents('/dummy','1234567890');
-               $this->assertEquals(10, OC_FILESYSTEM::filesize('/dummy'),'Unexpected filesize');
+               OC_Filesystem::file_put_contents('/dummy','1234567890');
+               $this->assertEquals(10, OC_Filesystem::filesize('/dummy'),'Unexpected filesize');
        }
 
        public function stat(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
+               OC_Filesystem::file_put_contents('/dummy','foo');
                $time=time();
-               $stat=OC_FILESYSTEM::stat('/dummy');
+               $stat=OC_Filesystem::stat('/dummy');
                $this->assertEquals(true,abs($time-$stat['atime'])<1,'Unexpected access time');//there can be small difference between those values due to running time
                $this->assertEquals(true,abs($time-$stat['ctime'])<1,'Unexpected creation time');
                $this->assertEquals(true,abs($time-$stat['mtime'])<1,'Unexpected modified time');
@@ -76,146 +76,146 @@ class OC_FILEYSYSTEM_Test extends OC_TestCase
        }
 
        public function filetype(){
-               OC_FILESYSTEM::file_put_contents('/dummyFile','foo');
-               OC_FILESYSTEM::mkdir('/dummyFolder');
-               $this->assertEquals('file', OC_FILESYSTEM::filetype('/dummyFile'),'Unexpected filetype of file');
-               $this->assertEquals('dir', OC_FILESYSTEM::filetype('/dummyFolder'),'Unexpected filetype of folder');
+               OC_Filesystem::file_put_contents('/dummyFile','foo');
+               OC_Filesystem::mkdir('/dummyFolder');
+               $this->assertEquals('file', OC_Filesystem::filetype('/dummyFile'),'Unexpected filetype of file');
+               $this->assertEquals('dir', OC_Filesystem::filetype('/dummyFolder'),'Unexpected filetype of folder');
        }
 
        public function readfile(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
+               OC_Filesystem::file_put_contents('/dummy','foo');
                ob_start();
-               OC_FILESYSTEM::readfile('/dummy');
+               OC_Filesystem::readfile('/dummy');
                $this->assertEquals('foo', ob_get_contents(),'Unexpected output of readfile');
                ob_end_clean();
        }
 
        public function isReadable(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $this->assertEquals(true, OC_FILESYSTEM::is_readable('/dummy'),'Can\'t read created file');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $this->assertEquals(true, OC_Filesystem::is_readable('/dummy'),'Can\'t read created file');
        }
 
        public function isWritable(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $this->assertEquals(true, OC_FILESYSTEM::is_writeable('/dummy'),'Can\'t write created file');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $this->assertEquals(true, OC_Filesystem::is_writeable('/dummy'),'Can\'t write created file');
        }
 
        public function fileatime(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
+               OC_Filesystem::file_put_contents('/dummy','foo');
                $time=time();
-               $this->assertEquals(true,abs($time-OC_FILESYSTEM::fileatime('/dummy'))<1,'Unexpected access time');//there can be small difference between those values due to running time
+               $this->assertEquals(true,abs($time-OC_Filesystem::fileatime('/dummy'))<1,'Unexpected access time');//there can be small difference between those values due to running time
        }
 
        public function filectime(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
+               OC_Filesystem::file_put_contents('/dummy','foo');
                $time=time();
-               $this->assertEquals(true,abs($time-OC_FILESYSTEM::filectime('/dummy'))<1,'Unexpected creation time');//there can be small difference between those values due to running time
+               $this->assertEquals(true,abs($time-OC_Filesystem::filectime('/dummy'))<1,'Unexpected creation time');//there can be small difference between those values due to running time
        }
 
        public function filemtime(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
+               OC_Filesystem::file_put_contents('/dummy','foo');
                $time=time();
-               $this->assertEquals(true,abs($time-OC_FILESYSTEM::filemtime('/dummy'))<1,'Unexpected modified time');//there can be small difference between those values due to running time
+               $this->assertEquals(true,abs($time-OC_Filesystem::filemtime('/dummy'))<1,'Unexpected modified time');//there can be small difference between those values due to running time
        }
 
        public function fileGetContents(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $this->assertEquals('foo', OC_FILESYSTEM::file_get_contents('/dummy'),'Unexpected content of file');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $this->assertEquals('foo', OC_Filesystem::file_get_contents('/dummy'),'Unexpected content of file');
        }
 
        public function unlink(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               OC_FILESYSTEM::unlink('/dummy');
-               $this->assertEquals(false, OC_FILESYSTEM::file_exists('/dummy'),'File still exists after deletion');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               OC_Filesystem::unlink('/dummy');
+               $this->assertEquals(false, OC_Filesystem::file_exists('/dummy'),'File still exists after deletion');
        }
 
        public function rename(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               OC_FILESYSTEM::rename('/dummy','/bar');
-               $this->assertEquals(true, OC_FILESYSTEM::file_exists('/bar'),'New file doesnt exists after moving');
-               $this->assertEquals(false, OC_FILESYSTEM::file_exists('/dummy'),'Old file still exists after moving');
-               $this->assertEquals('foo', OC_FILESYSTEM::file_get_contents('/bar'),'Unexpected content of file after moving');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               OC_Filesystem::rename('/dummy','/bar');
+               $this->assertEquals(true, OC_Filesystem::file_exists('/bar'),'New file doesnt exists after moving');
+               $this->assertEquals(false, OC_Filesystem::file_exists('/dummy'),'Old file still exists after moving');
+               $this->assertEquals('foo', OC_Filesystem::file_get_contents('/bar'),'Unexpected content of file after moving');
        }
 
        public function copy(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               OC_FILESYSTEM::copy('/dummy','/bar');
-               $this->assertEquals(true, OC_FILESYSTEM::file_exists('/bar'),'New file doesnt exists after copying');
-               $this->assertEquals(true, OC_FILESYSTEM::file_exists('/dummy'),'Old file doesnt exists after copying');
-               $this->assertEquals('foo', OC_FILESYSTEM::file_get_contents('/bar'),'Unexpected content of file after copying');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               OC_Filesystem::copy('/dummy','/bar');
+               $this->assertEquals(true, OC_Filesystem::file_exists('/bar'),'New file doesnt exists after copying');
+               $this->assertEquals(true, OC_Filesystem::file_exists('/dummy'),'Old file doesnt exists after copying');
+               $this->assertEquals('foo', OC_Filesystem::file_get_contents('/bar'),'Unexpected content of file after copying');
        }
 
        public function fopen(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $fh=OC_FILESYSTEM::fopen('/dummy','r');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $fh=OC_Filesystem::fopen('/dummy','r');
                if(!$fh){
                        $this->fail('Cant open file for reading');
                }
                $content=fread($fh,3);
                $this->assertEquals('foo', $content,'Unexpected content of file');
                fclose($fh);
-               $fh=OC_FILESYSTEM::fopen('/dummy','a');
+               $fh=OC_Filesystem::fopen('/dummy','a');
                fwrite($fh,'bar',3);
                fclose($fh);
-               $this->assertEquals('foobar', OC_FILESYSTEM::file_get_contents('/dummy'),'Unexpected content of file after appending');
-               $fh=OC_FILESYSTEM::fopen('/dummy','w');
+               $this->assertEquals('foobar', OC_Filesystem::file_get_contents('/dummy'),'Unexpected content of file after appending');
+               $fh=OC_Filesystem::fopen('/dummy','w');
                fwrite($fh,'bar',3);
                fclose($fh);
-               $this->assertEquals('bar', OC_FILESYSTEM::file_get_contents('/dummy'),'Unexpected content of file after writing');
+               $this->assertEquals('bar', OC_Filesystem::file_get_contents('/dummy'),'Unexpected content of file after writing');
        }
 
        public function toTmpFile(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $tmp=OC_FILESYSTEM::toTmpFile('/dummy');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $tmp=OC_Filesystem::toTmpFile('/dummy');
                $this->assertEquals('foo', file_get_contents($tmp),'Unexpected content of temporary file');
                unlink($tmp);
        }
 
        public function fromTmpFile(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $tmp=OC_FILESYSTEM::toTmpFile('/dummy');
-               OC_FILESYSTEM::fromTmpFile($tmp,'/bar');
-               $this->assertEquals('foo', OC_FILESYSTEM::file_get_contents('/bar'),'Unexpected content of new file');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $tmp=OC_Filesystem::toTmpFile('/dummy');
+               OC_Filesystem::fromTmpFile($tmp,'/bar');
+               $this->assertEquals('foo', OC_Filesystem::file_get_contents('/bar'),'Unexpected content of new file');
                $this->assertEquals(false, file_exists($tmp),'Temporary file still exists');
        }
 
        public function getMimeType(){
-               OC_FILESYSTEM::file_put_contents('/dummy','some plain text');
-               $this->assertEquals('text/plain', OC_FILESYSTEM::getMimeType('/dummy'),'Unexpected mimetype of pain text file');
-               OC_FILESYSTEM::file_put_contents('/dummy',"<?xml version='1.0'?>\n</dummy>");
-               $this->assertEquals('application/xml', OC_FILESYSTEM::getMimeType('/dummy'),'Unexpected mimetype of xml file');
+               OC_Filesystem::file_put_contents('/dummy','some plain text');
+               $this->assertEquals('text/plain', OC_Filesystem::getMimeType('/dummy'),'Unexpected mimetype of pain text file');
+               OC_Filesystem::file_put_contents('/dummy',"<?xml version='1.0'?>\n</dummy>");
+               $this->assertEquals('application/xml', OC_Filesystem::getMimeType('/dummy'),'Unexpected mimetype of xml file');
        }
 
        public function delTree(){
-               OC_FILESYSTEM::mkdir('/dummy');
-               OC_FILESYSTEM::file_put_contents('/dummy/bar','foo');
-               OC_FILESYSTEM::delTree('/dummy');
-               $this->assertEquals(false, OC_FILESYSTEM::file_exists('/dummy/bar'),'File in deleted folder still exists');
-               $this->assertEquals(false, OC_FILESYSTEM::file_exists('/dummy'),'Deleted folder still exists');
+               OC_Filesystem::mkdir('/dummy');
+               OC_Filesystem::file_put_contents('/dummy/bar','foo');
+               OC_Filesystem::delTree('/dummy');
+               $this->assertEquals(false, OC_Filesystem::file_exists('/dummy/bar'),'File in deleted folder still exists');
+               $this->assertEquals(false, OC_Filesystem::file_exists('/dummy'),'Deleted folder still exists');
        }
 
        public function getTree(){
-               OC_FILESYSTEM::mkdir('/dummy');
-               OC_FILESYSTEM::file_put_contents('/dummy/bar','foo');
+               OC_Filesystem::mkdir('/dummy');
+               OC_Filesystem::file_put_contents('/dummy/bar','foo');
                $expected=array('/dummy','/dummy/bar');
-               $this->assertEquals($expected, OC_FILESYSTEM::getTree('/dummy'),'Unexpected filelist returned');
+               $this->assertEquals($expected, OC_Filesystem::getTree('/dummy'),'Unexpected filelist returned');
        }
 
        public function hash(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $this->assertEquals(md5('foo'), OC_FILESYSTEM::hash('md5','/dummy'),'Unexpected md5 hash of file');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $this->assertEquals(md5('foo'), OC_Filesystem::hash('md5','/dummy'),'Unexpected md5 hash of file');
        }
 
        public function freeSpace(){
-               $oldSpace=OC_FILESYSTEM::free_space('/');
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $newSpace=OC_FILESYSTEM::free_space('/');
+               $oldSpace=OC_Filesystem::free_space('/');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $newSpace=OC_Filesystem::free_space('/');
                $this->assertEquals(true, $newSpace<$oldSpace,'free space not smaller after creating a non empty file');
        }
 
        public function search(){
-               OC_FILESYSTEM::file_put_contents('/dummy','foo');
-               $this->assertEquals(array('/dummy'),OC_FILESYSTEM::search('my'),'unexpected file list after search');
+               OC_Filesystem::file_put_contents('/dummy','foo');
+               $this->assertEquals(array('/dummy'),OC_Filesystem::search('my'),'unexpected file list after search');
        }
 }
 return 'OC_FILEYSYSTEM_Test';