dolibarr 21.0.0-beta
security.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2005-2007 Regis Houssin <regis.houssin@inodbox.com>
4 * Copyright (C) 2013-2015 Juanjo Menent <jmenent@2byte.es>
5 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
6 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
28// Load Dolibarr environment
29require '../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
32
33$action = GETPOST('action', 'aZ09');
34
45// Load translation files required by the page
46$langs->loadLangs(array("users", "admin", "other"));
47
48if (!$user->admin) {
50}
51
52// Allow/Disallow change to clear passwords once passwords are encrypted
53$allow_disable_encryption = false;
54
55
56/*
57 * Actions
58 */
59
60if ($action == 'setgeneraterule') {
61 if (!dolibarr_set_const($db, 'USER_PASSWORD_GENERATED', GETPOST("value", "alphanohtml"), 'chaine', 0, '', $conf->entity)) {
62 dol_print_error($db);
63 }
64}
65
66if ($action == 'activate_encrypt') {
67 $error = 0;
68
69 $db->begin();
70
71 // On old version, a bug created the constant into user entity, so we delete it to be sure such entry won't exists. We want it in entity 0 or nowhere.
72 dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", $conf->entity);
73 // We set entity=0 (all) because DATABASE_PWD_ENCRYPTED is a setup into conf file, so always shared for everybody
74 $entityforall = 0;
75 dolibarr_set_const($db, "DATABASE_PWD_ENCRYPTED", "1", 'chaine', 0, '', $entityforall);
76
77 $sql = "SELECT u.rowid, u.pass, u.pass_crypted";
78 $sql .= " FROM ".MAIN_DB_PREFIX."user as u";
79 $sql .= " WHERE u.pass IS NOT NULL AND LENGTH(u.pass) < 32"; // Not a MD5 value
80
81 $resql = $db->query($sql);
82 if ($resql) {
83 $numrows = $db->num_rows($resql);
84 $i = 0;
85 while ($i < $numrows) {
86 $obj = $db->fetch_object($resql);
87 if (dol_hash($obj->pass)) {
88 $sql = "UPDATE ".MAIN_DB_PREFIX."user";
89 $sql .= " SET pass_crypted = '".dol_hash($obj->pass)."', pass = NULL";
90 $sql .= " WHERE rowid=".((int) $obj->rowid);
91 //print $sql;
92
93 $resql2 = $db->query($sql);
94 if (!$resql2) {
95 dol_print_error($db);
96 $error++;
97 break;
98 }
99
100 $i++;
101 }
102 }
103 } else {
104 dol_print_error($db);
105 }
106
107 //print $error." ".$sql;
108 //exit;
109 if (!$error) {
110 $db->commit();
111 } else {
112 $db->rollback();
113 dol_print_error($db, '');
114 }
115} elseif ($action == 'disable_encrypt') {
116 // By default, $allow_disable_encryption is false we do not allow to disable encryption because passwords can't be decoded once encrypted.
117 // We set entity=0 (all) because DATABASE_PWD_ENCRYPTED is a setup into conf file, so always shared for everybody
118 if ($allow_disable_encryption) {
119 dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", $conf->entity);
120 dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED", 0);
121 }
122}
123
124if ($action == 'activate_encryptdbpassconf') {
125 $result = encodedecode_dbpassconf(1);
126 if ($result > 0) {
127 sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait.
128
129 // database value not required
130 // dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1");
131 header("Location: security.php");
132 exit;
133 } else {
134 setEventMessages($langs->trans('InstrucToEncodePass', dol_encode($dolibarr_main_db_pass)), null, 'warnings');
135 }
136} elseif ($action == 'disable_encryptdbpassconf') {
137 $result = encodedecode_dbpassconf(0);
138 if ($result > 0) {
139 sleep(3); // Don't know why but we need to wait file is completely saved before making the reload. Even with flush and clearstatcache, we need to wait.
140
141 // database value not required
142 // dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity);
143 header("Location: security.php");
144 exit;
145 } else {
146 // setEventMessages($langs->trans('InstrucToClearPass', $dolibarr_main_db_pass), null, 'warnings');
147 setEventMessages($langs->trans('InstrucToClearPass', $langs->transnoentitiesnoconv("DatabasePassword")), null, 'warnings');
148 }
149}
150
151if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK') {
152 dolibarr_set_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", '1', 'chaine', 0, '', $conf->entity);
153} elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') {
154 dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", $conf->entity);
155}
156
157if ($action == 'updatepattern') {
158 $pattern = GETPOST("pattern", "alpha");
159 $explodePattern = explode(';', $pattern); // List of ints separated with ';' containing counts
160
161 $patternInError = false;
162 if ((int) $explodePattern[0] < 1 || (int) $explodePattern[4] < 0) {
163 $patternInError = true;
164 }
165
166 if ((int) $explodePattern[0] < (int) $explodePattern[1] + (int) $explodePattern[2] + (int) $explodePattern[3]) {
167 $patternInError = true;
168 }
169
170 if (!$patternInError) {
171 dolibarr_set_const($db, "USER_PASSWORD_PATTERN", $pattern, 'chaine', 0, '', $conf->entity);
172 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
173 header("Location: security.php");
174 exit;
175 }
176}
177
178
179
180/*
181 * View
182 */
183
184$form = new Form($db);
185
186$wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
187llxHeader('', $langs->trans("Passwords"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-security');
188
189print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup');
190
191print '<span class="opacitymedium">'.$langs->trans("GeneratedPasswordDesc")."</span><br>\n";
192print "<br>\n";
193
194
195$head = security_prepare_head();
196
197print dol_get_fiche_head($head, 'passwords', '', -1);
198
199print '<br>';
200
201// Select manager to generate passwords
202print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
203print '<input type="hidden" name="token" value="'.newToken().'">';
204print '<input type="hidden" name="action" value="update">';
205print '<input type="hidden" name="constname" value="USER_PASSWORD_GENERATED">';
206print '<input type="hidden" name="consttype" value="yesno">';
207
208// Load array with all password generation modules
209$dir = "../core/modules/security/generate";
210clearstatcache();
211$handle = opendir($dir);
212$i = 1;
213$arrayhandler = array();
214if (is_resource($handle)) {
215 while (($file = readdir($handle)) !== false) {
216 $reg = array();
217 if (preg_match('/(modGeneratePass[a-z]+)\.class\.php$/i', $file, $reg)) {
218 // Charging the numbering class
219 $classname = $reg[1];
220 require_once $dir.'/'.$file;
221
222 $obj = new $classname($db, $conf, $langs, $user);
223 '@phan-var-force ModeleGenPassword $obj';
224 $arrayhandler[$obj->id] = $obj;
225 $i++;
226 }
227 }
228 closedir($handle);
229}
230asort($arrayhandler);
231
232print '<div class="div-table-responsive-no-min">';
233print '<table class="noborder centpercent">';
234print '<tr class="liste_titre">';
235print '<td colspan="2">'.$langs->trans("RuleForGeneratedPasswords").'</td>';
236print '<td>'.$langs->trans("Example").'</td>';
237print '<td class="center">'.$langs->trans("Activated").'</td>';
238print '</tr>';
239
240$tabConf = explode(";", getDolGlobalString('USER_PASSWORD_PATTERN'));
241
242foreach ($arrayhandler as $key => $module) {
243 // Show modules according to features level
244 if (!empty($module->version) && $module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
245 continue;
246 }
247 if (!empty($module->version) && $module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
248 continue;
249 }
250
251 if ($module->isEnabled()) {
252 print '<tr class="oddeven"><td>';
253 print img_picto('', $module->picto, 'class="width25 size15x marginrightonly"').' ';
254 print ucfirst($key);
255 print "</td><td>\n";
256 print $module->getDescription().'<br>';
257 print $langs->trans("MinLength").': <span class="opacitymedium">'.$module->length.'</span>';
258 print '</td>';
259
260 // Show example of numbering module
261 print '<td class="nowraponall">';
262 $tmp = $module->getExample();
263 if (preg_match('/^Error/', $tmp)) {
264 $langs->load("errors");
265 print '<div class="error">'.$langs->trans($tmp).'</div>';
266 } elseif ($tmp == 'NotConfigured') {
267 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
268 } else {
269 print '<span class="opacitymedium">'.$tmp.'</span>';
270 }
271 print '</td>'."\n";
272
273 print '<td class="center">';
274 if ($conf->global->USER_PASSWORD_GENERATED == $key) {
275 //print img_picto('', 'tick');
276 print img_picto($langs->trans("Enabled"), 'switch_on');
277 } else {
278 print '<a href="'.$_SERVER['PHP_SELF'].'?action=setgeneraterule&token='.newToken().'&value='.$key.'">';
279 //print $langs->trans("Activate");
280 print img_picto($langs->trans("Disabled"), 'switch_off');
281 print '</a>';
282 }
283 print "</td></tr>\n";
284 }
285}
286print '</table>';
287print '</div>';
288
289print '</form>';
290
291
292// Pattern for Password Perso
293if (getDolGlobalString('USER_PASSWORD_GENERATED') == "Perso") {
294 print '<br>';
295
296 print '<div class="div-table-responsive-no-min">';
297 print '<table class="noborder centpercent">';
298 print '<tr class="liste_titre">';
299 print '<td colspan="2"> '.$langs->trans("PasswordPatternDesc").'</td>';
300 print '</tr>';
301
302
303 print '<tr class="oddeven">';
304 print '<td>'.$langs->trans("MinLength")."</td>";
305 print '<td><input type="number" class="width50 right" value="'.$tabConf[0].'" id="minlength" min="1"></td>';
306 print '</tr>';
307
308
309 print '<tr class="oddeven">';
310 print '<td>'.$langs->trans("NbMajMin")."</td>";
311 print '<td><input type="number" class="width50 right" value="'.$tabConf[1].'" id="NbMajMin" min="0"></td>';
312 print '</tr>';
313
314
315 print '<tr class="oddeven">';
316 print '<td>'.$langs->trans("NbNumMin")."</td>";
317 print '<td><input type="number" class="width50 right" value="'.$tabConf[2].'" id="NbNumMin" min="0"></td>';
318 print '</tr>';
319
320
321 print '<tr class="oddeven">';
322 print '<td>'.$langs->trans("NbSpeMin")."</td>";
323 print '<td><input type="number" class="width50 right" value="'.$tabConf[3].'" id="NbSpeMin" min="0"></td>';
324 print '</tr>';
325
326
327 print '<tr class="oddeven">';
328 print '<td>'.$langs->trans("NbIteConsecutive")."</td>";
329 print '<td><input type="number" class="width50 right" value="'.$tabConf[4].'" id="NbIteConsecutive" min="0"></td>';
330 print '</tr>';
331
332
333 print '<tr class="oddeven">';
334 print '<td>'.$langs->trans("NoAmbiCaracAutoGeneration")."</td>";
335 print '<td><input type="checkbox" id="NoAmbiCaracAutoGeneration" '.($tabConf[5] ? "checked" : "").' min="0"> <label for="NoAmbiCaracAutoGeneration" id="textcheckbox">'.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'</label></td>';
336 print '</tr>';
337
338 print '</table>';
339
340 print '<div class="center">';
341 print '<a class="button button-save" id="linkChangePattern">'.$langs->trans("Save").'</a>';
342 print '</div>';
343
344 print '<br><br>';
345
346 print '<script type="text/javascript">';
347 print ' function getStringArg(){';
348 print ' var pattern = "";';
349 print ' pattern += $("#minlength").val() + ";";';
350 print ' pattern += $("#NbMajMin").val() + ";";';
351 print ' pattern += $("#NbNumMin").val() + ";";';
352 print ' pattern += $("#NbSpeMin").val() + ";";';
353 print ' pattern += $("#NbIteConsecutive").val() + ";";';
354 print ' pattern += $("#NoAmbiCaracAutoGeneration")[0].checked ? "1" : "0";';
355 print ' return pattern;';
356 print ' }';
357
358 print ' function valuePossible(){';
359 print ' var fields = ["#minlength", "#NbMajMin", "#NbNumMin", "#NbSpeMin", "#NbIteConsecutive"];';
360 print ' for(var i = 0 ; i < fields.length ; i++){';
361 print ' if($(fields[i]).val() < $(fields[i]).attr("min")){';
362 print ' return false;';
363 print ' }';
364 print ' }';
365 print ' ';
366 print ' var length = parseInt($("#minlength").val());';
367 print ' var length_mini = parseInt($("#NbMajMin").val()) + parseInt($("#NbNumMin").val()) + parseInt($("#NbSpeMin").val());';
368 print ' return length >= length_mini;';
369 print ' }';
370
371 print ' function generatelink(){';
372 print ' return "security.php?action=updatepattern&token='.newToken().'&pattern="+getStringArg();';
373 print ' }';
374
375 print ' function valuePatternChange(){';
376 print ' console.log("valuePatternChange");';
377 print ' var lang_save = "'.$langs->trans("Save").'";';
378 print ' var lang_error = "'.$langs->trans("Error").'";';
379 print ' var lang_Disabled = "'.$langs->trans("Disabled").'";';
380 print ' var lang_Activated = "'.$langs->trans("Activated").'";';
381 print ' $("#textcheckbox").html($("#NoAmbiCaracAutoGeneration")[0].checked ? unescape(lang_Activated) : unescape(lang_Disabled));';
382 print ' if(valuePossible()){';
383 print ' $("#linkChangePattern").attr("href",generatelink()).text(lang_save);';
384 print ' }';
385 print ' else{';
386 print ' $("#linkChangePattern").attr("href", null).text(lang_error);';
387 print ' }';
388 print ' }';
389
390 print ' $("#minlength").change(function(){valuePatternChange();});';
391 print ' $("#NbMajMin").change(function(){valuePatternChange();});';
392 print ' $("#NbNumMin").change(function(){valuePatternChange();});';
393 print ' $("#NbSpeMin").change(function(){valuePatternChange();});';
394 print ' $("#NbIteConsecutive").change(function(){valuePatternChange();});';
395 print ' $("#NoAmbiCaracAutoGeneration").change(function(){valuePatternChange();});';
396
397 print '</script>';
398}
399
400
401// Crypt passwords in database
402
403print '<br>';
404print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
405print '<input type="hidden" name="token" value="'.newToken().'">';
406print '<input type="hidden" name="action" value="encrypt">';
407
408print '<table class="noborder centpercent">';
409print '<tr class="liste_titre">';
410print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
411print '<td class="center">'.$langs->trans("Activated").'</td>';
412print '<td class="center"></td>';
413print '</tr>';
414
415// Disable clear password in database
416print '<tr class="oddeven">';
417print '<td colspan="3">'.$langs->trans("DoNotStoreClearPassword").'</td>';
418print '<td class="center" width="60">';
419if (getDolGlobalString('DATABASE_PWD_ENCRYPTED')) {
420 print img_picto($langs->trans("Active"), 'tick');
421}
422print '</td>';
423if (!getDolGlobalString('DATABASE_PWD_ENCRYPTED')) {
424 print '<td class="center" width="100">';
425 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=activate_encrypt&token='.newToken().'">'.$langs->trans("Activate").'</a>';
426 print "</td>";
427} else {
428 print '<td class="center" width="100">';
429 if ($allow_disable_encryption) {
430 //On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes
431 //Do not allow "disable encryption" as passwords cannot be decrypted
432 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disable_encrypt&token='.newToken().'">'.$langs->trans("Disable").'</a>';
433 } else {
434 print '<span class="opacitymedium">'.$langs->trans("Always").'</span>';
435 }
436 print "</td>";
437}
438print "</td>";
439print '</tr>';
440
441
442// Crypt password into config file conf.php
443
444print '<tr class="oddeven">';
445print '<td colspan="3">'.$langs->trans("MainDbPasswordFileConfEncrypted").'</td>';
446print '<td align="center" width="60">';
447if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) {
448 print img_picto($langs->trans("Active"), 'tick');
449}
450
451print '</td>';
452
453print '<td class="center" width="100">';
454if (empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) {
455 $langs->load("errors");
456 print img_warning($langs->trans("WarningPassIsEmpty"));
457} else {
458 if (empty($dolibarr_main_db_encrypted_pass)) {
459 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=activate_encryptdbpassconf&token='.newToken().'">'.$langs->trans("Activate").'</a>';
460 }
461 if (!empty($dolibarr_main_db_encrypted_pass)) {
462 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disable_encryptdbpassconf&token='.newToken().'">'.$langs->trans("Disable").'</a>';
463 }
464}
465print "</td>";
466
467print "</td>";
468print '</tr>';
469
470
471// Disable link "Forget password" on logon
472
473print '<tr class="oddeven">';
474print '<td colspan="3">'.$langs->trans("DisableForgetPasswordLinkOnLogonPage").'</td>';
475print '<td class="center" width="60">';
476if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
477 print img_picto($langs->trans("Active"), 'tick');
478}
479print '</td>';
480if (!getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
481 print '<td class="center" width="100">';
482 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=activate_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Activate").'</a>';
483 print "</td>";
484}
485if (getDolGlobalString('MAIN_SECURITY_DISABLEFORGETPASSLINK')) {
486 print '<td center="center" width="100">';
487 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=disable_MAIN_SECURITY_DISABLEFORGETPASSLINK&token='.newToken().'">'.$langs->trans("Disable").'</a>';
488 print "</td>";
489}
490print "</td>";
491print '</tr>';
492
493
494print '</table>';
495
496print '</form>';
497
498print '<br>';
499
500if (GETPOSTINT('info') > 0) {
501 if (function_exists('password_hash')) {
502 print $langs->trans("Note: The function password_hash exists on your PHP")."<br>\n";
503 } else {
504 print $langs->trans("Note: The function password_hash does not exist on your PHP")."<br>\n";
505 }
506 print 'MAIN_SECURITY_HASH_ALGO = '.getDolGlobalString('MAIN_SECURITY_HASH_ALGO')."<br>\n";
507 print 'MAIN_SECURITY_SALT = '.getDolGlobalString('MAIN_SECURITY_SALT')."<br>\n";
508}
509
510print '</div>';
511
512// End of page
513llxFooter();
514$db->close();
security_prepare_head()
Prepare array with list of tabs.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:71
Class to manage generation of HTML components Only common components must be here.
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
encodedecode_dbpassconf($level=0)
Encode or decode database password in config file.
dol_encode($chain, $key='1')
Encode a string with base 64 algorithm + specific delta change.
dol_hash($chain, $type='0', $nosalt=0)
Returns a hash (non reversible encryption) of a string.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.