Commit eee5a712ad8ad2969f396b4d3d4b7891c08a4d1a

Authored by kevin_fourie
1 parent dcc54e73

Merged in from DEV trunk...

KTS-673
"The search algorithm needs some work"
Updated. Typo with internationalisation

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-2497
"Creation of a new thread fails with: 'DB error: unknown error'"
Fixed. Set defaults to null and not -1

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-2497
"Creation of a new thread fails with: 'DB error: unknown error'"
Fixed. change nullable fields on discussion_threads

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-2446
"CLONE -Skins don't disply properly on portlets in IE 6 (SUP-464)"
Fixed. Updated css for skin

Committed By: Jalaloedien Abrahams
Reviewed By: Conrad Vermeulen

KTS-2328
"When adding an Authentication source the 'Required' fields are marked as a 'Required' but the requirement is not enforced."

Fixed
Added a check for each of the required fields

Committed By: Jonathan Byrne
Reviewed By: Jalaloedien Abrahams

BBS-1009
"Folder or files with the Test Character set as their names cannot be manipulated in WebDAV in any way."
Added validation functions for special characters - /\?,.:"'*. Validation is on adding / renaming folders and documents.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen

KTS-1753
" Implement Disk Usage Plugin"
Implemented. short php tag

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-1753
"Implement Disk Usage Plugin"
Updated. Added some comments and increased thresholds

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-2503
"Ports in openoffice python files are incorrect"
Changed port to 8100. Also added LGPL DocumentConvertor.py which seems good.

Committed By: Kevin Fourie
Reviewed By: Conrad Vermeulen




