| 1 | <?php require_once('../../../../../../Connections/dataKont.php'); ?> |
|---|
| 2 | <?php |
|---|
| 3 | // Load the tNG classes |
|---|
| 4 | require_once('../../../../../../includes/tng/tNG.inc.php'); |
|---|
| 5 | |
|---|
| 6 | // Make unified connection variable |
|---|
| 7 | $conn_dataKont = new KT_connection($dataKont, $database_dataKont); |
|---|
| 8 | |
|---|
| 9 | //Start Restrict Access To Page |
|---|
| 10 | $restrict = new tNG_RestrictAccess($conn_dataKont, "../../../../../../"); |
|---|
| 11 | //Grand Levels: Any |
|---|
| 12 | $restrict->Execute(); |
|---|
| 13 | //End Restrict Access To Page |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | /* |
|---|
| 18 | * FCKeditor - The text editor for Internet - http://www.fckeditor.net |
|---|
| 19 | * Copyright (C) 2003-2007 Frederico Caldeira Knabben |
|---|
| 20 | * |
|---|
| 21 | * == BEGIN LICENSE == |
|---|
| 22 | * |
|---|
| 23 | * Licensed under the terms of any of the following licenses at your |
|---|
| 24 | * choice: |
|---|
| 25 | * |
|---|
| 26 | * - GNU General Public License Version 2 or later (the "GPL") |
|---|
| 27 | * http://www.gnu.org/licenses/gpl.html |
|---|
| 28 | * |
|---|
| 29 | * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") |
|---|
| 30 | * http://www.gnu.org/licenses/lgpl.html |
|---|
| 31 | * |
|---|
| 32 | * - Mozilla Public License Version 1.1 or later (the "MPL") |
|---|
| 33 | * http://www.mozilla.org/MPL/MPL-1.1.html |
|---|
| 34 | * |
|---|
| 35 | * == END LICENSE == |
|---|
| 36 | * |
|---|
| 37 | * Configuration file for the File Manager Connector for PHP. |
|---|
| 38 | */ |
|---|
| 39 | |
|---|
| 40 | global $Config ; |
|---|
| 41 | |
|---|
| 42 | // SECURITY: You must explicitly enable this "connector". (Set it to "true"). |
|---|
| 43 | // WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only |
|---|
| 44 | // authenticated users can access this file or use some kind of session checking. |
|---|
| 45 | $Config['Enabled'] = true ; |
|---|
| 46 | |
|---|
| 47 | /* My Code to Know Admin */ |
|---|
| 48 | |
|---|
| 49 | // Path to user files relative to the document root. |
|---|
| 50 | |
|---|
| 51 | $Config['UserFilesPath'] = $sitePath.'/'.$_SESSION['kt_dir'].'/'.$_SESSION['kt_login_id'].'/' ; |
|---|
| 52 | |
|---|
| 53 | // Fill the following value it you prefer to specify the absolute path for the |
|---|
| 54 | // user files directory. Useful if you are using a virtual directory, symbolic |
|---|
| 55 | // link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. |
|---|
| 56 | // Attention: The above 'UserFilesPath' must point to the same directory. |
|---|
| 57 | $Config['UserFilesAbsolutePath'] = $siteAbsPath.'/'.$_SESSION['kt_dir'].'/'.$_SESSION['kt_login_id'].'/' ; |
|---|
| 58 | //should be changed on linux host |
|---|
| 59 | if ($_SESSION['kt_login_level'] == 'A'){ |
|---|
| 60 | $Config['UserFilesPath'] = $sitePath.'/'; |
|---|
| 61 | $Config['UserFilesAbsolutePath'] = $siteAbsPath.'\\'; |
|---|
| 62 | } |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | // Due to security issues with Apache modules, it is recommended to leave the |
|---|
| 66 | // following setting enabled. |
|---|
| 67 | $Config['ForceSingleExtension'] = true ; |
|---|
| 68 | |
|---|
| 69 | // Perform additional checks for image files |
|---|
| 70 | // if set to true, validate image size (using getimagesize) |
|---|
| 71 | $Config['SecureImageUploads'] = true; |
|---|
| 72 | |
|---|
| 73 | // What the user can do with this connector |
|---|
| 74 | $Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder') ; |
|---|
| 75 | |
|---|
| 76 | // Allowed Resource Types |
|---|
| 77 | $Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media') ; |
|---|
| 78 | |
|---|
| 79 | // For security, HTML is allowed in the first Kb of data for files having the |
|---|
| 80 | // following extensions only. |
|---|
| 81 | $Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js") ; |
|---|
| 82 | |
|---|
| 83 | /* |
|---|
| 84 | Configuration settings for each Resource Type |
|---|
| 85 | |
|---|
| 86 | - AllowedExtensions: the possible extensions that can be allowed. |
|---|
| 87 | If it is empty then any file type can be uploaded. |
|---|
| 88 | - DeniedExtensions: The extensions that won't be allowed. |
|---|
| 89 | If it is empty then no restrictions are done here. |
|---|
| 90 | |
|---|
| 91 | For a file to be uploaded it has to fulfill both the AllowedExtensions |
|---|
| 92 | and DeniedExtensions (that's it: not being denied) conditions. |
|---|
| 93 | |
|---|
| 94 | - FileTypesPath: the virtual folder relative to the document root where |
|---|
| 95 | these resources will be located. |
|---|
| 96 | Attention: It must start and end with a slash: '/' |
|---|
| 97 | |
|---|
| 98 | - FileTypesAbsolutePath: the physical path to the above folder. It must be |
|---|
| 99 | an absolute path. |
|---|
| 100 | If it's an empty string then it will be autocalculated. |
|---|
| 101 | Useful if you are using a virtual directory, symbolic link or alias. |
|---|
| 102 | Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. |
|---|
| 103 | Attention: The above 'FileTypesPath' must point to the same directory. |
|---|
| 104 | Attention: It must end with a slash: '/' |
|---|
| 105 | |
|---|
| 106 | - QuickUploadPath: the virtual folder relative to the document root where |
|---|
| 107 | these resources will be uploaded using the Upload tab in the resources |
|---|
| 108 | dialogs. |
|---|
| 109 | Attention: It must start and end with a slash: '/' |
|---|
| 110 | |
|---|
| 111 | - QuickUploadAbsolutePath: the physical path to the above folder. It must be |
|---|
| 112 | an absolute path. |
|---|
| 113 | If it's an empty string then it will be autocalculated. |
|---|
| 114 | Useful if you are using a virtual directory, symbolic link or alias. |
|---|
| 115 | Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. |
|---|
| 116 | Attention: The above 'QuickUploadPath' must point to the same directory. |
|---|
| 117 | Attention: It must end with a slash: '/' |
|---|
| 118 | |
|---|
| 119 | NOTE: by default, QuickUploadPath and QuickUploadAbsolutePath point to |
|---|
| 120 | "userfiles" directory to maintain backwards compatibility with older versions of FCKeditor. |
|---|
| 121 | This is fine, but you in some cases you will be not able to browse uploaded files using file browser. |
|---|
| 122 | Example: if you click on "image button", select "Upload" tab and send image |
|---|
| 123 | to the server, image will appear in FCKeditor correctly, but because it is placed |
|---|
| 124 | directly in /userfiles/ directory, you'll be not able to see it in built-in file browser. |
|---|
| 125 | The more expected behaviour would be to send images directly to "image" subfolder. |
|---|
| 126 | To achieve that, simply change |
|---|
| 127 | $Config['QuickUploadPath']['Image'] = $Config['UserFilesPath'] ; |
|---|
| 128 | $Config['QuickUploadAbsolutePath']['Image'] = $Config['UserFilesAbsolutePath'] ; |
|---|
| 129 | into: |
|---|
| 130 | $Config['QuickUploadPath']['Image'] = $Config['FileTypesPath']['Image'] ; |
|---|
| 131 | $Config['QuickUploadAbsolutePath']['Image'] = $Config['FileTypesAbsolutePath']['Image'] ; |
|---|
| 132 | |
|---|
| 133 | */ |
|---|
| 134 | if ($_SESSION['kt_login_level'] == 'A'){ |
|---|
| 135 | $dirNames = array('','','','',''); |
|---|
| 136 | } |
|---|
| 137 | else{ |
|---|
| 138 | $dirNames = array('file'=>'file/', 'image'=>'image/', 'flash'=>'flash/', 'media'=>'media/'); |
|---|
| 139 | } |
|---|
| 140 | |
|---|
| 141 | $Config['AllowedExtensions']['File'] = array('php','7z', 'aiff', 'asf', 'avi', 'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf', 'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv', 'xls', 'xml', 'zip') ; |
|---|
| 142 | $Config['DeniedExtensions']['File'] = array('php') ; |
|---|
| 143 | $Config['FileTypesPath']['File'] = $Config['UserFilesPath'] . $dirNames['file'] ; |
|---|
| 144 | $Config['FileTypesAbsolutePath']['File']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].$dirNames['file'] ; |
|---|
| 145 | $Config['QuickUploadPath']['File'] = $Config['UserFilesPath'] ; |
|---|
| 146 | $Config['QuickUploadAbsolutePath']['File']= $Config['UserFilesAbsolutePath'] ; |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | $Config['AllowedExtensions']['Image'] = array('bmp','gif','jpeg','jpg','png') ; |
|---|
| 150 | $Config['DeniedExtensions']['Image'] = array('php','txt') ; |
|---|
| 151 | $Config['FileTypesPath']['Image'] = $Config['UserFilesPath'] . $dirNames['image'] ; |
|---|
| 152 | $Config['FileTypesAbsolutePath']['Image']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].$dirNames['image'] ; |
|---|
| 153 | $Config['QuickUploadPath']['Image'] = $Config['UserFilesPath'] ; |
|---|
| 154 | $Config['QuickUploadAbsolutePath']['Image']= $Config['UserFilesAbsolutePath'] ; |
|---|
| 155 | |
|---|
| 156 | $Config['AllowedExtensions']['Flash'] = array('swf','flv') ; |
|---|
| 157 | $Config['DeniedExtensions']['Flash'] = array() ; |
|---|
| 158 | $Config['FileTypesPath']['Flash'] = $Config['UserFilesPath'] . $dirNames['flash'] ; |
|---|
| 159 | $Config['FileTypesAbsolutePath']['Flash']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].$dirNames['flash'] ; |
|---|
| 160 | $Config['QuickUploadPath']['Flash'] = $Config['UserFilesPath'] ; |
|---|
| 161 | $Config['QuickUploadAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath'] ; |
|---|
| 162 | |
|---|
| 163 | $Config['AllowedExtensions']['Media'] = array('aiff', 'asf', 'avi', 'bmp', 'fla', 'flv', 'gif', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'png', 'qt', 'ram', 'rm', 'rmi', 'rmvb', 'swf', 'tif', 'tiff', 'wav', 'wma', 'wmv') ; |
|---|
| 164 | $Config['DeniedExtensions']['Media'] = array() ; |
|---|
| 165 | $Config['FileTypesPath']['Media'] = $Config['UserFilesPath'] . $dirNames['media'] ; |
|---|
| 166 | $Config['FileTypesAbsolutePath']['Media']= ($Config['UserFilesAbsolutePath'] == '') ? '' : $Config['UserFilesAbsolutePath'].$dirNames['media'] ; |
|---|
| 167 | $Config['QuickUploadPath']['Media'] = $Config['UserFilesPath'] ; |
|---|
| 168 | $Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath'] ; |
|---|
| 169 | |
|---|
| 170 | ?> |
|---|