From 6fb84bb8cdcdfe36513448f4b9e019de0073c5ae Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 6 Sep 2010 07:57:10 +0000 Subject: [PATCH 01/47] include 250 in checking the error-codes when sending data, as 250 indicates success -> OK (354 indicates intermediate status, and was the only status checked for) --- phpgwapi/inc/class.smtp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.smtp.php b/phpgwapi/inc/class.smtp.php index e16df7a9f5..8cefb83e11 100644 --- a/phpgwapi/inc/class.smtp.php +++ b/phpgwapi/inc/class.smtp.php @@ -345,7 +345,7 @@ class SMTP { error_log(__METHOD__.' Line:'.__LINE__."->". "SMTP -> FROM SERVER:" . $rply . $this->CRLF ); } - if($code != 354) { + if($code != 354 && $code != 250) { $this->error = array("error" => "DATA command not accepted from server", "smtp_code" => $code, From 488959aa5faac984e36f99ba6d3c337c19b1395f Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 6 Sep 2010 09:29:05 +0000 Subject: [PATCH 02/47] filemanager: JavaScript IE8Compat myStylite Ticket#835 Send filemanager entry by mail --- filemanager/inc/class.filemanager_ui.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index f37a2c3810..0796fcf176 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -301,7 +301,7 @@ class filemanager_ui function open_mail(attachments) { var link = '".egw::link('/index.php',array('menuaction' => 'felamimail.uicompose.compose'))."'; - + var i = 0; if (!(attachments instanceof Array)) attachments = [ attachments ]; for(i=0; i < attachments.length; i++) From 5e47dcd0da0c32389103d0826106690de445c8a1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 6 Sep 2010 14:09:27 +0000 Subject: [PATCH 03/47] calling job with data array, plus all regular job data, like eg. next (time job was supposted to run) --- phpgwapi/inc/class.asyncservice.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.asyncservice.inc.php b/phpgwapi/inc/class.asyncservice.inc.php index c2c5cb3ecd..fa6c5045e8 100644 --- a/phpgwapi/inc/class.asyncservice.inc.php +++ b/phpgwapi/inc/class.asyncservice.inc.php @@ -426,7 +426,7 @@ class asyncservice list($app) = strpos($job['method'],'::') !== false ? explode('_',$job['method']) : explode('.',$job['method']); translation::add_app($app); - ExecMethod($job['method'],$job['data']); + ExecMethod($job['method'],$job['data']+array_diff_key($job,array('data' => false))); // re-read job, in case it had been updated or even deleted in the method $updated = $this->read($id); From 78862a1335b41b7991cb1f26ba2910faac7f0ce6 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 6 Sep 2010 15:17:53 +0000 Subject: [PATCH 04/47] idots: fix for IE8 Compatibility; resources select box was not shown in calendar sidebox --- phpgwapi/templates/idots/css/idots.css | 1 + phpgwapi/templates/idots/css/traditional.css | 1 + 2 files changed, 2 insertions(+) diff --git a/phpgwapi/templates/idots/css/idots.css b/phpgwapi/templates/idots/css/idots.css index 31d65446a8..5a12bd04d8 100644 --- a/phpgwapi/templates/idots/css/idots.css +++ b/phpgwapi/templates/idots/css/idots.css @@ -29,6 +29,7 @@ .textSidebox { border-top: 1px solid #d3d3d3; + padding-left: 2px; } .divSidebox table { diff --git a/phpgwapi/templates/idots/css/traditional.css b/phpgwapi/templates/idots/css/traditional.css index a10399a082..b389473e6b 100755 --- a/phpgwapi/templates/idots/css/traditional.css +++ b/phpgwapi/templates/idots/css/traditional.css @@ -210,6 +210,7 @@ a.textSidebox { padding-top:3px; padding-bottom:3px; + padding-left: 2px; border-top: solid #aaaaaa 1px; overflow: auto; } From a7e0270be1a0e82444fc57507aa095ea2204e9bc Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 6 Sep 2010 15:50:50 +0000 Subject: [PATCH 05/47] idots: IE8 Compatibility, reduce to 1pxpadding-left; resources select box was not shown in calendar sidebox --- phpgwapi/templates/idots/css/idots.css | 2 +- phpgwapi/templates/idots/css/traditional.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpgwapi/templates/idots/css/idots.css b/phpgwapi/templates/idots/css/idots.css index 5a12bd04d8..6d545abf1d 100644 --- a/phpgwapi/templates/idots/css/idots.css +++ b/phpgwapi/templates/idots/css/idots.css @@ -29,7 +29,7 @@ .textSidebox { border-top: 1px solid #d3d3d3; - padding-left: 2px; + padding-left: 1px; } .divSidebox table { diff --git a/phpgwapi/templates/idots/css/traditional.css b/phpgwapi/templates/idots/css/traditional.css index b389473e6b..3f9049f4c8 100755 --- a/phpgwapi/templates/idots/css/traditional.css +++ b/phpgwapi/templates/idots/css/traditional.css @@ -210,7 +210,7 @@ a.textSidebox { padding-top:3px; padding-bottom:3px; - padding-left: 2px; + padding-left: 1px; border-top: solid #aaaaaa 1px; overflow: auto; } From f978418d79d118f73b5090e80dbf09bf1d00c0f2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 7 Sep 2010 08:27:25 +0000 Subject: [PATCH 06/47] * fixed private contacts not synced for an owner filter, which is NOT the current user, filter out private entries --- addressbook/inc/class.addressbook_sql.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.addressbook_sql.inc.php b/addressbook/inc/class.addressbook_sql.inc.php index 7356122db8..61c22853e9 100644 --- a/addressbook/inc/class.addressbook_sql.inc.php +++ b/addressbook/inc/class.addressbook_sql.inc.php @@ -278,7 +278,8 @@ class addressbook_sql extends so_sql_cf { if (!($filter['owner'] = array_intersect((array)$filter['owner'],array_keys($this->grants)))) return false; - $filter['private'] = 0; + // for an owner filter, which is NOT the current user, filter out private entries + if ($filter['owner'] != $GLOBALS['egw_info']['user']['account_id']) $filter['private'] = 0; } else // search all addressbooks, incl. accounts { From 2777c78d74c4d34ff039801747c41bf4f93cc1c5 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 7 Sep 2010 11:05:20 +0000 Subject: [PATCH 07/47] new mount option for filesystem streamwrapper to specify a download url, to be used instead of default webdav.php download, eg. if mounted directory is already in the docroot or mapped via an alias --- phpgwapi/inc/class.egw_vfs.inc.php | 4 ++ .../class.filesystem_stream_wrapper.inc.php | 39 +++++++++++++++++++ phpgwapi/inc/class.vfs_stream_wrapper.inc.php | 19 +++++++++ 3 files changed, 62 insertions(+) diff --git a/phpgwapi/inc/class.egw_vfs.inc.php b/phpgwapi/inc/class.egw_vfs.inc.php index 45c6bfc039..de7b2d5421 100644 --- a/phpgwapi/inc/class.egw_vfs.inc.php +++ b/phpgwapi/inc/class.egw_vfs.inc.php @@ -1167,6 +1167,10 @@ class egw_vfs extends vfs_stream_wrapper */ static function download_url($path,$force_download=false) { + if (($url = self::_call_on_backend('download_url',array($path,$force_download),true))) + { + return $url; + } if ($path[0] != '/') { $path = parse_url($path,PHP_URL_PATH); diff --git a/phpgwapi/inc/class.filesystem_stream_wrapper.inc.php b/phpgwapi/inc/class.filesystem_stream_wrapper.inc.php index 2e7c77327b..c01706fa25 100644 --- a/phpgwapi/inc/class.filesystem_stream_wrapper.inc.php +++ b/phpgwapi/inc/class.filesystem_stream_wrapper.inc.php @@ -23,6 +23,8 @@ * - mode: mode bit for the path, default 0005 (read and execute for nobody) * - exec: false (default) = do NOT allow to upload or modify scripts, true = allow it (if docroot is mounted, this allows to run scripts!) * scripts are considered every file having a script-extension (eg. .php, .pl, .py), defined with SCRIPT_EXTENSION_PREG constant + * - url: download url, if NOT a regular webdav.php download should be used, eg. because directory already + * lies within the docroot or is mapped via an alias * * To correctly support characters with special meaning in url's (#?%), we urlencode them with egw_vfs::encodePathComponent * and urldecode all path again, before passing them to php's filesystem functions. @@ -683,6 +685,9 @@ class filesystem_stream_wrapper implements iface_stream_wrapper case 'mode': $mode = egw_vfs::mode2int($value); break; + case 'url': + // ignored, only used for download_url method + break; default: error_log(__METHOD__."('$query') unknown option '$name'!"); break; @@ -711,6 +716,40 @@ class filesystem_stream_wrapper implements iface_stream_wrapper } return $deny; } + + /** + * URL to download a file + * + * We use our webdav handler as download url instead of an own download method. + * The webdav hander (filemanager/webdav.php) recognices eGW's session cookie and of cause understands regular GET requests. + * + * @param string $url + * @param boolean $force_download=false add header('Content-disposition: filename="' . basename($path) . '"'), currently not supported! + * @todo get $force_download working through webdav + * @return string|false string with full download url or false to use default webdav.php url + */ + static function download_url($url,$force_download=false) + { + list(,$query) = explode('?',$url,2); + parse_str($query,$get); + if (empty($get['url'])) return false; // no download url given for this mount-point + + if (!($mount_url = egw_vfs::mount_url($url))) return false; // no mount url found, should not happen + list($mount_url) = explode('?',$mount_url); + + list($url,$query) = explode('?',$url,2); + $relpath = substr($url,strlen($mount_url)); + + $download_url = egw_vfs::concat($get['url'],$relpath); + if ($download_url[0] == '/') + { + $download_url = ($_SERVER['HTTPS'] ? 'https://' : 'http://'). + $_SERVER['HTTP_HOST'].$download_url; + } + + //die(__METHOD__."('$url') --> relpath = $relpath --> $download_url"); + return $download_url; + } } stream_register_wrapper(filesystem_stream_wrapper::SCHEME ,'filesystem_stream_wrapper'); diff --git a/phpgwapi/inc/class.vfs_stream_wrapper.inc.php b/phpgwapi/inc/class.vfs_stream_wrapper.inc.php index 9f0b5ea1a2..eafb84059f 100644 --- a/phpgwapi/inc/class.vfs_stream_wrapper.inc.php +++ b/phpgwapi/inc/class.vfs_stream_wrapper.inc.php @@ -201,6 +201,25 @@ class vfs_stream_wrapper implements iface_stream_wrapper trigger_error(__METHOD__."($path) can't resolve path!\n",E_USER_WARNING); return false; } + + /** + * Returns mount url of a full url returned by resolve_url + * + * @param string $fullurl full url returned by resolve_url + * @return string|NULL mount url or null if not found + */ + static function mount_url($fullurl) + { + foreach(array_reverse(self::$fstab) as $mounted => $url) + { + list($url_no_query) = explode('?',$url); + if (substr($fullurl,0,1+strlen($url_no_query)) === $url_no_query.'/') + { + return $url; + } + } + return null; + } /** * This method is called immediately after your stream object is created. From a709044415f2d40eece2518a9894b8dabdb3277b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 7 Sep 2010 11:57:31 +0000 Subject: [PATCH 08/47] only use egw::link on egw_vfs::download_url, if it is still a path (relative to EGroupware install dir), allowing filesystem streamwrapper to return a complete direct url --- filemanager/inc/class.filemanager_select.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/filemanager/inc/class.filemanager_select.inc.php b/filemanager/inc/class.filemanager_select.inc.php index f0a4dd3792..06dcda694b 100644 --- a/filemanager/inc/class.filemanager_select.inc.php +++ b/filemanager/inc/class.filemanager_select.inc.php @@ -181,9 +181,11 @@ class filemanager_select } else { + $download_url = egw_vfs::download_url(egw_vfs::concat($content['path'],$content['name'])); + if ($download_url[0] == '/') $download_url = egw::link($download_url); $js = "window.opener.CKEDITOR.tools.callFunction(". $content['ckeditorfuncnum'].",'". - htmlspecialchars(egw::link(egw_vfs::download_url(egw_vfs::concat($content['path'],$content['name']))))."',". + htmlspecialchars($download_url)."',". "'');\nwindow.close();"; } header('Content-type: text/html; charset='.translation::charset()); From cdc0d2fb5ed9ad316a064355bc0cafbfd9875272 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 7 Sep 2010 12:17:19 +0000 Subject: [PATCH 09/47] fixed warning if data is no array and modified method signature to allow only an array or NULL as parameter (seems that is the way it is used so far) --- phpgwapi/inc/class.asyncservice.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.asyncservice.inc.php b/phpgwapi/inc/class.asyncservice.inc.php index fa6c5045e8..a83ba74f61 100644 --- a/phpgwapi/inc/class.asyncservice.inc.php +++ b/phpgwapi/inc/class.asyncservice.inc.php @@ -65,13 +65,13 @@ class asyncservice * eg. 'X' where id is the internal id of app and X might indicate the action. * @param string $method Method to be called via ExecMethod($method,$data). $method has the form * '..'. - * @param mixed $data This data is passed back when the method is called. It might simply be an - * integer id, but it can also be a complete array. + * @param array $data=null This data is passed back when the method is called. EGroupware adds the + * rest of the job parameters like id, next (sheduled exec time), times, ... * @param int $account_id account_id, under which the methode should be called or False for the actual user * @param boolean $debug=false * @return boolean False if $id already exists, else True */ - function set_timer($times,$id,$method,$data,$account_id=False,$debug=false) + function set_timer($times,$id,$method,array $data=null,$account_id=False,$debug=false) { if (empty($id) || empty($method) || $this->read($id) || !($next = $this->next_run($times,$debug))) @@ -426,7 +426,7 @@ class asyncservice list($app) = strpos($job['method'],'::') !== false ? explode('_',$job['method']) : explode('.',$job['method']); translation::add_app($app); - ExecMethod($job['method'],$job['data']+array_diff_key($job,array('data' => false))); + ExecMethod($job['method'],(array)$job['data']+array_diff_key($job,array('data' => false))); // re-read job, in case it had been updated or even deleted in the method $updated = $this->read($id); From c3fe8e2ded1c7d7d762003b9a9e53701089e95e9 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 7 Sep 2010 14:48:13 +0000 Subject: [PATCH 10/47] fix for scrollbar for searchfield in calendar sidebox for safari; provided by Chr.Fueller --- calendar/inc/class.calendar_ui.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index 60a04cd28f..878dded371 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -648,7 +648,7 @@ class calendar_ui $blur = addslashes(html::htmlspecialchars(lang('Search').'...')); $value = @$_POST['keywords'] ? html::htmlspecialchars($_POST['keywords']) : $blur; $file[++$n] = array( - 'text' => html::form(' html::form('', '','/index.php',array('menuaction'=>'calendar.calendar_uilist.listview')), @@ -749,6 +749,7 @@ class calendar_ui