[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc class.vfs_sql.inc.php
From: |
Caeies |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc class.vfs_sql.inc.php |
Date: |
Fri, 22 Dec 2006 23:53:55 +0000 |
CVSROOT: /cvsroot/phpgwapi
Module name: phpgwapi
Changes by: Caeies <Caeies> 06/12/22 23:53:55
Modified files:
inc : class.vfs_sql.inc.php
Log message:
fixing E_ALL, and bad things with php5.2 + mysql > 5
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/class.vfs_sql.inc.php?cvsroot=phpgwapi&r1=1.36&r2=1.37
Patches:
Index: class.vfs_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/class.vfs_sql.inc.php,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- class.vfs_sql.inc.php 20 Sep 2006 09:37:32 -0000 1.36
+++ class.vfs_sql.inc.php 22 Dec 2006 23:53:55 -0000 1.37
@@ -8,7 +8,7 @@
* @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General
Public License
* @package phpgwapi
* @subpackage vfs
- * @version $Id: class.vfs_sql.inc.php,v 1.36 2006/09/20 09:37:32 Caeies
Exp $
+ * @version $Id: class.vfs_sql.inc.php,v 1.37 2006/12/22 23:53:55 Caeies
Exp $
*/
/**
@@ -207,7 +207,7 @@
$p = $this->path_parts (array ('string' =>
$data['string'], 'relatives' => array ($data['relatives'][0])));
/* We check that they have some sort of access to the
file other than read */
- if (!$this->acl_check (array ('string' =>
$p->fake_full_path, 'relatives' => array ($p->mask), 'operation' =>
PHPGW_ACL_WRITE)) &&
+ if (!$this->acl_check (array ('string' =>
$p->fake_full_path, 'relatives' => array ($p->mask), 'operation' =>
PHPGW_ACL_ADD)) &&
!$this->acl_check (array ('string' =>
$p->fake_full_path, 'relatives' => array ($p->mask), 'operation' =>
PHPGW_ACL_EDIT)) &&
!$this->acl_check (array ('string' =>
$p->fake_full_path, 'relatives' => array ($p->mask), 'operation' =>
PHPGW_ACL_DELETE)))
{
@@ -230,8 +230,9 @@
$file_array = $ls_array[0];
$sql = 'INSERT INTO phpgw_vfs (';
- $sql2 .= ' VALUES (';
+ $sql2 = ' VALUES (';
$morethanone = False;
+ $modified = False;
for ($i = 0; list ($attribute, $value) = each
($file_array); $i++)
{
@@ -343,7 +344,7 @@
$version_parts[1] = 0;
$version_parts[0]++;
}
-
+ $newversion = '';
for ($j = 0; $j < $newnumofparts; $j++)
{
if (!isset ($version_parts[$j]))
@@ -368,7 +369,7 @@
)
);
}
- if (isset ($value))
+ if (isset ($value) && !empty($value))
{
if ($morethanone)
{
@@ -394,6 +395,7 @@
or move the 'journal' entries to 'journal-deleted'.
Kind of hackish, but they
provide a consistent feel to the system
*/
+ $flush_path = '';
if ($data['operation'] == VFS_OPERATION_CREATED)
{
$flush_path = $p->fake_full_path;
@@ -802,7 +804,7 @@
$conf->read_repository();
if ($this->file_actions || $p->outside)
{
- if ($fp = fopen ($p->real_full_path, 'rb'))
+ if (filesize ($p->real_full_path) > 0 && $fp =
fopen ($p->real_full_path, 'rb'))
{
$contents = fread ($fp, filesize
($p->real_full_path));
fclose ($fp);
@@ -1985,6 +1987,7 @@
$sql = 'UPDATE phpgw_vfs SET ';
$change_attributes = 0;
+ $edited_comment = False;
reset ($this->attributes);
while (list ($num, $attribute) = each
($this->attributes))
@@ -1999,7 +2002,7 @@
*/
if ($attribute == 'comment' &&
$data['attributes'][$attribute] != $record[$attribute])
{
- $edited_comment = 1;
+ $edited_comment = True;
}
$$attribute = $this->clean_string
(array ('string' => $$attribute));
@@ -2225,7 +2228,7 @@
if ( ($ftype != 'Directory' || $data['nofiles'] ) &&
!$p->outside)
{
/* SELECT all, the, attributes */
- $sql = 'SELECT ' . $sql .= implode(', ',
$this->attributes)
+ $sql = 'SELECT ' . implode(', ',
$this->attributes)
. " FROM phpgw_vfs WHERE
directory='{$p->fake_leading_dirs_clean}' AND name='{$p->fake_name_clean}' "
. $this->extra_sql (array
('query_type' => VFS_SQL_SELECT));
- [Phpgroupware-cvs] phpgwapi/inc class.vfs_sql.inc.php,
Caeies <=