functions concerning the config file config.inc.php. The domain is not set into the form for security issues
More...
Go to the source code of this file.
functions concerning the config file config.inc.php. The domain is not set into the form for security issues
Definition in file config_file.php.
◆ config_file_create()
config_file_create |
( |
|
$p_array, |
|
|
|
$from_setup, |
|
|
|
$p_os = 1 |
|
) |
| |
create the config file
Definition at line 298 of file config_file.php.
299{
301 $hFile= fopen(NOALYSS_INCLUDE.'/config.inc.php','w');
302 ob_start();
306 fclose($hFile);
307}
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
display_file_config($p_array, $from_setup=1, $p_os=1)
Display the content of the config.inc.php with variables.
References $p_array, $r, and display_file_config().
◆ config_file_form()
config_file_form |
( |
|
$p_array = null | ) |
|
Definition at line 54 of file config_file.php.
55{
58 {
59
60
62 $cpath=(
$os==1)?
'/usr/bin':
'c:/noalyss/postgresql/bin';
63 $cuser='noalyss_sql';
64 $cpasswd='dany';
65 $cport=5432;
66 $cdomain='';
67 $clocale=1;
69 $cdbname="";
70 $chost="localhost";
73
74 }
76
78 $ictmp->size=25;
79
80 $iclocale=
new ISelect(
'clocale');
81 $iclocale->value=array(
82 array("value"=>1,"label"=>"Activé"),
83 array("value"=>0,"label"=>"Désactivé")
84 );
85 $iclocale->selected=1;
86
88 $icpath->size=30;
89
90 $icuser=
new IText(
'cuser',$cuser);
91 $icpasswd=
new IText(
'cpasswd',$cpasswd);
92 $icport=
new IText(
"cport",$cport);
93 $ichost=
new IText(
"chost",$chost);
94
96 $icadmin->set_require(true);
97
98
99
101 $smulti->javascript=' onchange="show_dbname(this)" ';
102 $smulti->value = 'Y';
104 $smulti->selected=true;
105
106 }
107 $icdbname=
new IText(
'cdbname');
108 $icdbname->value=$cdbname;
109
110 $icpassword_admin=
new IText(
'cpassword_admin');
112 $icpassword_admin->set_require(true);
113
114 require NOALYSS_TEMPLATE.'/template_config_form.php';
115}
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
References $cadmin, $cpassword_admin, $cpath, $ctmp, $multi, $os, $p_array, and is_unix().
◆ display_file_config()
display_file_config |
( |
|
$p_array, |
|
|
|
$from_setup = 1 , |
|
|
|
$p_os = 1 |
|
) |
| |
Display the content of the config.inc.php with variables.
- Parameters
-
type | $p_array | |
type | $from_setup | |
type | $p_os | |
Definition at line 122 of file config_file.php.
123{
126 echo PHP_EOL;
127 print (
'date_default_timezone_set (\'Europe/Brussels\');');
128 echo PHP_EOL;
130 echo PHP_EOL;
132 echo PHP_EOL;
133 if ($p_os == 1) {
134 print (
'define("PG_RESTORE","' .
$cpath . DIRECTORY_SEPARATOR .
'pg_restore ");');
135 echo PHP_EOL;
136 print (
'define("PG_DUMP","' .
$cpath . DIRECTORY_SEPARATOR .
'pg_dump ");');
137 echo PHP_EOL;
138 print (
'define ("PSQL","' .
$cpath . DIRECTORY_SEPARATOR .
'psql");');
139 } else {
140 print (
'define("PG_RESTORE","pg_restore.exe");');
141 echo PHP_EOL;
142 print (
'define("PG_DUMP","pg_dump.exe");');
143 echo PHP_EOL;
144 print (
'define ("PSQL","psql.exe");');
145 }
146 echo PHP_EOL;
147 print (
'define ("noalyss_user","' . $cuser .
'");');
148 echo PHP_EOL;
149 print (
'define ("noalyss_password","' . $cpasswd .
'");');
150 echo PHP_EOL;
151 print (
'define ("noalyss_psql_port","' . $cport .
'");');
152 echo PHP_EOL;
153 print (
'define ("noalyss_psql_host","' . $chost .
'");');
154 echo PHP_EOL;
155 echo PHP_EOL;
156 print (
"// If you change the NOALYSS_ADMINISTRATOR , you will need to rerun http://..../noalyss/html/install.php");
157 echo PHP_EOL;
158 print (
"// But it doesn't change the password");
159 echo PHP_EOL;
160 print (
'define ("NOALYSS_ADMINISTRATOR","' .
$cadmin .
'");');
161 echo PHP_EOL;
162 print (
"// For changing the password of admin, go to preference or update in db");
163 echo PHP_EOL;
164 print (
"// this password is only used when executing install.php ");
165 echo PHP_EOL;
167 echo PHP_EOL;
168
169 print (
'define ("LOCALE",' . $clocale .
');');
170 echo PHP_EOL;
171 echo "
172 /*
173 * DEBUGNOALYSS let you see more information when you develop.
174 * 0 = for production
175 * 1 = display all errors
176 * 2 = display all errors + more information
177 */
178";
179
180 echo PHP_EOL;
181 print (
'define ("DEBUGNOALYSS",0);');
182 echo PHP_EOL;
183
184 print (
'define ("domaine","");');
185 echo PHP_EOL;
187 print (
'define ("MULTI",0);');
188 }
190 print (
'define ("MULTI",1);');
191 }
192 echo PHP_EOL;
193 print (
'define ("dbname","' . $cdbname .
'");');
194 echo PHP_EOL;
195
196 print (
' // Uncomment to log your input');
197 echo PHP_EOL;
198 print (
'// define ("LOGINPUT",TRUE);');
199 echo PHP_EOL;
200 echo PHP_EOL;
201 echo PHP_EOL;
202 print (
' // Do not change below !!!');
203 echo PHP_EOL;
204 print (
' // These variable are computed but could be changed in ');
205 echo PHP_EOL;
206 print (
' // very special configuration');
207 echo PHP_EOL;
208 print (
'// define ("NOALYSS_HOME","");');
209 echo PHP_EOL;
210 print (
'// define ("NOALYSS_PLUGIN","");');
211 echo PHP_EOL;
212 print (
'// define ("NOALYSS_INCLUDE","");');
213 echo PHP_EOL;
214 print (
'// define ("NOALYSS_TEMPLATE","");');
215 echo PHP_EOL;
216 print (
'// define ("NOALYSS_INCLUDE","");');
217 echo PHP_EOL;
218 print (
'// define ("NOALYSS_TEMPLATE","");');
219 echo PHP_EOL;
220 print (
"// Fix an issue with PDF when exporting receipt in PDF in ANCGL");
221 print (
'// define ("FIX_BROKEN_PDF","NO");');
222 echo PHP_EOL;
223 print (
"// Uncomment if you want to convert to PDF");
224 echo PHP_EOL;
225 print (
"// With the unoconv tool");
226 echo PHP_EOL;
227 print (
"//define ('OFFICE','HOME=/tmp unoconv ');");
228 echo PHP_EOL;
229 print (
"//define ('GENERATE_PDF','YES');");
230 echo PHP_EOL;
231 print (
"// Uncomment if you don't want ");
232 echo PHP_EOL;
233 print (
"// to be informed when a new release is ");
234 echo PHP_EOL;
235 print (
"// published");
236 echo PHP_EOL;
237 print (
'// define ("SITE_UPDATE","");');
238 echo PHP_EOL;
239 print (
'// define ("SITE_UPDATE_PLUGIN","");');
240 echo PHP_EOL;
241 print (
'// To allow to access the Info system');
242 echo PHP_EOL;
243 print (
'// define ("SYSINFO_DISPLAY",true);');
244 echo PHP_EOL;
245 print (
'// For developpement');
246 echo PHP_EOL;
247 print (
'// define ("NOALYSS VERSION",9999);');
248 echo PHP_EOL;
249 print (
' // If you want to override the parameters you have to define OVERRIDE_PARAM');
250 echo PHP_EOL;
251 print (
'// and give your own parameters for max_execution_time and memory_limit');
252 echo PHP_EOL;
253 print (
"// define ('OVERRIDE_PARAM',1);");
254 echo PHP_EOL;
255 print (
"// ini_set ('max_execution_time',240);");
256 echo PHP_EOL;
257 print (
"// ini_set ('memory_limit','256M');");
258 echo PHP_EOL;
259 print (
"// In recent distribution linux, pdftk is a snap, you should set the path");
260 echo PHP_EOL;
261 print (
"// for exporting document in PDF");
262 echo PHP_EOL;
263 print (
"// \$pdftk = /usr/bin/pdftk ");
264 echo PHP_EOL;
265 print (
"// \$pdftk = /snap/bin/pdftk ");
266 echo PHP_EOL;
267 print (
"// uncomment to activate the captcha on login page");
268 echo PHP_EOL;
269 print (
"// define('NOALYSS_CAPTCHA',true);");
270 echo PHP_EOL;
271 print (
"// Uncomment if you want to activate the possibility to reinitialize;");
272 echo PHP_EOL;
273 print (
"// password by email");
274 echo PHP_EOL;
275 print (
"// define ('RECOVER','1');");
276 echo PHP_EOL;
277 print (
"// Uncomment and define if you want to Name of the sender of the email ");
278 echo PHP_EOL;
279 print (
"// if you activate the possibility to reinitialize password by email");
280 echo PHP_EOL;
281 print (
"// define('ADMIN_WEB', 'www-data@localhost');");
282 echo PHP_EOL;
283 print (
"// Define a random session key if you work with different version of NOALYSS");
284 echo PHP_EOL;
286 echo PHP_EOL;
287 printf("// When sending an email , the domain of this email must be in comma separated list ,");
288 echo PHP_EOL;
289 print (
"// if the list is an empty string then all the domain are allowed");
290 echo PHP_EOL;
291 printf("// define ('ALLOWED_EMAIL_DOMAIN','');");
292 echo PHP_EOL;
293
294}
generate_random_string($p_length, $special=1)
Create randomly a string.
References $cadmin, $cpassword_admin, $cpath, $ctmp, $multi, $p_array, generate_random_string(), and print.
Referenced by config_file_create().
◆ is_unix()