27require
'../../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/blockedlog/class/blockedlog.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
33$langs->loadLangs(array(
'admin',
'blockedlog',
'other'));
36if (!$user->admin || empty($conf->blockedlog->enabled)) {
41$action =
GETPOST(
'action',
'aZ09');
42$backtopage =
GETPOST(
'backtopage',
'alpha');
43$withtab =
GETPOST(
'withtab',
'int');
51if (preg_match(
'/set_(.*)/', $action, $reg)) {
54 if (is_array($values)) {
55 $values = implode(
',', $values);
59 header(
"Location: ".$_SERVER[
"PHP_SELF"].($withtab ?
'?withtab='.$withtab :
''));
66if (preg_match(
'/del_(.*)/', $action, $reg)) {
69 Header(
"Location: ".$_SERVER[
"PHP_SELF"].($withtab ?
'?withtab='.$withtab :
''));
83$block_static->loadTrackedEvents();
85$title = $langs->trans(
"BlockedLogSetup");
86$help_url=
"EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Inaltérable";
92 $linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
95print
load_fiche_titre($langs->trans(
"ModuleSetup").
' '.$langs->trans(
'BlockedLog'), $linkback);
103print
'<span class="opacitymedium">'.$langs->trans(
"BlockedLogDesc").
"</span><br>\n";
107print
'<table class="noborder centpercent">';
108print
'<tr class="liste_titre">';
109print
'<td>'.$langs->trans(
"Key").
'</td>';
110print
'<td>'.$langs->trans(
"Value").
'</td>';
113print
'<tr class="oddeven">';
114print
'<td class="titlefield">';
115print $langs->trans(
"CompanyInitialKey").
'</td><td>';
116print $block_static->getSignature();
119if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) {
121 print
'<tr class="oddeven">';
122 print
'<td>'.$langs->trans(
"BlockedLogAuthorityUrl").img_info($langs->trans(
'BlockedLogAuthorityNeededToStoreYouFingerprintsInNonAlterableRemote')).
'</td>';
123 print
'<td class="right" width="300">';
125 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
126 print
'<input type="hidden" name="token" value="'.newToken().
'">';
127 print
'<input type="hidden" name="action" value="set_BLOCKEDLOG_AUTHORITY_URL">';
128 print
'<input type="hidden" name="withtab" value="'.$withtab.
'">';
129 print
'<input type="text" name="BLOCKEDLOG_AUTHORITY_URL" value="'.$conf->global->BLOCKEDLOG_AUTHORITY_URL.
'" size="40" />';
130 print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'">';
136print
'<tr class="oddeven">';
137print
'<td>'.$langs->trans(
"BlockedLogDisableNotAllowedForCountry").
'</td>';
140print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
141print
'<input type="hidden" name="token" value="'.newToken().
'">';
142print
'<input type="hidden" name="action" value="set_BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY">';
143print
'<input type="hidden" name="withtab" value="'.$withtab.
'">';
145$sql =
"SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite";
146$sql .=
" FROM ".MAIN_DB_PREFIX.
"c_country";
147$sql .=
" WHERE active > 0";
149$countryArray = array();
150$resql = $db->query($sql);
152 while ($obj = $db->fetch_object($resql)) {
153 $countryArray[$obj->code_iso] = ($obj->code_iso && $langs->transnoentitiesnoconv(
"Country".$obj->code_iso) !=
"Country".$obj->code_iso ? $langs->transnoentitiesnoconv(
"Country".$obj->code_iso) : ($obj->label !=
'-' ? $obj->label :
''));
157$seledted = empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY) ? array() : explode(
',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY);
159print $form->multiselectarray(
'BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY', $countryArray, $seledted);
160print
'<input type="submit" class="button button-edit" value="'.$langs->trans(
"Modify").
'">';
166print
'<tr class="oddeven">';
167print
'<td class="titlefield">';
168print $langs->trans(
"ListOfTrackedEvents").
'</td><td>';
169$arrayoftrackedevents = $block_static->trackedevents;
170foreach ($arrayoftrackedevents as $key => $val) {
171 print $key.
' - '.$langs->trans($val).
'<br>';
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()
Empty header.
blockedlogadmin_prepare_head()
Define head array for tabs of blockedlog tools setup pages.
Class to manage Blocked Log.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_get_fiche_end($notab=0)
Return tab footer of a card.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.