git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@7395 c91229c3-7414-0410-bfa2-8a42b809f60b
bin/openoffice/DocumentConverter.py 0 → 100644
  1 +#
  2 +# PyODConverter (Python OpenDocument Converter) v0.9 - 2007-04-05
  3 +#
  4 +# This script converts a document from one office format to another by
  5 +# connecting to an OpenOffice.org instance via Python-UNO bridge.
  6 +#
  7 +# Copyright (C) 2007 Mirko Nasato <mirko@artofsolving.com>
  8 +# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
  9 +#
  10 +DEFAULT_OPENOFFICE_PORT = 8100
  11 +
  12 +import uno
  13 +from os.path import abspath, splitext
  14 +from com.sun.star.beans import PropertyValue
  15 +from com.sun.star.connection import NoConnectException
  16 +
  17 +FAMILY_PRESENTATION = "Presentation"
  18 +FAMILY_SPREADSHEET = "Spreadsheet"
  19 +FAMILY_TEXT = "Text"
  20 +
  21 +FAMILY_BY_EXTENSION = {
  22 + "odt": FAMILY_TEXT,
  23 + "sxw": FAMILY_TEXT,
  24 + "doc": FAMILY_TEXT,
  25 + "rtf": FAMILY_TEXT,
  26 + "txt": FAMILY_TEXT,
  27 + "wpd": FAMILY_TEXT,
  28 + "html": FAMILY_TEXT,
  29 + "ods": FAMILY_SPREADSHEET,
  30 + "sxc": FAMILY_SPREADSHEET,
  31 + "xls": FAMILY_SPREADSHEET,
  32 + "odp": FAMILY_PRESENTATION,
  33 + "sxi": FAMILY_PRESENTATION,
  34 + "ppt": FAMILY_PRESENTATION
  35 +}
  36 +
  37 +FILTER_BY_EXTENSION = {
  38 + "pdf": {
  39 + FAMILY_TEXT: "writer_pdf_Export",
  40 + FAMILY_SPREADSHEET: "calc_pdf_Export",
  41 + FAMILY_PRESENTATION: "impress_pdf_Export"
  42 + },
  43 + "html": {
  44 + FAMILY_TEXT: "HTML (StarWriter)",
  45 + FAMILY_SPREADSHEET: "HTML (StarCalc)",
  46 + FAMILY_PRESENTATION: "impress_html_Export"
  47 + },
  48 + "odt": { FAMILY_TEXT: "writer8" },
  49 + "doc": { FAMILY_TEXT: "MS Word 97" },
  50 + "rtf": { FAMILY_TEXT: "Rich Text Format" },
  51 + "txt": { FAMILY_TEXT: "Text" },
  52 + "ods": { FAMILY_SPREADSHEET: "calc8" },
  53 + "xls": { FAMILY_SPREADSHEET: "MS Excel 97" },
  54 + "odp": { FAMILY_PRESENTATION: "impress8" },
  55 + "ppt": { FAMILY_PRESENTATION: "MS PowerPoint 97" },
  56 + "swf": { FAMILY_PRESENTATION: "impress_flash_Export" }
  57 +}
  58 +
  59 +
  60 +class DocumentConversionException(Exception):
  61 +
  62 + def __init__(self, message):
  63 + self.message = message
  64 +
  65 + def __str__(self):
  66 + return self.message
  67 +
  68 +
  69 +def _unoProps(**args):
  70 + props = []
  71 + for key in args:
  72 + prop = PropertyValue()
  73 + prop.Name = key
  74 + prop.Value = args[key]
  75 + props.append(prop)
  76 + return tuple(props)
  77 +
  78 +
  79 +class DocumentConverter:
  80 +
  81 + def __init__(self, port=DEFAULT_OPENOFFICE_PORT):
  82 + localContext = uno.getComponentContext()
  83 + resolver = localContext.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", localContext)
  84 + try:
  85 + context = resolver.resolve("uno:socket,host=localhost,port=%s;urp;StarOffice.ComponentContext" % port)
  86 + except NoConnectException:
  87 + raise DocumentConversionException, "failed to connect to OpenOffice.org on port %s" % port
  88 + self.desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context)
  89 +
  90 + def convert(self, inputFile, outputFile):
  91 + inputExt = self._fileExt(inputFile)
  92 + outputExt = self._fileExt(outputFile)
  93 +
  94 + filterName = self._filterName(inputExt, outputExt)
  95 +
  96 + inputUrl = self._fileUrl(argv[1])
  97 + outputUrl = self._fileUrl(argv[2])
  98 +
  99 + document = self.desktop.loadComponentFromURL(inputUrl, "_blank", 0, _unoProps(Hidden=True, ReadOnly=True))
  100 + document.storeToURL(outputUrl, _unoProps(FilterName=filterName))
  101 + document.close(True)
  102 +
  103 + def _filterName(self, inputExt, outputExt):
  104 + try:
  105 + family = FAMILY_BY_EXTENSION[inputExt]
  106 + except KeyError:
  107 + raise DocumentConversionException, "unknown input format: '%s'" % inputExt
  108 + try:
  109 + filterByFamily = FILTER_BY_EXTENSION[outputExt]
  110 + except KeyError:
  111 + raise DocumentConversionException, "unknown output format: '%s'" % outputExt
  112 + try:
  113 + return filterByFamily[family]
  114 + except KeyError:
  115 + raise DocumentConversionException, "unsupported conversion: from '%s' to '%s'" % (inputExt, outputExt)
  116 +
  117 + def _fileExt(self, path):
  118 + ext = splitext(path)[1]
  119 + if ext is not None:
  120 + return ext[1:].lower()
  121 +
  122 + def _fileUrl(self, path):
  123 + return uno.systemPathToFileUrl(abspath(path))
  124 +
  125 +
  126 +if __name__ == "__main__":
  127 + from sys import argv, exit
  128 +
  129 + if len(argv) < 3:
  130 + print "USAGE: " + argv[0] + " <input-file> <output-file>"
  131 + exit(255)
  132 +
  133 + try:
  134 + converter = DocumentConverter()
  135 + converter.convert(argv[1], argv[2])
  136 + except DocumentConversionException, exception:
  137 + print "ERROR! " + str(exception)
  138 + exit(1)
  139 +
... ...
bin/openoffice/pdfgen.py
... ... @@ -45,7 +45,7 @@ try:
45 45 ### Get Service Manager
46 46 context = uno.getComponentContext()
47 47 resolver = context.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", context)
48   - ctx = resolver.resolve("uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")
  48 + ctx = resolver.resolve("uno:socket,host=localhost,port=8100;urp;StarOffice.ComponentContext")
49 49 smgr = ctx.ServiceManager
50 50  
51 51 ### Load document
... ...
config/config.ini
... ... @@ -339,6 +339,13 @@ safemode = on
339 339 explorerMetadataCapture = true
340 340 officeMetadataCapture = true
341 341  
  342 +; settings for the Disk Usage dashlet
