Commit cf8ae6c0eecd2a4b279c1af9ea7c4e3766668a11

Authored by conradverm
1 parent f9105f2b

WSA-78

"download manager does not construct a full url for the webservice download"
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Martin Kirsten


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7748 c91229c3-7414-0410-bfa2-8a42b809f60b
ktwebservice/KTDownloadManager.inc.php
@@ -2,39 +2,39 @@ @@ -2,39 +2,39 @@
2 2
3 /** 3 /**
4 * 4 *
5 - * $Id:$ 5 + * $Id$
6 * 6 *
7 * KTDownloadManager manages files in the download_files table. 7 * KTDownloadManager manages files in the download_files table.
8 * 8 *
9 * KnowledgeTree Open Source Edition 9 * KnowledgeTree Open Source Edition
10 * Document Management Made Simple 10 * Document Management Made Simple
11 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited 11 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited
12 - * 12 + *
13 * This program is free software; you can redistribute it and/or modify it under 13 * This program is free software; you can redistribute it and/or modify it under
14 * the terms of the GNU General Public License version 3 as published by the 14 * the terms of the GNU General Public License version 3 as published by the
15 * Free Software Foundation. 15 * Free Software Foundation.
16 - * 16 + *
17 * This program is distributed in the hope that it will be useful, but WITHOUT 17 * This program is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 19 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
20 * details. 20 * details.
21 - * 21 + *
22 * You should have received a copy of the GNU General Public License 22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>. 23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 - * 24 + *
25 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, 25 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
26 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com. 26 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
27 - * 27 + *
28 * The interactive user interfaces in modified source and object code versions 28 * The interactive user interfaces in modified source and object code versions
29 * of this program must display Appropriate Legal Notices, as required under 29 * of this program must display Appropriate Legal Notices, as required under
30 * Section 5 of the GNU General Public License version 3. 30 * Section 5 of the GNU General Public License version 3.
31 - * 31 + *
32 * In accordance with Section 7(b) of the GNU General Public License version 3, 32 * In accordance with Section 7(b) of the GNU General Public License version 3,
33 * these Appropriate Legal Notices must retain the display of the "Powered by 33 * these Appropriate Legal Notices must retain the display of the "Powered by
34 - * KnowledgeTree" logo and retain the original copyright notice. If the display of the 34 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
35 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices 35 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
36 - * must display the words "Powered by KnowledgeTree" and retain the original  
37 - * copyright notice. 36 + * must display the words "Powered by KnowledgeTree" and retain the original
  37 + * copyright notice.
38 * Contributor( s): ______________________________________ 38 * Contributor( s): ______________________________________
39 * 39 *
40 */ 40 */
@@ -57,7 +57,10 @@ class KTDownloadManager @@ -57,7 +57,10 @@ class KTDownloadManager
57 $config = &KTConfig::getSingleton(); 57 $config = &KTConfig::getSingleton();
58 58
59 $this->age = $config->get('webservice/downloadExpiry',5); 59 $this->age = $config->get('webservice/downloadExpiry',5);
60 - $this->download_url = $config->get('webservice/downloadUrl'); 60 +
  61 + $protocol = $config->get('KnowledgeTree/sslEnabled')?'https':'http';
  62 +
  63 + $this->download_url = $protocol . '://' . $_SERVER['HTTP_HOST'] . $config->get('webservice/downloadUrl');
61 $this->random=$config->get('webservice/randomKeyText','jhsdf8q1jkjpoiudfs7sd3ds1'); 64 $this->random=$config->get('webservice/randomKeyText','jhsdf8q1jkjpoiudfs7sd3ds1');
62 } 65 }
63 66
ktwebservice/nunit/makefile
1 -RESULTS= authentication.result document_detail.result document_add.result document_checkout.result document_type.result document_links.result document_owner.result document_rename.result document_history.result document_workflow.result document_copy.result folder.result document_metadata.result document_system_metadata.result query.result  
2 -#document_download.result 1 +RESULTS= authentication.result document_detail.result document_add.result document_checkout.result document_type.result document_links.result document_owner.result document_rename.result document_history.result document_workflow.result document_copy.result folder.result document_metadata.result document_system_metadata.result query.result document_download.result
3 PROXY=KTproxy.cs 2 PROXY=KTproxy.cs
4 WSDL=ktdms.wsdl 3 WSDL=ktdms.wsdl
5 ROOT_URL=http://ktdms.trunk 4 ROOT_URL=http://ktdms.trunk