Merge branch 'master' of gitorious.org:owncloud/owncloud into ace-editor

This commit is contained in:
Tom Needham 2011-11-07 17:16:56 +00:00
commit 7a8c762e48
58 changed files with 566 additions and 213 deletions

3
.gitignore vendored
View File

@ -40,3 +40,6 @@ nbproject
# Mac OS
.DS_Store
# WebFinger
.well-known

View File

@ -4,8 +4,6 @@ php_value upload_max_filesize 512M
php_value post_max_size 512M
SetEnv htaccessWorking true
</IfModule>
<IfModule !mod_php5.c>
RewriteEngine on
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
</IfModule>
Options -Indexes

View File

@ -71,6 +71,7 @@ include 'Sabre/DAV/IExtendedCollection.php';
/* Node abstract implementations */
include 'Sabre/DAV/Node.php';
include 'Sabre/DAV/File.php';
include 'Sabre/DAV/Collection.php';
include 'Sabre/DAV/Directory.php';
/* Utilities */
@ -124,4 +125,3 @@ include 'Sabre/DAV/Auth/Backend/PDO.php';
/* DavMount plugin */
include 'Sabre/DAV/Mount/Plugin.php';

View File

@ -1,7 +1,9 @@
<?php
/**
* UserAddressBook class
* The AddressBook class represents a CardDAV addressbook, owned by a specific user
*
* The AddressBook can contain multiple vcards
*
* @package Sabre
* @subpackage CardDAV
@ -9,12 +11,6 @@
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
/**
* The AddressBook class represents a CardDAV addressbook, owned by a specific user
*
* The AddressBook can contain multiple vcards
*/
class Sabre_CardDAV_AddressBook extends Sabre_DAV_Collection implements Sabre_CardDAV_IAddressBook, Sabre_DAV_IProperties, Sabre_DAVACL_IACL {
/**

View File

@ -3,20 +3,18 @@
/**
* Abstract Backend class
*
* This class serves as a base-class for addressbook backends
*
* Note that there are references to 'addressBookId' scattered throughout the
* class. The value of the addressBookId is completely up to you, it can be any
* arbitrary value you can use as an unique identifier.
*
* @package Sabre
* @subpackage CardDAV
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
/**
* This class serves as a base-class for addressbook backends
*
* Note that there are references to 'addressBookId' scattered throughout the
* class. The value of the addressBookId is completely up to you, it can be any
* arbitrary value you can use as an unique identifier.
*/
abstract class Sabre_CardDAV_Backend_Abstract {
/**

View File

@ -3,16 +3,14 @@
/**
* PDO CardDAV backend
*
* This CardDAV backend uses PDO to store addressbooks
*
* @package Sabre
* @subpackage CardDAV
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
/**
* This CardDAV backend uses PDO to store addressbooks
*/
class Sabre_CardDAV_Backend_PDO extends Sabre_CardDAV_Backend_Abstract {
/**

View File

@ -1,17 +1,13 @@
<?php
/**
* Card class
* The Card object represents a single Card from an addressbook
*
* @package Sabre
* @subpackage CardDAV
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*
/
/**
* The Card object represents a single Card from an addressbook
*/
class Sabre_CardDAV_Card extends Sabre_DAV_File implements Sabre_CardDAV_ICard, Sabre_DAVACL_IACL {

View File

@ -3,16 +3,14 @@
/**
* Card interface
*
* Extend the ICard interface to allow your custom nodes to be picked up as
* 'Cards'.
*
* @package Sabre
* @subpackage CardDAV
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*
/
/**
* Extend the ICard interface to allow your custom nodes to be picked up as
* 'Cards'.
*/
interface Sabre_CardDAV_ICard extends Sabre_DAV_IFile {

View File

@ -3,17 +3,14 @@
/**
* CardDAV plugin
*
* The CardDAV plugin adds CardDAV functionality to the WebDAV server
*
* @package Sabre
* @subpackage CardDAV
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
/**
* The CardDAV plugin adds CardDAV functionality to the WebDAV server
*/
class Sabre_CardDAV_Plugin extends Sabre_DAV_ServerPlugin {
/**

View File

@ -3,16 +3,14 @@
/**
* UserAddressBooks class
*
* The UserAddressBooks collection contains a list of addressbooks associated with a user
*
* @package Sabre
* @subpackage CardDAV
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
/**
* The UserAddressBooks collection contains a list of addressbooks associated with a user
*/
class Sabre_CardDAV_UserAddressBooks extends Sabre_DAV_Collection implements Sabre_DAV_IExtendedCollection, Sabre_DAVACL_IACL {
/**

View File

@ -3,16 +3,14 @@
/**
* Version Class
*
* This class contains the Sabre_CardDAV version information
*
* @package Sabre
* @subpackage CardDAV
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
/**
* This class contains the Sabre_CardDAV version information
*/
class Sabre_CardDAV_Version {
/**

View File

@ -88,7 +88,7 @@ class Sabre_DAV_Browser_GuessContentType extends Sabre_DAV_ServerPlugin {
protected function getContentType($fileName) {
// Just grabbing the extension
$extension = substr($fileName,strrpos($fileName,'.')+1);
$extension = strtolower(substr($fileName,strrpos($fileName,'.')+1));
if (isset($this->extensionMap[$extension]))
return $this->extensionMap[$extension];

View File

@ -821,7 +821,7 @@ class Sabre_DAV_Server {
$node->put($body);
$this->httpResponse->setHeader('Content-Length','0');
$this->httpResponse->sendStatus(200);
$this->httpResponse->sendStatus(204);
} else {

View File

@ -14,7 +14,7 @@ class Sabre_DAV_Version {
/**
* Full version number
*/
const VERSION = '1.5.3';
const VERSION = '1.5.4';
/**
* Stability : alpha, beta, stable

View File

@ -3,6 +3,9 @@
/**
* NeedPrivileges
*
* The 403-need privileges is thrown when a user didn't have the appropriate
* permissions to perform an operation
*
* @package Sabre
* @subpackage DAVACL
* @version $Id$
@ -10,13 +13,6 @@
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
/**
* NeedPrivileges
*
* The 403-need privileges is thrown when a user didn't have the appropriate
* permissions to perform an operation
*/
class Sabre_DAVACL_Exception_NeedPrivileges extends Sabre_DAV_Exception_Forbidden {
/**

View File

@ -9,7 +9,7 @@
* The users are instances of Sabre_DAV_Auth_Principal
*
* @package Sabre
* @subpackage DAV
* @subpackage DAVACL
* @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
* @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License

View File

@ -83,13 +83,16 @@ class Sabre_VObject_Component extends Sabre_VObject_Element {
if (!is_null($itemValue)) {
throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject');
}
$item->parent = $this;
$this->children[] = $item;
} elseif(is_string($item)) {
if (!is_scalar($itemValue)) {
throw new InvalidArgumentException('The second argument must be scalar');
}
$this->children[] = new Sabre_VObject_Property($item,$itemValue);
$item = new Sabre_VObject_Property($item,$itemValue);
$item->parent = $this;
$this->children[] = $item;
} else {
@ -208,16 +211,19 @@ class Sabre_VObject_Component extends Sabre_VObject_Element {
$overWrite = count($matches)?key($matches):null;
if ($value instanceof Sabre_VObject_Component || $value instanceof Sabre_VObject_Property) {
$value->parent = $this;
if (!is_null($overWrite)) {
$this->children[$overWrite] = $value;
} else {
$this->children[] = $value;
}
} elseif (is_scalar($value)) {
$property = new Sabre_VObject_Property($name,$value);
$property->parent = $this;
if (!is_null($overWrite)) {
$this->children[$overWrite] = new Sabre_VObject_Property($name,$value);
$this->children[$overWrite] = $property;
} else {
$this->children[] = new Sabre_VObject_Property($name,$value);
$this->children[] = $property;
}
} else {
throw new InvalidArgumentException('You must pass a Sabre_VObject_Component, Sabre_VObject_Property or scalar type');
@ -237,6 +243,7 @@ class Sabre_VObject_Component extends Sabre_VObject_Element {
foreach($matches as $k=>$child) {
unset($this->children[$k]);
$child->parent = null;
}

View File

@ -116,7 +116,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
list(
$this->dateType,
$this->dateTime
) = self::parseData($this->value, $this->offsetGet('TZID'));
) = self::parseData($this->value, $this);
return $this->dateTime;
}
@ -137,7 +137,7 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
list(
$this->dateType,
$this->dateTime,
) = self::parseData($this->value, $this->offsetGet('TZID'));
) = self::parseData($this->value, $this);
return $this->dateType;
}
@ -152,11 +152,11 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
*
* @param string|null $propertyValue The string to parse (yymmdd or
* ymmddThhmmss, etc..)
* @param string|null $tzid The value of the 'TZID' property.
* @param Sabre_VObject_Property|null $property The instance of the
* property we're parsing.
* @return array
*/
static public function parseData($propertyValue, $tzid) {
static public function parseData($propertyValue, Sabre_VObject_Property $property = null) {
if (is_null($propertyValue)) {
return array(null, null);
@ -195,6 +195,8 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
);
}
// Finding the timezone.
$tzid = $property['TZID'];
if (!$tzid) {
return array(
self::LOCAL,
@ -202,7 +204,32 @@ class Sabre_VObject_Element_DateTime extends Sabre_VObject_Property {
);
}
try {
$tz = new DateTimeZone($tzid->value);
} catch (Exception $e) {
// The id was invalid, we're going to try to find the information
// through the VTIMEZONE object.
// First we find the root object
$root = $property;
while($root->parent) {
$root = $root->parent;
}
if (isset($root->VTIMEZONE)) {
foreach($root->VTIMEZONE as $vtimezone) {
if (((string)$vtimezone->TZID) == $tzid) {
if (isset($vtimezone->{'X-LIC-LOCATION'})) {
$tzid = (string)$vtimezone->{'X-LIC-LOCATION'};
}
}
}
}
$tz = new DateTimeZone($tzid);
}
$dt = new DateTime($dateStr, $tz);
$dt->setTimeZone($tz);

View File

@ -121,7 +121,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
list(
$type,
$dt
) = Sabre_VObject_Element_DateTime::parseData($val, $this->offsetGet('TZID'));
) = Sabre_VObject_Element_DateTime::parseData($val, $this);
$dts[] = $dt;
$this->dateType = $type;
}
@ -154,7 +154,7 @@ class Sabre_VObject_Element_MultiDateTime extends Sabre_VObject_Property {
list(
$type,
$dt
) = Sabre_VObject_Element_DateTime::parseData($val, $this->offsetGet('TZID'));
) = Sabre_VObject_Element_DateTime::parseData($val, $this);
$dts[] = $dt;
$this->dateType = $type;
}

View File

@ -25,6 +25,13 @@ abstract class Sabre_VObject_Node implements IteratorAggregate, ArrayAccess, Cou
*/
protected $iterator = null;
/**
* A link to the parent node
*
* @var Sabre_VObject_Node
*/
protected $parent = null;
/* {{{ IteratorAggregator interface */
/**

View File

@ -149,13 +149,16 @@ class Sabre_VObject_Property extends Sabre_VObject_Element {
if (!is_null($itemValue)) {
throw new InvalidArgumentException('The second argument must not be specified, when passing a VObject');
}
$item->parent = $this;
$this->parameters[] = $item;
} elseif(is_string($item)) {
if (!is_scalar($itemValue)) {
throw new InvalidArgumentException('The second argument must be scalar');
}
$this->parameters[] = new Sabre_VObject_Parameter($item,$itemValue);
$parameter = new Sabre_VObject_Parameter($item,$itemValue);
$parameter->parent = $this;
$this->parameters[] = $parameter;
} else {
@ -231,12 +234,15 @@ class Sabre_VObject_Property extends Sabre_VObject_Element {
throw new InvalidArgumentException('A parameter name must be specified. This means you cannot use the $array[]="string" to add parameters.');
$this->offsetUnset($name);
$this->parameters[] = new Sabre_VObject_Parameter($name, $value);
$parameter = new Sabre_VObject_Parameter($name, $value);
$parameter->parent = $this;
$this->parameters[] = $parameter;
} elseif ($value instanceof Sabre_VObject_Parameter) {
if (!is_null($name))
throw new InvalidArgumentException('Don\'t specify a parameter name if you\'re passing a Sabre_VObject_Parameter. Add using $array[]=$parameterObject.');
$value->parent = $this;
$this->parameters[] = $value;
} else {
throw new InvalidArgumentException('You can only add parameters to the property object');
@ -258,6 +264,7 @@ class Sabre_VObject_Property extends Sabre_VObject_Element {
$result = array();
foreach($this->parameters as $key=>$parameter) {
if ($parameter->name == $name) {
$parameter->parent = null;
unset($this->parameters[$key]);
}

View File

@ -95,7 +95,7 @@ class Sabre_VObject_Reader {
while(stripos($nextLine,"END:")!==0) {
$obj->children[] = self::readLine($lines);
$obj->add(self::readLine($lines));
$nextLine = current($lines);
if ($nextLine===false)
@ -140,7 +140,9 @@ class Sabre_VObject_Reader {
if ($matches['parameters']) {
$obj->parameters = self::readParameters($matches['parameters']);
foreach(self::readParameters($matches['parameters']) as $param) {
$obj->add($param);
}
}
return $obj;

View File

@ -14,7 +14,7 @@ class Sabre_VObject_Version {
/**
* Full version number
*/
const VERSION = '1.2.2';
const VERSION = '1.2.4';
/**
* Stability : alpha, beta, stable

View File

@ -0,0 +1,9 @@
<?php
$l=new OC_L10N('admin_dependencies_chk');
OC_App::register( array(
'order' => 14,
'id' => 'admin_dependencies_chk',
'name' => 'Owncloud Install Info' ));
OC_APP::registerAdmin('admin_dependencies_chk','settings');

View File

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<info>
<id>admin_dependencies_chk</id>
<name>Owncloud dependencies info</name>
<version>0.01</version>
<licence>AGPL</licence>
<author>Brice Maron (eMerzh)</author>
<require>2</require>
<description>Display OwnCloud's dependencies informations (missings modules, ...)</description>
<default_enable/>
</info>

View File

@ -0,0 +1,9 @@
#status_list legend { font-weight: bold; color: #888888; }
.state > li { margin-bottom: 3px; padding-left: 0.5em; list-style-type: circle; }
.state .state_module { font-weight:bold; text-shadow: 0 1px 0 #DDD; cursor:help;}
.state_used ul, .state_used li { display:inline; }
.state_ok .state_module { color: #009700; }
.state_warning .state_module { color: #FF9B29; }
.state_error .state_module { color: #FF3B3B; }

View File

@ -0,0 +1,96 @@
<?php
/**
* ownCloud - user_ldap
*
* @author Brice Maron
* @copyright 2011 Brice Maron brice __from__ bmaron _DOT_ net
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
$l=new OC_L10N('admin_dependencies_chk');
$tmpl = new OC_Template( 'admin_dependencies_chk', 'settings');
$modules = array();
//Possible status are : ok, error, warning
$modules[] =array(
'status' => function_exists('json_encode') ? 'ok' : 'error',
'part'=> 'php-json',
'modules'=> array('core'),
'message'=> $l->t('The php-json module is needed by the many applications for inter communications'));
$modules[] =array(
'status' => function_exists('curl_init') ? 'ok' : 'error',
'part'=> 'php-curl',
'modules'=> array('bookmarks'),
'message'=> $l->t('The php-curl modude is needed to fetch the page title when adding a bookmarks'));
$modules[] =array(
'status' => function_exists('imagepng') ? 'ok' : 'error',
'part'=> 'php-gd',
'modules'=> array('gallery'),
'message'=> $l->t('The php-gd module is needed to create thumbnails of your images'));
$modules[] =array(
'status' => OC_Helper::canExecute("mp3info") ? 'ok' : 'warning',
'part'=> 'mp3info',
'modules'=> array('media'),
'message'=> $l->t('The program mp3info is useful to discover ID3 tags of your music files'));
$modules[] =array(
'status' => OC_Helper::canExecute("ldap_bind") ? 'ok' : 'error',
'part'=> 'php-ldap',
'modules'=> array('user_ldap'),
'message'=> $l->t('The php-ldap module is needed connect to your ldap server'));
$modules[] =array(
'status' => class_exists('ZipArchive') ? 'ok' : 'warning',
'part'=> 'php-zip',
'modules'=> array('admin_export','core'),
'message'=> $l->t('The php-zip module is needed download multiple files at once'));
$modules[] =array(
'status' => function_exists('mb_detect_encoding') ? 'ok' : 'error',
'part'=> 'php-mb_multibyte ',
'modules'=> array('core'),
'message'=> $l->t('The php-mb_multibyte module is needed to manage correctly the encoding.'));
$modules[] =array(
'status' => function_exists('ctype_digit') ? 'ok' : 'error',
'part'=> 'php-ctype',
'modules'=> array('core'),
'message'=> $l->t('The php-ctype module is needed validate data.'));
$modules[] =array(
'status' => ini_get('allow_url_fopen') == '1' ? 'ok' : 'error',
'part'=> 'allow_url_fopen',
'modules'=> array('core'),
'message'=> $l->t('The allow_url_fopen directive of your php.ini should be set to 1 to retrieve knowledge base from OCS servers'));
foreach($modules as $key => $module) {
$enabled = false ;
foreach($module['modules'] as $app) {
if(OC_App::isEnabled($app) || $app=='core'){
$enabled = true;
}
}
if($enabled == false) unset($modules[$key]);
}
OC_UTIL::addStyle('admin_dependencies_chk', 'style');
$tmpl->assign( 'items', $modules );
return $tmpl->fetchPage();

View File

@ -0,0 +1,16 @@
<fieldset id="status_list" class="personalblock">
<legend><?php echo $l->t('Dependencies status');?></legend>
<ul class="state">
<?php foreach($_['items'] as $item):?>
<li class="state_<?php echo $item['status'];?>">
<span class="state_module" title="<?php echo $item['message'];?>"><?php echo $item['part'];?></span>
<div class="state_used"><?php echo $l->t('Used by :');?>
<ul>
<?php foreach($item['modules'] as $module):?>
<li><?php echo $module;?></li>
<?php endforeach;?>
</ul>
</li>
<?php endforeach;?>
</ul>
</fieldset>

View File

@ -54,13 +54,7 @@ $params=array(
);
$query->execute($params);
if($CONFIG_DBTYPE == 'pgsql')
{
$query = OC_DB::prepare("SELECT currval('*PREFIX*bookmarks_id_seq')");
$b_id = $query->execute()->fetchOne();
} else {
$b_id = OC_DB::insertid();
}
$b_id = OC_DB::insertid('*PREFIX*bookmarks');
if($b_id !== false) {

View File

@ -8,6 +8,6 @@
$tmpl = new OC_Template( 'bookmarks', 'settings');
OC_Util::addScript('bookmarks','settings');
//OC_Util::addScript('bookmarks','settings');
return $tmpl->fetchPage();

View File

@ -111,7 +111,7 @@ class OC_Calendar_Calendar{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
return OC_DB::insertid();
return OC_DB::insertid('*PREFIX*calendar_calendar');
}
/**
@ -131,7 +131,7 @@ class OC_Calendar_Calendar{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
return OC_DB::insertid();
return OC_DB::insertid('*PREFIX*calendar_calendars');
}
/**

View File

@ -78,7 +78,7 @@ class OC_Calendar_Object{
OC_Calendar_Calendar::touchCalendar($id);
return OC_DB::insertid();
return OC_DB::insertid('*PREFIX*calendar_objects');
}
/**
@ -97,7 +97,7 @@ class OC_Calendar_Object{
OC_Calendar_Calendar::touchCalendar($id);
return OC_DB::insertid();
return OC_DB::insertid('*PREFIX*calendar_objects');
}
/**

View File

@ -96,7 +96,7 @@ class OC_Contacts_Addressbook{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
return OC_DB::insertid();
return OC_DB::insertid('*PREFIX*contacts_addressbooks');
}
/**
@ -113,7 +113,7 @@ class OC_Contacts_Addressbook{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
return OC_DB::insertid();
return OC_DB::insertid('*PREFIX*contacts_addressbooks');
}
/**

View File

@ -121,7 +121,7 @@ class OC_Contacts_VCard{
OC_Contacts_Addressbook::touch($id);
return OC_DB::insertid();
return OC_DB::insertid('*PREFIX*contacts_cards');
}
/**
@ -147,7 +147,7 @@ class OC_Contacts_VCard{
OC_Contacts_Addressbook::touch($id);
return OC_DB::insertid();
return OC_DB::insertid('*PREFIX*contacts_cards');
}
/**

View File

@ -19,7 +19,7 @@
<ol>
<li class="input stringish">
<label class="label" for="fn"><?php echo $l->t('Name'); ?></label>
<input type="text" name="fn" value=""><br>
<input id="fn" type="text" name="fn" value=""><br>
</li>
<li class="input stringish">
<label class="label" for="org"><?php echo $l->t('Organization'); ?></label>
@ -81,19 +81,19 @@
</li>
<li class="input stringish">
<label class="label" for="adr_street"><?php echo $l->t('Street'); ?></label>
<input type="text" for="adr_street" name="value[ADR][2]" value="">
<input type="text" id="adr_street" name="value[ADR][2]" value="">
</li>
<li class="input stringish">
<label class="label" for="adr_city"><?php echo $l->t('City'); ?></label>
<input type="text" for="adr_city" name="value[ADR][3]" value="">
<input type="text" id="adr_city" name="value[ADR][3]" value="">
</li>
<li class="input stringish">
<label class="label" for="adr_region"><?php echo $l->t('Region'); ?></label>
<input type="text" for="adr_region" name="value[ADR][4]" value="">
<input type="text" id="adr_region" name="value[ADR][4]" value="">
</li>
<li class="input stringish">
<label class="label" for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
<input type="text" for="adr_zipcode" name="value[ADR][5]" value="">
<input type="text" id="adr_zipcode" name="value[ADR][5]" value="">
</li>
<li class="input stringish">
<label class="label" for="adr_country"><?php echo $l->t('Country'); ?></label>

View File

@ -10,7 +10,7 @@ $(document).ready(function() {
type: 'GET',
url: OC.linkTo('files_sharing', 'ajax/getitem.php'),
dataType: 'json',
data: 'source='+file,
data: {source: file},
async: false,
success: function(users) {
if (users) {
@ -46,6 +46,7 @@ $(document).ready(function() {
$('.share').click(function(event) {
event.preventDefault();
event.stopPropagation();
var filenames = getSelectedFiles('name');
var length = filenames.length;
var files = '';
@ -184,8 +185,8 @@ function createDropdown(filename, files) {
html += '<input id="link" style="display:none; width:90%;" />';
html += '</div>';
if (filename) {
$('tr[data-file="'+filename+'"]').addClass('mouseOver');
$(html).appendTo($('tr[data-file="'+filename+'"] td.filename'));
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
$(html).appendTo($('tr').filterAttr('data-file',filename).find('td.filename'));
} else {
$(html).appendTo($('thead .share'));
}

View File

@ -267,7 +267,7 @@ class OC_MEDIA_COLLECTION{
$query=self::$queries['addsong'];
}
$query->execute(array($name,$artist,$album,$path,$uid,$length,$track,$size));
$songId=OC_DB::insertid();
$songId=OC_DB::insertid('*PREFIX*media_songs');
// self::setLastUpdated();
return self::getSongId($name,$artist,$album);
}

View File

@ -4,12 +4,6 @@ class OC_remoteStorage {
public static function getValidTokens($ownCloudUser, $userAddress, $dataScope) {
$query=OC_DB::prepare("SELECT token,appUrl FROM *PREFIX*authtoken WHERE user=? AND userAddress=? AND dataScope=? LIMIT 100");
$result=$query->execute(array($ownCloudUser,$userAddress,$dataScope));
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
die( $entry );
}
$ret = array();
while($row=$result->fetchRow()){
$ret[$row['token']]=$userAddress;
@ -21,12 +15,6 @@ class OC_remoteStorage {
$user=OC_User::getUser();
$query=OC_DB::prepare("SELECT token,appUrl,userAddress,dataScope FROM *PREFIX*authtoken WHERE user=? LIMIT 100");
$result=$query->execute(array($user));
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
die( $entry );
}
$ret = array();
while($row=$result->fetchRow()){
$ret[$row['token']] = array(
@ -42,23 +30,11 @@ class OC_remoteStorage {
$user=OC_User::getUser();
$query=OC_DB::prepare("DELETE FROM *PREFIX*authtoken WHERE token=? AND user=?");
$result=$query->execute(array($token,$user));
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
die( $entry );
}
}
private static function addToken($token, $appUrl, $userAddress, $dataScope){
$user=OC_User::getUser();
$query=OC_DB::prepare("INSERT INTO *PREFIX*authtoken (`token`,`appUrl`,`user`,`userAddress`,`dataScope`) VALUES(?,?,?,?,?)");
$result=$query->execute(array($token,$appUrl,$user,$userAddress,$dataScope));
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
die( $entry );
}
}
public static function createDataScope($appUrl, $userAddress, $dataScope){
$token=uniqid();

View File

@ -4,7 +4,14 @@ if($_SERVER['SCRIPT_NAME'] == '/.well-known/webfinger.php') {
} else {
header('Please-first: activate');
}
header("Content-Type: application/xml+xrd");
// header("Content-Type: application/xml+xrd");
// calculate the documentroot
// modified version of the one in lib/base.php that takes the .well-known symlink into account
$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
$SERVERROOT=str_replace("\\",'/',dirname(dirname(dirname(dirname(__FILE__)))));
$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT));
$WEBROOT=substr($SUBURI,0,-34);
if($_GET['q']) {
$bits = explode('@', $_GET['q']);
@ -20,5 +27,5 @@ echo "<";
?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0">
<hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME'] ?></hm:Host>
<Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/apps/remoteStorage/compat.php/<?php echo $userName ?>/remoteStorage/" />
<Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'].$WEBROOT ?>/apps/remoteStorage/compat.php/<?php echo $userName ?>/remoteStorage/" />
</XRD>

View File

@ -32,14 +32,14 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#35537a', end
/* INPUTS */
input[type="text"], input[type="password"] { cursor:text; }
input, select, .button, #quota, div.jp-progress, .pager li a { font-size:1em; width:10em; margin:.3em; padding:.6em .5em .4em; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; }
input, select, button, .button, #quota, div.jp-progress, .pager li a { font-size:1em; width:10em; margin:.3em; padding:.6em .5em .4em; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; }
input[type="text"], input[type="password"], input[type="search"] { background:#f8f8f8; color:#555; cursor:text; }
input[type="text"], input[type="password"], input[type="search"] { -webkit-appearance:textfield; -moz-appearance:textfield; -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; }
input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active,
input[type="password"]:hover, input[type="password"]:focus, input[type="password"]:active,
.searchbox input[type="search"]:hover, .searchbox input[type="search"]:focus, .searchbox input[type="search"]:active { background-color:#fff; color:#333; opacity:1; }
input[type="submit"], input[type="button"], .button, #quota, div.jp-progress, .pager li a { width:auto; padding:.4em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
input[type="submit"], input[type="button"], button, .button, #quota, div.jp-progress, .pager li a { width:auto; padding:.4em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
input[type="submit"]:hover, input[type="submit"]:focus, input[type="button"]:hover, input[type="button"]:focus, .button:hover { background:#fff; color:#333; }
input[type="checkbox"] { width:auto; }
#quota { cursor:default; }

BIN
core/img/actions/upload.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16"
height="16"
id="svg3875"
version="1.1"
inkscape:version="0.48.1 r9760"
sodipodi:docname="download.svg"
inkscape:export-filename="/home/jancborchardt/owncloud/core/img/actions/play.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs3877" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="17.921875"
inkscape:cx="-5.3403178"
inkscape:cy="10.148736"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:window-width="1280"
inkscape:window-height="776"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid3883"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<metadata
id="metadata3880">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
<path
style="fill:#000000;fill-opacity:1;stroke:none"
d="m 10,1051.3622 -4,0 -1,-7 -4,0 7,-7 7,7 -4,0 z"
id="path3086"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -365,7 +365,7 @@ $(document).ready(function(){
$('.jp-controls .jp-previous').tipsy({gravity:'nw', fade:true, live:true});
$('.jp-controls .jp-next').tipsy({gravity:'n', fade:true, live:true});
$('.password .action').tipsy({gravity:'se', fade:true, live:true});
$('.file_upload_button_wrapper').tipsy({gravity:'e', fade:true});
$('.file_upload_button_wrapper').tipsy({gravity:'w', fade:true});
$('.selectedActions a.delete').tipsy({gravity: 'se', fade:true, live:true});
$('.selectedActions a').tipsy({gravity:'s', fade:true, live:true});
$('#headerSize').tipsy({gravity:'s', fade:true, live:true});
@ -401,3 +401,10 @@ if (!Array.prototype.map){
return res;
};
}
/**
* Filter Jquery selector by attribute value
**/
$.fn.filterAttr = function(attr_name, attr_value) {
return this.filter(function() { return $(this).attr(attr_name) === attr_value; });
};

27
files/ajax/newfile.php Normal file
View File

@ -0,0 +1,27 @@
<?php
// Init owncloud
require_once('../../lib/base.php');
OC_JSON::checkLoggedIn();
// Get the params
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
$filename = isset( $_GET['filename'] ) ? $_GET['filename'] : '';
$content = isset( $_GET['content'] ) ? $_GET['content'] : '';
if($filename == '') {
OC_JSON::error(array("data" => array( "message" => "Empty Filename" )));
exit();
}
if(OC_Files::newFile($dir, $filename, 'file')) {
if($content){
OC_Filesystem::file_put_contents($dir.'/'.$filename,$content);
}
OC_JSON::success(array("data" => array('content'=>$content)));
exit();
}
OC_JSON::error(array("data" => array( "message" => "Error when creating the file" )));

View File

@ -3,15 +3,22 @@
See the COPYING-README file. */
/* FILE MENU */
.actions { padding:.3em; float:left; }
.actions input { margin:0; }
.actions { padding:.3em; float:left; height:2em; }
.actions input, .actions button, .actions .button { margin:0; }
#file_menu { right:0; position:absolute; top:0; }
#file_menu a { display:block; float:left; background-image:none; text-decoration:none; }
.file_upload_form, #file_newfolder_form { display:inline; float: left; margin-left:.5em; }
.file_upload_form, #file_newfolder_form { display:inline; float: left; margin-left:0; }
#fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; }
.file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .5em; padding-left:2em; }
.file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin:.1em .1em .1em 0em;}
.file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin:0;}
.file_upload_wrapper .file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; }
#new { float:left; border-top-right-radius:0; border-bottom-right-radius:0; margin:0 0 0 1em; border-right:none; z-index:1010; height:1.3em; }
#new.active { border-bottom-left-radius:0; border-bottom:none; background:#f8f8f8 }
#new>a{ padding-left:1em; padding-right:1em; }
#new>ul { display:none; position:fixed; text-align:left; padding:.5em; background:#f8f8f8; margin-top:0.075em; border:1px solid #ddd; min-width:7em; margin-left:-.5em; z-index:-1; }
#new>ul>li { margin:.3em; padding-left:2em; background-repeat:no-repeat; cursor:pointer; padding-bottom:0.1em }
#new>ul>li>p { cursor:pointer; }
#new>ul>li>input { padding:0.3em; margin:-0.3em; }
#file_newfolder_name { background-image:url('../../core/img/places/folder.svg'); font-weight:normal; width:7em; }
.file_upload_start, .file_upload_filename { font-size:1em; }
@ -19,7 +26,9 @@
.file_upload_target { display:none; }
.file_upload_start { opacity:0; filter:alpha(opacity=0); z-index:1; position:absolute; left:0; top:0; width:100%; cursor:pointer;}
.file_upload_filename { z-index:100; cursor:pointer;}
.file_upload_filename.active { border-bottom-right-radius:0 }
.file_upload_filename { z-index:100; cursor:pointer; border-top-left-radius:0; border-bottom-left-radius:0; padding:.3em; }
.file_upload_form, .file_upload_wrapper, .file_upload_start, .file_upload_filename, #file_upload_submit { cursor:pointer; }

View File

@ -56,7 +56,7 @@ FileActions={
$('#fileList .action').remove();
var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
var file=FileActions.getCurrentFile();
if($('tr[data-file="'+file+'"]').data('renaming')){
if($('tr').filterAttr('data-file',file).data('renaming')){
return;
}
var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType());

View File

@ -4,7 +4,7 @@ FileList={
},
addFile:function(name,size,lastModified,loading){
var img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png');
var html='<tr data-file="'+name+'" data-type="file" data-size="'+size+'">';
var html='<tr data-type="file" data-size="'+size+'">';
if(name.indexOf('.')!=-1){
var basename=name.substr(0,name.lastIndexOf('.'));
var extention=name.substr(name.lastIndexOf('.'));
@ -29,16 +29,21 @@ FileList={
html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';
html+='<td class="date"><span class="modified" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</span></td>';
html+='</tr>';
FileList.insertElement(name,'file',$(html));
FileList.insertElement(name,'file',$(html).attr('data-file',name));
if(loading){
$('tr[data-file="'+name+'"]').data('loading',true);
$('tr').filterAttr('data-file',name).data('loading',true);
}else{
$('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
$('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions);
}
},
addDir:function(name,size,lastModified){
var html='<tr data-file="'+name+'" data-type="dir" data-size="'+size+'">';
html+='<td class="filename" style="background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')"><input type="checkbox" /><a class="name" href="index.php?dir='+$('#dir').val()+'/'+name+'">'+name+'</a></td>';
html = $('<tr></tr>').attr({ "data-type": "dir", "data-size": size, "data-file": name});
td = $('<td></td>').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' });
td.append('<input type="checkbox" />');
var link_elem = $('<a></a>').attr({ "class": "name", "href": "index.php?dir="+ encodeURIComponent($('#dir').val()+'/'+name) });
link_elem.append($('<span></span>').addClass('nametext').text(name));
td.append(link_elem);
html.append(td);
if(size!='Pending'){
simpleSize=simpleFileSize(size);
}else{
@ -47,13 +52,15 @@ FileList={
sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2));
lastModifiedTime=Math.round(lastModified.getTime() / 1000);
modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5);
html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';
html+='<td class="date"><span class="modified" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</span></td>';
html+='</tr>';
td = $('<td></td>').attr({ "class": "filesize", "title": humanFileSize(size), "style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'}).text(simpleSize);
html.append(td);
FileList.insertElement(name,'dir',$(html));
$('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
$('tr[data-file="'+name+'"] td.filename').droppable(folderDropOptions);
td = $('<td></td>').attr({ "class": "date" });
td.append($('<span></span>').attr({ "class": "modified", "title": formatDate(lastModified), "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' }).text( relative_modified_date(lastModified.getTime() / 1000) ));
html.append(td);
FileList.insertElement(name,'dir',html);
$('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions);
$('tr').filterAttr('data-file',name).find('td.filename').droppable(folderDropOptions);
},
refresh:function(data) {
result = jQuery.parseJSON(data.responseText);
@ -64,8 +71,8 @@ FileList={
resetFileActionPanel();
},
remove:function(name){
$('tr[data-file="'+name+'"] td.filename').draggable('destroy');
$('tr[data-file="'+name+'"]').remove();
$('tr').filterAttr('data-file',name).find('td.filename').draggable('destroy');
$('tr').filterAttr('data-file',name).remove();
if($('tr[data-file]').length==0){
$('#emptyfolder').show();
$('.file_upload_filename').addClass('highlight');
@ -101,7 +108,7 @@ FileList={
$('.file_upload_filename').removeClass('highlight');
},
loadingDone:function(name){
var tr=$('tr[data-file="'+name+'"]');
var tr=$('tr').filterAttr('data-file',name);
tr.data('loading',false);
var mime=tr.data('mime');
tr.attr('data-mime',mime);
@ -111,13 +118,13 @@ FileList={
tr.find('td.filename').draggable(dragOptions);
},
isLoading:function(name){
return $('tr[data-file="'+name+'"]').data('loading');
return $('tr').filterAttr('data-file',name).data('loading');
},
rename:function(name){
var tr=$('tr[data-file="'+name+'"]');
var tr=$('tr').filterAttr('data-file',name);
tr.data('renaming',true);
var td=tr.children('td.filename');
var input=$('<input value="'+name+'" class="filename"></input>');
var input=$('<input class="filename"></input>').val(name);
var form=$('<form action="#"></form>')
form.append(input);
td.children('a.name').text('');
@ -143,7 +150,7 @@ FileList={
}
$.ajax({
url: 'ajax/rename.php',
data: "dir="+$('#dir').val()+"&newname="+encodeURIComponent(newname)+"&file="+encodeURIComponent(name)
data: { dir : $('#dir').val(), newname: newname, file: name }
});
});
form.click(function(event){
@ -165,9 +172,10 @@ FileList={
files=[files];
}
$.each(files,function(index,file){
$('tr[data-file="'+file+'"]').hide();
$('tr[data-file="'+file+'"]').find('input[type="checkbox"]').removeAttr('checked');
$('tr[data-file="'+file+'"]').removeClass('selected');
var files = $('tr').filterAttr('data-file',file);
files.hide();
files.find('input[type="checkbox"]').removeAttr('checked');
files.removeClass('selected');
});
procesSelection();
FileList.deleteCanceled=false;
@ -208,7 +216,7 @@ $(document).ready(function(){
if($('#notification').data('deletefile'))
{
$.each(FileList.deleteFiles,function(index,file){
$('tr[data-file="'+file+'"]').show();
$('tr').filterAttr('data-file',file).show();
// alert(file);
});
FileList.deleteCanceled=true;

View File

@ -1,4 +1,9 @@
$(document).ready(function() {
$('#fileList tr').each(function(){
//little hack to set unescape filenames in attribute
$(this).attr('data-file',decodeURIComponent($(this).attr('data-file')));
});
if($('tr[data-file]').length==0){
$('.file_upload_filename').addClass('highlight');
}
@ -64,7 +69,7 @@ $(document).ready(function() {
}
procesSelection();
} else {
var filename=$(this).parent().parent().data('file');
var filename=$(this).parent().parent().attr('data-file');
if(!FileList.isLoading(filename)){
var mime=$(this).parent().parent().data('mime');
var type=$(this).parent().parent().data('type');
@ -158,7 +163,7 @@ $(document).ready(function() {
});
$('.file_upload_start').live('change',function(){
var form=$(this).parent().parent();
var form=$(this).closest('form');
var uploadId=form.attr('data-upload-id');
var files=this.files;
var target=form.children('iframe');
@ -185,9 +190,9 @@ $(document).ready(function() {
if(response[0] != undefined && response[0].status == 'success'){
for(var i=0;i<response.length;i++){
var file=response[i];
$('tr[data-file="'+file.name+'"]').data('mime',file.mime);
$('tr').filterAttr('data-file',file.name).data('mime',file.mime);
if(size=='Pending'){
$('tr[data-file='+file.name+'] td.filesize').text(file.size);
$('tr').filterAttr('data-file',file.name).find('td.filesize').text(file.size);
}
FileList.loadingDone(file.name);
}
@ -255,32 +260,82 @@ $(document).ready(function() {
text=text.substr(0,text.length-6)+'...';
crumb.text(text);
}
$(window).click(function(){
$('#new>ul').hide();
$('#new').removeClass('active');
$('button.file_upload_filename').removeClass('active');
$('#new li').each(function(i,element){
if($(element).children('p').length==0){
$(element).children('input').remove();
$(element).append('<p>'+$(element).data('text')+'</p>');
}
});
});
$('#new').click(function(event){
event.stopPropagation();
});
$('#new>a').click(function(){
$('#new>ul').toggle();
$('#new').toggleClass('active');
$('button.file_upload_filename').toggleClass('active');
});
$('#new li').click(function(){
if($(this).children('p').length==0){
return;
}
$('#new li').each(function(i,element){
if($(element).children('p').length==0){
$(element).children('input').remove();
$(element).append('<p>'+$(element).data('text')+'</p>');
}
});
var type=$(this).data('type');
var text=$(this).children('p').text();
$(this).data('text',text);
$(this).children('p').remove();
var input=$('<input>');
$(this).append(input);
input.focus();
input.change(function(){
var name=$(this).val();
switch(type){
case 'file':
$.ajax({
url: OC.filePath('files','ajax','newfile.php'),
data: "dir="+encodeURIComponent($('#dir').val())+"&filename="+encodeURIComponent(name)+'&content=%20%0A',
complete: function(data){boolOperationFinished(data, function(){
var date=new Date();
FileList.addFile(name,0,date);
var tr=$('tr').filterAttr('data-file',name);
tr.data('mime','text/plain');
getMimeIcon('text/plain',function(path){
tr.find('td.filename').attr('style','background-image:url('+path+')');
});
});}
});
break;
case 'folder':
$.ajax({
url: OC.filePath('files','ajax','newfolder.php'),
data: "dir="+encodeURIComponent($('#dir').val())+"&foldername="+encodeURIComponent(name),
complete: function(data){boolOperationFinished(data, function(){
var date=new Date();
FileList.addDir(name,0,date);
});}
});
break;
}
var li=$(this).parent();
$(this).remove();
li.append('<p>'+li.data('text')+'</p>');
$('#new>a').click();
});
});
});
var adjustNewFolderSize = function() {
if($('#file_newfolder_name').val() != '') {
splitSize($('#file_newfolder_name'),$('#file_newfolder_submit'));
$('#file_newfolder_name').unbind('keyup', adjustNewFolderSize);
};
}
function splitSize(existingEl, appearingEl) {
nw = parseInt($(existingEl).css('width')) - parseInt($(appearingEl).css('width'));
$(existingEl).css('width', nw + 'px');
$(appearingEl).fadeIn(250);
}
function unsplitSize(stayingEl, vanishingEl) {
nw = parseInt($(stayingEl).css('width')) + parseInt($(vanishingEl).css('width'));
$(stayingEl).css('width', nw + 'px');
$(vanishingEl).fadeOut(250);
}
function resetFileActionPanel() {
$('#file_action_panel form').css({"display":"none"});
$('#file_action_panel').attr('activeAction', false);
}
function boolOperationFinished(data, callback) {
result = jQuery.parseJSON(data.responseText);
if(result.status == 'success'){
@ -343,7 +398,7 @@ var folderDropOptions={
url: 'ajax/move.php',
data: "dir="+dir+"&file="+file+'&target='+dir+'/'+target,
complete: function(data){boolOperationFinished(data, function(){
var el=$('#fileList tr[data-file="'+file+'"] td.filename');
var el = $('#fileList tr').filterAttr('data-file',file).find('td.filename');
el.draggable('destroy');
FileList.remove(file);
});}
@ -445,7 +500,7 @@ function getSelectedFiles(property){
var files=[];
elements.each(function(i,element){
var file={
name:$(element).data('file'),
name:$(element).attr('data-file'),
mime:$(element).data('mime'),
type:$(element).data('type'),
size:$(element).data('size'),

View File

@ -2,20 +2,27 @@
<?php echo($_['breadcrumb']); ?>
<?php if (!isset($_['readonly']) || !$_['readonly']) {?>
<div class="actions">
<div id='new' class='button'>
<a>
<?php echo $l->t('New');?>
</a>
<ul class="popup popupTop">
<li style="background-image:url('<?php echo mimetype_icon('text/plain') ?>')" data-type='file'><p><?php echo $l->t('Text file');?></p></li>
<li style="background-image:url('<?php echo mimetype_icon('dir') ?>')" data-type='folder'><p><?php echo $l->t('Folder');?></p></li>
<!-- <li style="background-image:url('<?php echo mimetype_icon('dir') ?>')" data-type='web'><p><?php echo $l->t('From the web');?></p></li> -->
</ul>
</div>
<div class="file_upload_wrapper svg">
<form data-upload-id='1' class="file_upload_form" action="ajax/upload.php" method="post" enctype="multipart/form-data" target="file_upload_target_1">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
<div class="file_upload_wrapper svg">
<input type="submit" class="file_upload_filename" value="<?php echo $l->t('Upload'); ?>"/>
<button class="file_upload_filename"><img class='svg action' alt="Upload" src="<?php echo image_path("core", "actions/upload.svg"); ?>" /></button>
<input class="file_upload_start" type="file" name='files[]'/>
<a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo 'max. '.$_['uploadMaxHumanFilesize'] ?>"></a>
</div>
<a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo $l->t('Upload'); echo ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a>
<iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe>
</form>
<form id="file_newfolder_form">
<input class="svg" type="text" name="file_newfolder_name" id="file_newfolder_name" value="" placeholder="<?php echo $l->t('New Folder')?>" />
</form>
</div>
</div>
<div id="file_action_panel">
</div>

View File

@ -5,7 +5,7 @@
$relative_modified_date = relative_modified_date($file['mtime']);
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14
if($relative_date_color>200) $relative_date_color = 200; ?>
<tr data-file="<?php echo $file['name'];?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
<tr data-file="<?php echo str_replace('+','%20',urlencode($file['name']));?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
<td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)">
<?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?>
<a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].$file['directory'].'/'.$file['name']; else echo $_['downloadURL'].urlencode($file['directory']).'/'.urlencode($file['name']); ?>" title="">

View File

@ -77,6 +77,9 @@ class OC{
// set some stuff
//ob_start();
error_reporting(E_ALL | E_STRICT);
if (defined('DEBUG') && DEBUG){
ini_set('display_errors', 1);
}
date_default_timezone_set('Europe/Berlin');
ini_set('arg_separator.output','&amp;');

View File

@ -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::fopen($this->path,'r');
}

View File

@ -224,6 +224,7 @@ class OC_DB {
/**
* @brief gets last value of autoincrement
* @param $table string The optional table name (will replace *PREFIX*) and add sequence suffix
* @returns id
*
* MDB2 lastInsertID()
@ -231,9 +232,14 @@ class OC_DB {
* Call this method right after the insert command or other functions may
* cause trouble!
*/
public static function insertid(){
public static function insertid($table=null){
self::connect();
return self::$connection->lastInsertId();
if($table !== null){
$prefix = OC_Config::getValue( "dbtableprefix", "oc_" );
$suffix = OC_Config::getValue( "dbsequencesuffix", "_id_seq" );
$table = str_replace( '*PREFIX*', $prefix, $table );
}
return self::$connection->lastInsertId($table.$suffix);
}
/**

View File

@ -84,6 +84,11 @@ class OC_Filestorage_Local extends OC_Filestorage{
return $return;
}
public function rename($path1,$path2){
if(! $this->file_exists($path1)){
OC_Log::write('core','unable to rename, file does not exists : '.$path1,OC_Log::ERROR);
return false;
}
if($return=rename($this->datadir.$path1,$this->datadir.$path2)){
$this->clearFolderSizeCache($path1);
$this->clearFolderSizeCache($path2);

View File

@ -59,6 +59,9 @@ class OC_Log{
return array();
}
$fh=fopen($logFile,'r');
if($fh === false){ // Unable to read log file!
return array();
}
while(!feof($fh)){
$line=fgets($fh);
if($line){

View File

@ -108,6 +108,7 @@ class OC_OCSClient{
$xml=@file_get_contents($url);
if($xml==FALSE){
OC_Log::write('core','Unable to parse OCS content',OC_Log::FATAL);
return NULL;
}
$data=simplexml_load_string($xml);
@ -143,6 +144,7 @@ class OC_OCSClient{
$kbe=array();
$xml=@file_get_contents($url);
if($xml==FALSE){
OC_Log::write('core','Unable to parse knowledgebase content',OC_Log::FATAL);
return NULL;
}
$data=simplexml_load_string($xml);

View File

@ -82,7 +82,7 @@ class OC_Setup {
$dbpass = $options['dbpass'];
$dbname = $options['dbname'];
$dbhost = $options['dbhost'];
$dbtableprefix = OC_Config::getValue('dbtableprefix','oc_');
$dbtableprefix = $options['dbtableprefix'];
OC_Config::setValue('dbname', $dbname);
OC_Config::setValue('dbhost', $dbhost);
OC_Config::setValue('dbtableprefix', $dbtableprefix);
@ -135,7 +135,7 @@ class OC_Setup {
$dbpass = $options['dbpass'];
$dbname = $options['dbname'];
$dbhost = $options['dbhost'];
$dbtableprefix = OC_Config::getValue('dbtableprefix','oc_');
$dbtableprefix = $options['dbtableprefix'];
OC_CONFIG::setValue('dbname', $dbname);
OC_CONFIG::setValue('dbhost', $dbhost);
OC_CONFIG::setValue('dbtableprefix', $dbtableprefix);

View File

@ -9,7 +9,10 @@
<?php
$url=OC_Helper::linkTo( "settings", "help.php" ).'?page=';
$pageNavi=OC_Util::getPageNavi($_['pagecount'],$_['page'],$url);
if($pageNavi)
{
$pageNavi->printPage();
}
?>
</diV>
<?php if(is_null($_["kbe"])):?>