1 | <?php |
---|
2 | /* |
---|
3 | * FCKeditor - The text editor for internet |
---|
4 | * Copyright (C) 2003-2006 Frederico Caldeira Knabben |
---|
5 | * |
---|
6 | * Licensed under the terms of the GNU Lesser General Public License: |
---|
7 | * http://www.opensource.org/licenses/lgpl-license.php |
---|
8 | * |
---|
9 | * For further information visit: |
---|
10 | * http://www.fckeditor.net/ |
---|
11 | * |
---|
12 | * "Support Open Source software. What about a donation today?" |
---|
13 | * |
---|
14 | * File Name: config.php |
---|
15 | * Configuration file for the File Manager Connector for PHP. |
---|
16 | * |
---|
17 | * File Authors: |
---|
18 | * Frederico Caldeira Knabben (fredck@fckeditor.net) |
---|
19 | */ |
---|
20 | |
---|
21 | global $Config ; |
---|
22 | |
---|
23 | $cheminEcrire ="../../../../../../ecrire/"; |
---|
24 | |
---|
25 | if (defined("_ECRIRE_INC_VERSION")) return; |
---|
26 | define("_ECRIRE_INC_VERSION", "1"); |
---|
27 | function spip_connect_db($host, $port, $login, $pass, $db) { |
---|
28 | global $fck_mysql_link; // pour connexions multiples |
---|
29 | $fck_mysql_link = @mysql_connect($host, $login, $pass); |
---|
30 | mysql_select_db($db); |
---|
31 | } |
---|
32 | // Pour charger le bon fichier de connexion selon la version |
---|
33 | @include('../../../../../../../../config/connect.php'); |
---|
34 | @include('../../../../../../../../ecrire/inc_connect.php'); |
---|
35 | |
---|
36 | |
---|
37 | |
---|
38 | // SECURITY: You must explicitelly enable this "connector". (Set it to "true"). |
---|
39 | $Config['Enabled'] = true ; |
---|
40 | |
---|
41 | |
---|
42 | //détermination du chemin des images de Spip par rapport à la racine du serveur |
---|
43 | $chemin_final=''; |
---|
44 | $dir_relatif_array = explode('/', $_SERVER["PHP_SELF"]); |
---|
45 | $i = 0; |
---|
46 | while($dir_relatif_array[$i] != 'plugins') |
---|
47 | { |
---|
48 | $chemin_final .= $dir_relatif_array[$i]."/"; |
---|
49 | $i++; |
---|
50 | } |
---|
51 | $chemin_final .="IMG/"; |
---|
52 | $Config['CheminImgSpip'] = $chemin_final; |
---|
53 | |
---|
54 | |
---|
55 | //************************************************************************************** |
---|
56 | //Décommenter cette ligne pour faire du chemin par défaut, le chemin des images de spip |
---|
57 | $Config['UserFilesPath']=$Config['CheminImgSpip']; |
---|
58 | |
---|
59 | |
---|
60 | // Fill the following value it you prefer to specify the absolute path for the |
---|
61 | // user files directory. Usefull if you are using a virtual directory, symbolic |
---|
62 | // link or alias. Examples: 'C:\\MySite\\UserFiles\\' or '/root/mysite/UserFiles/'. |
---|
63 | // Attention: The above 'UserFilesPath' must point to the same directory. |
---|
64 | $Config['UserFilesAbsolutePath'] = '' ; |
---|
65 | |
---|
66 | $Config['AllowedExtensions']['File'] = array() ; |
---|
67 | $Config['DeniedExtensions']['File'] = array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi') ; |
---|
68 | |
---|
69 | $Config['AllowedExtensions']['Image'] = array('jpg','gif','jpeg','png') ; |
---|
70 | $Config['DeniedExtensions']['Image'] = array() ; |
---|
71 | |
---|
72 | $Config['AllowedExtensions']['Flash'] = array('swf','fla') ; |
---|
73 | $Config['DeniedExtensions']['Flash'] = array() ; |
---|
74 | |
---|
75 | $Config['AllowedExtensions']['Media'] = array('swf','fla','jpg','gif','jpeg','png','avi','mpg','mpeg') ; |
---|
76 | $Config['DeniedExtensions']['Media'] = array() ; |
---|
77 | |
---|
78 | $Config['AllowedExtensions'][''] = array() ; |
---|
79 | $Config['DeniedExtensions'][''] = array('php','php2','php3','php4','php5','phtml','pwml','inc','asp','aspx','ascx','jsp','cfm','cfc','pl','bat','exe','com','dll','vbs','js','reg','cgi') ; |
---|
80 | |
---|
81 | /*------------------------------------------------------------------------------*/ |
---|
82 | /* Directory and File Naming :- */ |
---|
83 | /* -MaxDirNameLength :: Maximum allowed length of a directory name */ |
---|
84 | /* -DirNameAllowedChars :: Array of characters allowed in a directory name */ |
---|
85 | /* -FileNameAllowedChars :: Array of characters allowed in a file name */ |
---|
86 | /*------------------------------------------------------------------------------*/ |
---|
87 | |
---|
88 | $Config['MaxDirNameLength']=25; |
---|
89 | |
---|
90 | $Config['DirNameAllowedChars']=array(); |
---|
91 | |
---|
92 | //Allow numbers |
---|
93 | for($i=48;$i<58;$i++) array_push($Config['DirNameAllowedChars'],chr($i)); |
---|
94 | |
---|
95 | //Allow lowercase letters |
---|
96 | for($i=97;$i<123;$i++) array_push($Config['DirNameAllowedChars'],chr($i)); |
---|
97 | |
---|
98 | //Allow uppercase letters |
---|
99 | for($i=65;$i<91;$i++) array_push($Config['DirNameAllowedChars'],chr($i)); |
---|
100 | |
---|
101 | //Allow space,dash,underscore,dot |
---|
102 | array_push($Config['DirNameAllowedChars']," ","-","_","."); |
---|
103 | |
---|
104 | $Config['FileNameAllowedChars']=$Config['DirNameAllowedChars']; |
---|
105 | array_push($Config['FileNameAllowedChars'],')','(','[',']','~'); |
---|
106 | |
---|
107 | /*======================================================================================*/ |
---|
108 | /* Directory and File Listing */ |
---|
109 | /*--------------------------------------------------------------------------------------*/ |
---|
110 | /* */ |
---|
111 | /* -DirNameHidden :: Hidden directories */ |
---|
112 | /* -FileNameHidden :: Hidden files */ |
---|
113 | /* */ |
---|
114 | /* -FileNameUnrenamableInFolder :: Répertoires dans lesquels les fichiers ne */ |
---|
115 | /* peuvent pas être renommés */ |
---|
116 | /* -FileNameUnrenamable :: Fichiers que l'on ne peut pas renommer */ |
---|
117 | /* -FileNameUnrenamableWildcard :: Fichiers que l'on ne peut pas renommer */ |
---|
118 | /* avec joker, placer une étoile à la fin du nom */ |
---|
119 | /* exemple : siteon*, tous les fichiers commencant par*/ |
---|
120 | /* siteon, ne pourront pas être renommés */ |
---|
121 | /* -DirNameUnrenamable :: Répertoire que l'on ne peut pas renommer */ |
---|
122 | /* -DirNameUnrenamableWildcard :: Répertoire que l'on ne peut pas renommer */ |
---|
123 | /* avec joker, placer une étoile à la fin du nom */ |
---|
124 | /* */ |
---|
125 | /* -FileNameUndeletableInFolder :: Répertoires dans lesquels les fichiers ne */ |
---|
126 | /* peuvent pas être effacer */ |
---|
127 | /* -FileNameUndeletable :: Fichiers que l'on ne peut pas effacer */ |
---|
128 | /* -FileNameUndeletableWildcard :: Fichiers que l'on ne peut pas effacer */ |
---|
129 | /* avec joker, placer une étoile à la fin du nom */ |
---|
130 | /* exemple : icones*, tous les rep. commencant par */ |
---|
131 | /* icones, ne pourront pas être effacer */ |
---|
132 | /* -DirNameUndeletable :: Répertoire que l'on ne peut pas effacer */ |
---|
133 | /* -DirNameUndeletableWildcard :: Répertoire que l'on ne peut pas effacer */ |
---|
134 | /* avec joker, placer une étoile à la fin du nom */ |
---|
135 | /*--------------------------------------------------------------------------------------*/ |
---|
136 | |
---|
137 | //Supprimées "en hard" du fichier connector.php |
---|
138 | $Config['DeleteOk'] = false; |
---|
139 | $Config['RenameOk'] = false; |
---|
140 | // Fichier cachés |
---|
141 | $Config['DirNameHidden'] = array(''); |
---|
142 | $Config['FileNameHidden'] = array(''); |
---|
143 | |
---|
144 | // Fichiers que l'on ne peut pas renommer |
---|
145 | $Config['FileNameUnrenamable'] = array(''); |
---|
146 | $Config['FileNameUnrenamableWildcard'] = array('siteon*','siteoff*','arton*','artoff*','rubon*','ruboff*','breveon*','breveoff*'); |
---|
147 | //$Config['FileNameUnrenamableInFolder'] = array('/gif/','/jpg/','/pdf/','/icones/','/icones_barre/'); |
---|
148 | //$Config['DirNameUnrenamable'] = array('File','Flash','Image','Media','pdf','jpg','gif'); |
---|
149 | $Config['FileNameUnrenamableInFolder'] = array ('/icones/','/icones_barre/'); |
---|
150 | $Config['DirNameUnrenamable'] = array ('File','Flash','Image','Media','icones','icones_barre'); |
---|
151 | //$typeDocs = spip_query_db("SELECT extension FROM spip_types_documents"); |
---|
152 | global $fck_mysql_link; |
---|
153 | $typeDocs = mysql_query("SELECT extension FROM spip_types_documents", $fck_mysql_link); |
---|
154 | while ($row = mysql_fetch_array($typeDocs)) { |
---|
155 | array_push ($Config['FileNameUnrenamableInFolder'], '/'.$row['extension'].'/'); |
---|
156 | array_push ($Config['DirNameUnrenamable'], $row['extension']); |
---|
157 | } |
---|
158 | mysql_close($fck_mysql_link); |
---|
159 | |
---|
160 | $Config['DirNameUnrenamableWildcard'] = array(''); |
---|
161 | |
---|
162 | // Fichiers que l'on ne peut pas effacer |
---|
163 | $Config['FileNameUndeletable'] = array(''); |
---|
164 | $Config['FileNameUndeletableWildcard'] = $Config['FileNameUnrenamableWildcard']; |
---|
165 | $Config['FileNameUndeletableInFolder'] = $Config['FileNameUnrenamableInFolder']; |
---|
166 | $Config['DirNameUndeletable'] = $Config['DirNameUnrenamable']; |
---|
167 | $Config['DirNameUndeletableWildcard'] = $Config['DirNameUnrenamableWildcard']; |
---|
168 | |
---|
169 | /*==============================================================================*/ |
---|
170 | |
---|
171 | ?> |
---|