342 343 [DiskUsage]
343   -warningThreshold=5
344   -urgentThreshold=1
  344 +; When free space in a mount point is less than this percentage,
  345 +; the disk usage dashlet will will highlight the mount in ORANGE
  346 +warningThreshold=10
  347 +
  348 +; When free space in a mount point is less than this percentage,
  349 +; the disk usage dashlet will will highlight the mount in RED
  350 +urgentThreshold=5
  351 +
... ...
lib/discussions/DiscussionThread.inc
... ... @@ -8,7 +8,7 @@
8 8 * License Version 1.1.2 ("License"); You may not use this file except in
9 9 * compliance with the License. You may obtain a copy of the License at
10 10 * http://www.knowledgetree.com/KPL
11   - *
  11 + *
12 12 * Software distributed under the License is distributed on an "AS IS"
13 13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
14 14 * See the License for the specific language governing rights and
... ... @@ -19,9 +19,9 @@
19 19 * (ii) the KnowledgeTree copyright notice
20 20 * in the same form as they appear in the distribution. See the License for
21 21 * requirements.
22   - *
  22 + *
23 23 * The Original Code is: KnowledgeTree Open Source
24   - *
  24 + *
25 25 * The Initial Developer of the Original Code is The Jam Warehouse Software
26 26 * (Pty) Ltd, trading as KnowledgeTree.
27 27 * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright
... ... @@ -34,15 +34,15 @@ class DiscussionThread extends KTEntity{
34 34 var $_bUsePearError = true;
35 35  
36 36 var $iDocumentId;
37   - var $iFirstCommentId = -1;
38   - var $iLastCommentId = -1;
  37 + var $iFirstCommentId = null;
  38 + var $iLastCommentId = null;
39 39 var $iNumberOfViews = 0;
40 40 var $iNumberOfReplies = 0;
41 41 var $iState = 0;
42 42 var $iCloseMetadataVersion = 0;
43 43 var $sCloseReason = "";
44 44 var $iCreatorId;
45   -
  45 +
46 46 var $_aFieldToSelect = array(
47 47 'iId' => 'id',
48 48 'iDocumentId' => 'document_id',
... ... @@ -55,7 +55,7 @@ class DiscussionThread extends KTEntity{
55 55 'sCloseReason' => 'close_reason',
56 56 'iCreatorId' => 'creator_id',
57 57 );
58   -
  58 +
59 59 /**
60 60 * DiscussionThread Constructor
61 61 */
... ... @@ -82,21 +82,21 @@ class DiscussionThread extends KTEntity{
82 82 function incrementNumberOfViews() { $this->iNumberOfViews += 1; }
83 83 function getNumberOfReplies(){ return $this->iNumberOfReplies; }
84 84 function incrementNumberOfReplies(){ $this->iNumberOfReplies += 1; }
85   - function setNumberOfReplies($iValue){ $this->iNumberOfReplies = $iValue; }
  85 + function setNumberOfReplies($iValue){ $this->iNumberOfReplies = $iValue; }
86 86 function getState(){ return $this->iState; }
87 87 function setState($iValue){ $this->iState = $iValue; }
88 88 function getCloseMetadataVersion(){ return $this->iCloseMetadataVersion; }
89 89 function setCloseMetadataVersion($iValue){ $this->iCloseMetadataVersion = $iValue; }
90 90 function getCloseReason(){ return $this->sCloseReason; }
91 91 function setCloseReason($sValue){ $this->sCloseReason = $sValue; }
92   -
93   -
  92 +
  93 +
94 94 /**
95 95 * Get a All commentId's seperated by a comma ","
96 96 */
97 97 function getAllCommentId() {
98 98 global $default;
99   -
  99 +
100 100 $sql = $default->db;
101 101 $aQuery = array("SELECT id FROM $default->discussion_threads_table WHERE document_id = ? ORDER BY id",/*ok*/
102 102 $this->iDocumentId);
... ... @@ -104,28 +104,28 @@ class DiscussionThread extends KTEntity{
104 104 if ($result) {
105 105 $sql->next_record();
106 106 $iThreadId = $sql->f("id");
107   -
  107 +
108 108 $aQuery = array("SELECT id FROM $default->discussion_comments_table WHERE thread_id = ? ORDER BY date DESC",/*ok*/
109 109 $iThreadId);
110 110 $result = $sql->query($aQuery);
111   -
112   - if ($result) {
  111 +
  112 + if ($result) {
113 113 while ($sql->next_record()) {
114 114 if ($sql->f("id") > 0) {
115   - $sAllCommentId .= $sql->f("id") . ",";
  115 + $sAllCommentId .= $sql->f("id") . ",";
116 116 } else {
117   - //Id not valid
118   - }
  117 + //Id not valid
  118 + }
119 119 }
120   - return $sAllCommentId ;
  120 + return $sAllCommentId ;
121 121 }
122 122 return false;
123 123 } else {
124 124 // No Thread for document
125 125 return false;
126   - }
127   - }
128   -
  126 + }
  127 + }
  128 +
129 129 /**
130 130 * Static function
131 131 * Get a list of DiscussionThreads
... ... @@ -137,15 +137,15 @@ class DiscussionThread extends KTEntity{
137 137 function getList($sWhereClause = null) {
138 138 return KTEntityUtil::getList(DiscussionThread::_table(), 'DiscussionThread', $sWhereClause);
139 139 }
140   -
  140 +
141 141 function getThreadIdforDoc($iDocumentId){
142   - global $default;
  142 + global $default;
143 143 $sql = $default->db;
144 144 $result = $sql->query(array("SELECT id FROM $default->discussion_threads_table WHERE document_id = ?", $iDocumentId));/*ok*/
145   - if ($result) {
  145 + if ($result) {
146 146 if ($sql->next_record()) {
147 147 if ($sql->f("id") > 0) {
148   - return $sql->f("id");
  148 + return $sql->f("id");
149 149 } else {
150 150 return "false";
151 151 }
... ... @@ -154,8 +154,8 @@ class DiscussionThread extends KTEntity{
154 154 }
155 155 return false;
156 156 }
157   -
158   -
  157 +
  158 +
159 159 function &get($iId) {
160 160 return KTEntityUtil::get('DiscussionThread', $iId);
161 161 }
... ...
lib/validation/dispatchervalidation.inc.php
... ... @@ -225,6 +225,26 @@ class KTDispatcherValidation {
225 225 return $sString;
226 226 }
227 227  
  228 + function validateIllegalCharacters($sString, $aOptions = null) {
  229 + $sString = trim($sString);
  230 + if (empty($sString)) {
  231 + $aOptions['message'] = KTUtil::arrayGet($aOptions,
  232 + 'message', _kt("An empty string was given"));
  233 + $this->handleError($aOptions);
  234 + }
  235 +
  236 + // illegal characters: /\ <>|%+':"?*
  237 + $pattern = "[\*|\%|\\\|\/|\<|\>|\+|\:|\?|\||\'|\"]";
  238 + if(preg_match($pattern, $sString)){
  239 + $sChars = "\/<>|%+*':\"?";
  240 + $sMessage = sprintf(_kt('The value you have entered is invalid. The following characters are not allowed: %s'), $sChars);
  241 + $aOptions['message'] = KTUtil::arrayGet($aOptions, 'illegal_character_message', $sMessage);
  242 + $this->handleError($aOptions);
  243 + }
  244 +
  245 + return $sString;
  246 + }
  247 +
228 248 // validate a STRING to an integer
229 249 function validateInteger($sInteger, $aOptions = null) {
230 250 $sInteger = trim($sInteger);
... ...
plugins/housekeeper/HouseKeeperPlugin.php
1   -<?
  1 +<?php
2 2  
3 3 class HouseKeeperPlugin extends KTPlugin
4 4 {
... ...
plugins/ktcore/KTCorePlugin.php
... ... @@ -174,6 +174,7 @@ class KTCorePlugin extends KTPlugin {
174 174  
175 175 // validators
176 176 $this->registerValidator('KTStringValidator', 'ktcore.validators.string', 'KTValidators.php');
  177 + $this->registerValidator('KTIllegalCharValidator', 'ktcore.validators.illegal_char', 'KTValidators.php');
177 178 $this->registerValidator('KTEntityValidator', 'ktcore.validators.entity', 'KTValidators.php');
178 179 $this->registerValidator('KTRequiredValidator', 'ktcore.validators.required', 'KTValidators.php');
179 180 $this->registerValidator('KTEmailValidator', 'ktcore.validators.emailaddress', 'KTValidators.php');
... ... @@ -183,6 +184,7 @@ class KTCorePlugin extends KTPlugin {
183 184 $this->registerValidator('KTFieldsetValidator', 'ktcore.validators.fieldset', 'KTValidators.php');
184 185 $this->registerValidator('KTFileValidator', 'ktcore.validators.file', 'KTValidators.php');
185 186 $this->registerValidator('KTRequiredFileValidator', 'ktcore.validators.requiredfile', 'KTValidators.php');
  187 + $this->registerValidator('KTFileIllegalCharValidator', 'ktcore.validators.fileillegalchar', 'KTValidators.php');
186 188 $this->registerValidator('KTArrayValidator', 'ktcore.validators.array', 'KTValidators.php');
187 189  
188 190 // criterion
... ...
plugins/ktcore/KTFolderActions.php
... ... @@ -96,7 +96,12 @@ class KTFolderAddFolderAction extends KTFolderAction {
96 96 $oForm->setValidators(array(
97 97 array('ktcore.validators.string', array(
98 98 'test' => 'name',
99   - 'output' => 'name')),
  99 + 'output' => 'name',
  100 + )),
  101 + array('ktcore.validators.illegal_char', array(
  102 + 'test' => 'name',
  103 + 'output' => 'name',
  104 + )),
100 105 ));
101 106  
102 107 return $oForm;
... ...
plugins/ktcore/KTValidators.php
... ... @@ -89,6 +89,53 @@ class KTStringValidator extends KTValidator {
89 89 }
90 90 }
91 91  
  92 +class KTIllegalCharValidator extends KTValidator {
  93 + var $sNamespace = 'ktcore.validators.illegal_char';
  94 + var $sWarning;
  95 +
  96 + function configure($aOptions) {
  97 + $res = parent::configure($aOptions);
  98 + if (PEAR::isError($res)) {
  99 + return $res;
  100 + }
  101 +
  102 + $sChars = "\/*<>|%+':\"?";
  103 + $sWarning = sprintf(_kt('The value you have entered is invalid. The following characters are not allowed: %s'), $sChars);
  104 + $this->sWarning = KTUtil::arrayGet($aOptions, 'illegal_character_warning', $sWarning);
  105 +
  106 + $this->bTrim = KTUtil::arrayGet($aOptions, 'trim', true, false);
  107 + }
  108 +
  109 + function validate($data) {
  110 + $results = array();
  111 + $errors = array();
  112 +
  113 + // very simple if we're required and not present, fail
  114 + // otherwise, its ok.
  115 + $val = KTUtil::arrayGet($data, $this->sInputVariable);
  116 +
  117 + if ($this->bTrim) {
  118 + $val = trim($val);
  119 + }
  120 +
  121 + // illegal characters: \/ *<>|%+':"?
  122 + $pattern = "[\*|\%|\\\|\/|\<|\>|\+|\:|\?|\||\'|\"]";
  123 + // "'^[^:]+:(?:[0-9a-z\.\?&-_=\+\/]+[\.]{1})*(?:[0-9a-z\.\?&-_=\+\/]+\.)[a-z]{2,3}.*$'i"
  124 + if(preg_match($pattern, $val)){
  125 + $errors[$this->sBasename] = $this->sWarning;
  126 + }
  127 +
  128 + if ($this->bProduceOutput) {
  129 + $results[$this->sOutputVariable] = $val;
  130 + }
  131 +
  132 + return array(
  133 + 'errors' => $errors,
  134 + 'results' => $results,
  135 + );
  136 + }
  137 +}
  138 +
92 139 class KTEntityValidator extends KTValidator {
93 140 var $sNamespace = 'ktcore.validators.entity';
94 141  
... ... @@ -429,6 +476,52 @@ class KTFileValidator extends KTValidator {
429 476 }
430 477 }
431 478  
  479 +class KTFileIllegalCharValidator extends KTValidator {
  480 + var $sNamespace = 'ktcore.validators.fileillegalchar';
  481 + var $sWarning;
  482 +
  483 + function configure($aOptions) {
  484 + $res = parent::configure($aOptions);
  485 + if (PEAR::isError($res)) {
  486 + return $res;
  487 + }
  488 +
  489 + $sChars = "\/*<>|%+':\"?";
  490 + $sWarning = sprintf(_kt('The name of the document selected is invalid. The following characters are not allowed: %s'), $sChars);
  491 + $this->sWarning = KTUtil::arrayGet($aOptions, 'file_illegal_character_warning', $sWarning);
  492 +
  493 + $this->bTrim = KTUtil::arrayGet($aOptions, 'trim', true, false);
  494 + }
  495 +
  496 + function validate($data) {
  497 + $results = array();
  498 + $errors = array();
  499 +
  500 + $aFile = (array) KTUtil::arrayGet($data, $this->sInputVariable);
  501 +
  502 + // Get the file name
  503 + $val = $aFile['name'];
  504 + if ($this->bTrim) {
  505 + $val = trim($val);
  506 + }
  507 +
  508 + // illegal characters: \/ *<>|%+':"?
  509 + $pattern = "[\*|\%|\\\|\/|\<|\>|\+|\:|\?|\||\'|\"]";
  510 + if(preg_match($pattern, $val)){
  511 + $errors[$this->sBasename] = $this->sWarning;
  512 + }
  513 +
  514 + if ($this->bProduceOutput) {
  515 + $results[$this->sOutputVariable] = $aFile;
  516 + }
  517 +
  518 + return array(
  519 + 'errors' => $errors,
  520 + 'results' => $results,
  521 + );
  522 + }
  523 +}
  524 +
432 525  
433 526 class KTArrayValidator extends KTValidator {
434 527 var $sNamespace = 'ktcore.validators.array';
... ...
plugins/ktcore/document/Rename.php
... ... @@ -77,7 +77,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
77 77 $fields = array();
78 78  
79 79 $fields[] = new KTStaticTextWidget(_kt('Current file name'), _kt('The current file name is shown below:'), 'oldfilename', $this->oDocument->getFileName(), $this->oPage, false);
80   - $fields[] = new KTStringWidget(_kt('New file name'), _kt('The name to which the current file should be renamed.'), 'filename', "", $this->oPage, true);
  80 + $fields[] = new KTStringWidget(_kt('New file name'), _kt('The name to which the current file should be renamed.'), 'filename', $this->oDocument->getFileName(), $this->oPage, true);
81 81  
82 82 $oTemplate->setData(array(
83 83 'context' => &$this,
... ... @@ -95,6 +95,7 @@ class KTDocumentRenameAction extends KTDocumentAction {
95 95 'max_str_len' => 255,
96 96 );
97 97 $this->oValidator->validateString($sFilename, $aOptions);
  98 + $this->oValidator->validateIllegalCharacters($sFilename, $aOptions);
98 99  
99 100 $res = KTDocumentUtil::rename($this->oDocument, $sFilename, $this->oUser);
100 101 if (PEAR::isError($res)) {
... ...
plugins/ktcore/folder/Rename.php
... ... @@ -55,7 +55,7 @@ class KTFolderRenameAction extends KTFolderAction {
55 55 $oTemplate =& $this->oValidator->validateTemplate('ktcore/folder/rename');
56 56  
57 57 $fields = array();
58   - $fields[] = new KTStringWidget(_kt('New folder name'), _kt('The name to which the current folder should be renamed.'), 'foldername', "", $this->oPage, true);
  58 + $fields[] = new KTStringWidget(_kt('New folder name'), _kt('The name to which the current folder should be renamed.'), 'foldername', $this->oFolder->getName(), $this->oPage, true);
59 59  
60 60 $oTemplate->setData(array(
61 61 'context' => &$this,
... ... @@ -72,6 +72,7 @@ class KTFolderRenameAction extends KTFolderAction {
72 72 $sFolderName = KTUtil::arrayGet($_REQUEST, 'foldername');
73 73 $aErrorOptions['defaultmessage'] = _kt("No folder name given");
74 74 $sFolderName = $this->oValidator->validateString($sFolderName, $aErrorOptions);
  75 + $sFolderName = $this->oValidator->validateIllegalCharacters($sFolderName, $aErrorOptions);
75 76 $sOldFolderName = $this->oFolder->getName();
76 77  
77 78 if ($this->oFolder->getId() != 1) {
... ...
plugins/ktcore/folder/addDocument.php
... ... @@ -132,10 +132,18 @@ class KTFolderAddDocumentAction extends KTFolderAction {
132 132 'test' => 'file',
133 133 'output' => 'file',
134 134 )),
  135 + array('ktcore.validators.fileillegalchar', array(
  136 + 'test' => 'file',
  137 + 'output' => 'file',
  138 + )),
135 139 array('ktcore.validators.string', array(
136 140 'test' => 'document_name',
137 141 'output' => 'document_name',
138 142 )),
  143 + array('ktcore.validators.illegal_char', array(
  144 + 'test' => 'document_name',
  145 + 'output' => 'document_name',
  146 + )),
139 147 array('ktcore.validators.entity', array(
140 148 'test' => 'document_type',
141 149 'output' => 'document_type',
... ...
plugins/ktstandard/ldap/ldapbaseauthenticationprovider.inc.php
... ... @@ -146,6 +146,7 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
146 146 if (empty($aConfig)) {
147 147 $aConfig = array('serverport'=>389);
148 148 }
  149 +
149 150 $aConfig['searchattributes'] = KTUtil::arrayGet($aConfig, 'searchattributes', split(',', 'cn,mail,sAMAccountName'));
150 151 $aConfig['objectclasses'] = KTUtil::arrayGet($aConfig, 'objectclasses', split(',', 'user,inetOrgPerson,posixAccount'));
151 152 $fields = array();
... ... @@ -210,6 +211,44 @@ class KTLDAPBaseAuthenticationProvider extends KTAuthenticationProvider {
210 211 }
211 212 $oSource->setConfig(serialize($aConfig));
212 213 $res = $oSource->update();
  214 +
  215 + //force a commit here to keep any data entered into the fields
  216 + //when redirected to the do_editSourceProvider function above the $oSource object will
  217 + //now contain the information entered by the user.
  218 + if ($this->bTransactionStarted) {
  219 + $this->commitTransaction();
  220 + }
  221 +
  222 + $aErrorOptions = array(
  223 + 'redirect_to' => array('editSourceProvider', sprintf('source_id=%d', $oSource->getId())),
  224 + );
  225 + $aErrorOptions['message'] = _kt("No server name provided");
  226 + $sName = KTUtil::arrayGet($_REQUEST, 'servername');
  227 + $sName = $this->oValidator->validateString($sName, $aErrorOptions);
  228 +
  229 + $aErrorOptions['message'] = _kt("No Base DN provided");
  230 + $sName = KTUtil::arrayGet($_REQUEST, 'basedn');
  231 + $sName = $this->oValidator->validateString($sName, $aErrorOptions);
  232 +
  233 + $aErrorOptions['message'] = _kt("No Search User provided");
  234 + $sName = KTUtil::arrayGet($_REQUEST, 'searchuser');
  235 + $sName = $this->oValidator->validateString($sName, $aErrorOptions);
  236 +
  237 + $aErrorOptions['message'] = _kt("No Search Password provided");
  238 + $sName = KTUtil::arrayGet($_REQUEST, 'searchpassword');
  239 + $sName = $this->oValidator->validateString($sName, $aErrorOptions);
  240 +
  241 + $aErrorOptions['message'] = _kt("No Search Attributes provided");
  242 + $sName = KTUtil::arrayGet($_REQUEST, 'searchattributes_nls');
  243 + $sName = $this->oValidator->validateString($sName, $aErrorOptions);
  244 +
  245 + $aErrorOptions['message'] = _kt("No Object Classes provided");
  246 + $sName = KTUtil::arrayGet($_REQUEST, 'objectclasses_nls');
  247 + $sName = $this->oValidator->validateString($sName, $aErrorOptions);
  248 +
  249 +
  250 +
  251 +
213 252 $this->successRedirectTo('viewsource', _kt("Configuration updated"), 'source_id=' . $oSource->getId());
214 253 }
215 254 // }}}
... ...
skins/kts_blue/kt-ie-morph.css
... ... @@ -43,36 +43,109 @@
43 43 }
44 44  
45 45 /* Portlets */
  46 +#portletbar .portlet {
  47 + background: url(portlet_bg_collapsed.gif) top left repeat-x;
  48 + margin: 0 0 0 0;
  49 +}
  50 +
  51 +#portletbar .portlet.expanded {
  52 + background: url(portlet_bg.gif) top left repeat-x;
  53 + border: 1px solid #ccc;
  54 + margin: 0 0 0 0;
  55 +}
  56 +
  57 +#portletbar .portlet .portletTopRight {
  58 + display: none;
  59 +}
  60 +
  61 +#portletbar .portlet.expanded .portletTopRight {
  62 + display: none;
  63 +}
  64 +
  65 +#portletbar .portlet .portletbodyBottomLeft {
  66 + display: none;
  67 +}
  68 +
  69 +#portletbar .portlet.expanded .portletbodyBottomLeft {
  70 + display: none;
  71 +}
  72 +
  73 +#portletbar .portlet .portletbodyBottomRight {
  74 + display: none;
  75 +}
  76 +
  77 +#portletbar .portlet.expanded .portletbodyBottomRight {
  78 + display: none;
  79 +}
  80 +
  81 +#portletbar .portlet .portletTopRepeat {
  82 + display: none;
  83 +}
46 84  
  85 +#portletbar .portlet.expanded .portletTopRepeat {
  86 + display: none;
  87 +}
  88 +
  89 +#portletbar .portlet.expanded .portletbody {
  90 + background: none;
  91 + border: none;
  92 + background-color: white;
  93 +}
  94 +/*
47 95 #portletbar .portlet.expanded h4
48 96 {
49 97 background: url(minus.gif) 10px 45% no-repeat;
50 98 }
51 99  
52 100 #portletbar .portlet.expanded .portletTopRepeat {
53   - background: url(portlet_bg.gif) top left repeat-x;
  101 + display: none;
54 102 }
55 103  
56   -#portletbar .portlet.expanded {
57   - background: url(portlet_corner_topleft.gif) top left no-repeat;
  104 +#portletbar .portlet .expanded {
  105 + background: url(portlet_bg.gif) top left repeat-x;
  106 + border: 1px solid #ccc;
  107 + margin: 0 0 0 0;
58 108 }
59 109  
60 110 #portletbar .portlet.expanded .portletTopRight {
61   - background: url(portlet_corner_topright.gif) top right no-repeat;
  111 + display: none;
62 112 }
63 113  
64   -#portletbar .portlet.portletTopRepeat {
65   - background: url(portlet_bg_collapsed.gif) top left repeat-x;
  114 +#portletbar .portlet .portletbodyBottomLeft {
  115 + display: none;
66 116 }
67 117  
68   -#portletbar.portlet {
69   - background: url(portlet_corner_topleft_collapsed.gif) top left no-repeat;
  118 +#portletbar .portlet.expanded .portletbodyBottomLeft {
  119 + display: none;
70 120 }
71 121  
72   -#portletbar .portlet.portletTopRight {
73   - background: url(portlet_corner_topright_collapsed.gif) top right no-repeat;
  122 +#portletbar .portlet .portletbodyBottomRight {
  123 + display: none;
74 124 }
75 125  
  126 +#portletbar .portlet.expanded .portletbodyBottomRight {
  127 + display: none;
  128 +}
  129 +
  130 +#portletbar .portlet .portletTopRepeat {
  131 + display: none;
  132 +}
  133 +
  134 +#portletbar .portlet {
  135 + background: url(portlet_bg_collapsed.gif) top left repeat-x;
  136 + margin: 0 0 0 0;
  137 +}
  138 +
  139 +#portletbar .portlet .portletTopRight {
  140 + display: none;
  141 +}
  142 +
  143 +#portletbar .portlet.expanded .portletbody {
  144 + background: none;
  145 + border: none;
  146 + background-color: white;
  147 +}*/
  148 +
76 149 .collapsible.expanded h4
77 150 {
78 151 background: url(minus.gif) 10px 50% no-repeat;
... ...
sql/mysql/upgrade/3.5.0/relation_friendly.sql
... ... @@ -19,3 +19,5 @@ alter table folder_transactions change user_id user_id int null;
19 19 alter table folders change parent_id parent_id int null;
20 20 update documents set owner_id=null where owner_id=0;
21 21 update folders set parent_id=null where parent_id=0;
  22 +alter table discussion_threads change first_comment_id first_comment_id int null;
  23 +alter table discussion_threads change last_comment_id last_comment_id int null;
... ...
templates/ktcore/search2/manage_saved_search.smarty
... ... @@ -13,7 +13,7 @@ newsletters, etc.) based on a category or fieldset value.{/i18n}&lt;/p&gt;
13 13  
14 14  
15 15  
16   -{i18n arg_options=$options}Create a new saved search using #options.{/i18n}
  16 +{i18n arg_options=$options}Create a new saved search using #options#.{/i18n}
17 17 </p>
18 18  
19 19  
... ...