new parameter to set the date/time for touch, default the the current time

This commit is contained in:
Ralf Becker 2008-01-30 06:43:55 +00:00
parent 6f9e01d386
commit fbc8aa7be7

View File

@ -604,6 +604,7 @@
*/ */
function acl_check ($data) function acl_check ($data)
{ {
//error_log(__METHOD__.'('.print_r($data,true).')');
if (!is_array ($data)) if (!is_array ($data))
{ {
$data = array (); $data = array ();
@ -928,7 +929,8 @@
$default_values = array $default_values = array
( (
'relatives' => array (RELATIVE_CURRENT) 'relatives' => array (RELATIVE_CURRENT),
'time' => $this->now,
); );
$data = array_merge ($this->default_values ($data, $default_values), $data); $data = array_merge ($this->default_values ($data, $default_values), $data);
@ -950,7 +952,7 @@
PHP's touch function will automatically decide whether to PHP's touch function will automatically decide whether to
create the file or set the modification time create the file or set the modification time
*/ */
$rr = @touch ($p->real_full_path); $rr = @touch ($p->real_full_path,$data['time']);
if ($p->outside) if ($p->outside)
{ {
@ -979,7 +981,7 @@
'relatives' => array ($p->mask), 'relatives' => array ($p->mask),
'attributes' => array( 'attributes' => array(
'modifiedby_id' => $account_id, 'modifiedby_id' => $account_id,
'modified' => $this->now 'modified' => $data['time'],
) )
) )
); );
@ -1007,7 +1009,7 @@
'relatives' => array ($p->mask), 'relatives' => array ($p->mask),
'attributes' => array ( 'attributes' => array (
'createdby_id' => $account_id, 'createdby_id' => $account_id,
'created' => $this->now, 'created' => $data['time'],
'size' => 0, 'size' => 0,
'deleteable' => 'Y', 'deleteable' => 'Y',
'app' => $currentapp 'app' => $currentapp