mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-16 17:28:41 +00:00
add ip support for auditor
This commit is contained in:
parent
8d76845dbf
commit
22df970c7f
|
|
@ -198,14 +198,16 @@ final class ApiController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $status Files
|
* @param array $status Files
|
||||||
* @param int $account Uploader
|
* @param int $account Uploader
|
||||||
|
* @param string $virtualPath Virtual path
|
||||||
|
* @param string $ip Ip
|
||||||
*
|
*
|
||||||
* @return Media[]
|
* @return Media[]
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function createDbEntries(array $status, int $account, string $virtualPath = '') : array
|
public function createDbEntries(array $status, int $account, string $virtualPath = '', string $ip = '127.0.0.1') : array
|
||||||
{
|
{
|
||||||
$mediaCreated = [];
|
$mediaCreated = [];
|
||||||
|
|
||||||
|
|
@ -224,7 +226,8 @@ final class ApiController extends Controller
|
||||||
null,
|
null,
|
||||||
PermissionType::READ | PermissionType::MODIFY | PermissionType::DELETE | PermissionType::PERMISSION
|
PermissionType::READ | PermissionType::MODIFY | PermissionType::DELETE | PermissionType::PERMISSION
|
||||||
),
|
),
|
||||||
$account
|
$account,
|
||||||
|
$ip
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -306,7 +309,7 @@ final class ApiController extends Controller
|
||||||
$old = clone MediaMapper::get((int) $request->getData('id'));
|
$old = clone MediaMapper::get((int) $request->getData('id'));
|
||||||
/** @var Media $new */
|
/** @var Media $new */
|
||||||
$new = $this->updateMediaFromRequest($request);
|
$new = $this->updateMediaFromRequest($request);
|
||||||
$this->updateModel($request->getHeader()->getAccount(), $old, $new, MediaMapper::class, 'media');
|
$this->updateModel($request->getHeader()->getAccount(), $old, $new, MediaMapper::class, 'media', $request->getOrigin());
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Media', 'Media successfully updated', $new);
|
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Media', 'Media successfully updated', $new);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -360,7 +363,7 @@ final class ApiController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$collection = $this->createCollectionFromRequest($request);
|
$collection = $this->createCollectionFromRequest($request);
|
||||||
$this->createModel($request->getHeader()->getAccount(), $collection, CollectionMapper::class, 'collection');
|
$this->createModel($request->getHeader()->getAccount(), $collection, CollectionMapper::class, 'collection', $request->getOrigin());
|
||||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Collection', 'Collection successfully created.', $collection);
|
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Collection', 'Collection successfully created.', $collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ use phpOMS\Uri\UriFactory;
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<a class="button" href="<?= UriFactory::build('{/prefix}media/list?path={?path}'); ?>">Back</a>
|
<a tabindex="0" class="button" href="<?= UriFactory::build('{/prefix}media/list?path={?path}'); ?>">Back</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ $media = $this->getData('media');
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<a class="button" href="<?= UriFactory::build('{/prefix}media/upload?path={?path}'); ?>">Upload</a>
|
<a tabindex="0" class="button" href="<?= UriFactory::build('{/prefix}media/upload?path={?path}'); ?>">Upload</a>
|
||||||
<a class="button" href="<?= UriFactory::build('{/prefix}media/file/create?path={?path}'); ?>">Create File</a>
|
<a tabindex="0" class="button" href="<?= UriFactory::build('{/prefix}media/file/create?path={?path}'); ?>">Create File</a>
|
||||||
<a class="button" href="<?= UriFactory::build('{/prefix}media/collection/create?path={?path}'); ?>">Create Collection</a>
|
<a tabindex="0" class="button" href="<?= UriFactory::build('{/prefix}media/collection/create?path={?path}'); ?>">Create Collection</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ use phpOMS\Uri\UriFactory;
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<a class="button" href="<?= UriFactory::build('{/prefix}media/list?path={?path}'); ?>">Back</a>
|
<a tabindex="0" class="button" href="<?= UriFactory::build('{/prefix}media/list?path={?path}'); ?>">Back</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user