Commit bafd684e authored by Jakob Sack's avatar Jakob Sack
Browse files

Renaming classes :-)

parent 220132ca
......@@ -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;
......
......@@ -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
......
......@@ -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{
......
......@@ -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{
......
......@@ -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" )));
......
......@@ -4,6 +4,6 @@
require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
OC_APP::disable($_POST['appid']);
OC_App::disable($_POST['appid']);
?>
......@@ -4,6 +4,6 @@
require_once('../../lib/base.php');
header( "Content-Type: application/jsonrequest" );
OC_APP::enable($_POST['appid']);
OC_App::enable($_POST['appid']);
?>
......@@ -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{
......
......@@ -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{
......
......@@ -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
......
<?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" )));
?>
......@@ -22,14 +22,14 @@
*/
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();
......
......@@ -22,14 +22,14 @@
*/
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();
?>
......
......@@ -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; ?>
......
......@@ -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>
......
......@@ -22,34 +22,34 @@
*/
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();
......
<?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' );
}
?>
......@@ -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();
......
<?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" )));
?>
......@@ -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();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment