Api - give error if share path is missing

This commit is contained in:
nathangray 2019-07-31 09:46:55 -06:00
parent 0f5aaa3ed9
commit 890cd4e4a4
2 changed files with 8 additions and 0 deletions

View File

@ -1902,6 +1902,10 @@ var AppJS = (function(){ "use strict"; return Class.extend(
*/
share_link: function(_action, _senders, _target, _writable, _files, _callback){
var path = _senders[0].id;
if(!path)
{
return this.egw.message(this.egw.lang('Missing share path. Unable to create share.'), 'error');
}
if(typeof _writable === 'undefined' && _action.parent && _action.parent.getActionById('shareWritable'))
{
_writable = _action.parent.getActionById('shareWritable').checked || false;

View File

@ -611,6 +611,10 @@ class Sharing
*/
public static function ajax_create($action, $path, $writable = false, $files = false, $extra = array())
{
if(!$path)
{
throw new Exception\WrongParameter('Missing share path. Unable to create share.');
}
$class = self::get_share_class(array('share_path' => $path));
$extra = $extra + array(
'share_writable' => $writable,