Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.119
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html /
gmd.bdcloud.fr /
core /
class /
Delete
Unzip
Name
Size
Permission
Date
Action
CMailFile.class.php
60.83
KB
-rw-r--r--
2022-09-27 16:06
CSMSFile.class.php
7.89
KB
-rw-r--r--
2022-09-27 16:06
antivir.class.php
5.23
KB
-rw-r--r--
2022-09-27 16:06
canvas.class.php
6.96
KB
-rw-r--r--
2022-09-27 16:06
ccountry.class.php
8.63
KB
-rw-r--r--
2022-09-27 16:06
comment.class.php
9.42
KB
-rw-r--r--
2022-09-27 16:06
commondocgenerator.class.php
63.6
KB
-rw-r--r--
2022-09-27 16:06
commonincoterm.class.php
3.73
KB
-rw-r--r--
2022-09-27 16:06
commoninvoice.class.php
32.41
KB
-rw-r--r--
2022-09-27 16:06
commonobject.class.php
331.6
KB
-rw-r--r--
2022-09-27 16:06
commonobjectline.class.php
3.58
KB
-rw-r--r--
2022-09-27 16:06
commonorder.class.php
3.21
KB
-rw-r--r--
2022-09-27 16:06
commonstickergenerator.class.php
10.48
KB
-rw-r--r--
2022-09-27 16:06
conf.class.php
42.8
KB
-rw-r--r--
2022-09-27 16:06
coreobject.class.php
9.43
KB
-rw-r--r--
2022-09-27 16:06
cproductnature.class.php
8.7
KB
-rw-r--r--
2022-09-27 16:06
cstate.class.php
7.15
KB
-rw-r--r--
2022-09-27 16:06
ctypent.class.php
7.38
KB
-rw-r--r--
2022-09-27 16:06
ctyperesource.class.php
10.87
KB
-rw-r--r--
2022-09-27 16:06
cunits.class.php
13.21
KB
-rw-r--r--
2022-09-27 16:06
defaultvalues.class.php
12.24
KB
-rw-r--r--
2022-09-27 16:06
discount.class.php
26.24
KB
-rw-r--r--
2022-09-27 16:06
doleditor.class.php
16.94
KB
-rw-r--r--
2022-09-27 16:06
dolexception.class.php
1
KB
-rw-r--r--
2022-09-27 16:06
dolgeoip.class.php
6.14
KB
-rw-r--r--
2022-09-27 16:06
dolgraph.class.php
46.53
KB
-rw-r--r--
2022-09-27 16:06
dolreceiptprinter.class.php
37
KB
-rw-r--r--
2022-09-27 16:06
emailsenderprofile.class.php
12.78
KB
-rw-r--r--
2022-09-27 16:06
evalmath.class.php
16.92
KB
-rw-r--r--
2022-09-27 16:06
events.class.php
7.98
KB
-rw-r--r--
2022-09-27 16:06
extrafields.class.php
88.38
KB
-rw-r--r--
2022-09-27 16:06
extralanguages.class.php
5.65
KB
-rw-r--r--
2022-09-27 16:06
fileupload.class.php
17.33
KB
-rw-r--r--
2022-09-27 16:06
fiscalyear.class.php
13.64
KB
-rw-r--r--
2022-09-27 16:06
genericobject.class.php
1.16
KB
-rw-r--r--
2022-09-27 16:06
google.class.php
2.32
KB
-rw-r--r--
2022-09-27 16:06
hookmanager.class.php
14.69
KB
-rw-r--r--
2022-09-27 16:06
html.form.class.php
406.13
KB
-rw-r--r--
2022-09-27 16:06
html.formaccounting.class.php
19.95
KB
-rw-r--r--
2022-09-27 16:06
html.formactions.class.php
16.39
KB
-rw-r--r--
2022-09-27 16:06
html.formadmin.class.php
15.13
KB
-rw-r--r--
2022-09-27 16:06
html.formbank.class.php
2.14
KB
-rw-r--r--
2022-09-27 16:06
html.formbarcode.class.php
7.25
KB
-rw-r--r--
2022-09-27 16:06
html.formcategory.class.php
2.12
KB
-rw-r--r--
2022-09-27 16:06
html.formcompany.class.php
40.76
KB
-rw-r--r--
2022-09-27 16:06
html.formcontract.class.php
6.7
KB
-rw-r--r--
2022-09-27 16:06
html.formcron.class.php
2.91
KB
-rw-r--r--
2022-09-27 16:06
html.formexpensereport.class.php
3.98
KB
-rw-r--r--
2022-09-27 16:06
html.formfile.class.php
92.42
KB
-rw-r--r--
2022-09-27 16:06
html.formintervention.class.php
4.37
KB
-rw-r--r--
2022-09-27 16:06
html.formldap.class.php
5.37
KB
-rw-r--r--
2022-09-27 16:06
html.formmail.class.php
64.23
KB
-rw-r--r--
2022-09-27 16:06
html.formmailing.class.php
1.82
KB
-rw-r--r--
2022-09-27 16:06
html.formmargin.class.php
13.28
KB
-rw-r--r--
2022-09-27 16:06
html.formorder.class.php
3.25
KB
-rw-r--r--
2022-09-27 16:06
html.formother.class.php
63.51
KB
-rw-r--r--
2022-09-27 16:06
html.formprojet.class.php
27.23
KB
-rw-r--r--
2022-09-27 16:06
html.formpropal.class.php
4.16
KB
-rw-r--r--
2022-09-27 16:06
html.formsetup.class.php
28.66
KB
-rw-r--r--
2022-09-27 16:06
html.formsms.class.php
10.84
KB
-rw-r--r--
2022-09-27 16:06
html.formsocialcontrib.class.php
3.85
KB
-rw-r--r--
2022-09-27 16:06
html.formticket.class.php
56.73
KB
-rw-r--r--
2022-09-27 16:06
html.formwebsite.class.php
9.25
KB
-rw-r--r--
2022-09-27 16:06
infobox.class.php
9.76
KB
-rw-r--r--
2022-09-27 16:06
interfaces.class.php
13.76
KB
-rw-r--r--
2022-09-27 16:06
ldap.class.php
44.78
KB
-rw-r--r--
2022-09-27 16:06
lessc.class.php
96.65
KB
-rw-r--r--
2022-09-27 16:06
link.class.php
9.58
KB
-rw-r--r--
2022-09-27 16:06
menu.class.php
4.51
KB
-rw-r--r--
2022-09-27 16:06
menubase.class.php
24.99
KB
-rw-r--r--
2022-09-27 16:06
notify.class.php
36.78
KB
-rw-r--r--
2022-09-27 16:06
openid.class.php
13.93
KB
-rw-r--r--
2022-09-27 16:06
rssparser.class.php
22.08
KB
-rw-r--r--
2022-09-27 16:06
smtps.class.php
62.18
KB
-rw-r--r--
2022-09-27 16:06
stats.class.php
19.22
KB
-rw-r--r--
2022-09-27 16:06
translate.class.php
43.89
KB
-rw-r--r--
2022-09-27 16:06
utils.class.php
40.2
KB
-rw-r--r--
2022-09-27 16:06
utils_diff.class.php
10.81
KB
-rw-r--r--
2022-09-27 16:06
validate.class.php
7.63
KB
-rw-r--r--
2022-09-27 16:06
vcard.class.php
9.67
KB
-rw-r--r--
2022-09-27 16:06
workboardresponse.class.php
1.81
KB
-rw-r--r--
2022-09-27 16:06
Save
Rename
<?php /* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ /** * \file htdocs/core/class/interfaces.class.php * \ingroup core * \brief Fichier de la classe de gestion des triggers */ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; /** * Class to manage triggers */ class Interfaces { /** * @var DoliDB Database handler. */ public $db; public $dir; // Directory with all core and external triggers files /** * @var string[] Error codes (or messages) */ public $errors = array(); /** * Constructor * * @param DoliDB $db Database handler */ public function __construct($db) { $this->db = $db; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Function called when a Dolibarr business event occurs * This function call all qualified triggers. * * @param string $action Trigger event code * @param object $object Objet concerned. Some context information may also be provided into array property object->context. * @param User $user Objet user * @param Translate $langs Objet lang * @param Conf $conf Objet conf * @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise. */ public function run_triggers($action, $object, $user, $langs, $conf) { // phpcs:enable // Check parameters if (!is_object($object) || !is_object($conf)) { // Error $this->error = 'function run_triggers called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf); dol_syslog(get_class($this).'::run_triggers '.$this->error, LOG_ERR); $this->errors[] = $this->error; return -1; } if (!is_object($langs)) { // Warning dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING); } if (!is_object($user)) { // Warning dol_syslog(get_class($this).'::run_triggers was called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING); $user = new User($this->db); } //dol_syslog(get_class($this)."::run_triggers action=".$action." Launch run_triggers", LOG_DEBUG); $nbfile = $nbtotal = $nbok = $nbko = 0; $files = array(); $modules = array(); $orders = array(); $i = 0; $dirtriggers = array_merge(array('/core/triggers'), $conf->modules_parts['triggers']); foreach ($dirtriggers as $reldir) { $dir = dol_buildpath($reldir, 0); $newdir = dol_osencode($dir); //print "xx".$dir;exit; // Check if directory exists (we do not use dol_is_dir to avoir loading files.lib.php at each call) if (!is_dir($newdir)) { continue; } $handle = opendir($newdir); if (is_resource($handle)) { $fullpathfiles = array(); while (($file = readdir($handle)) !== false) { $reg = array(); if (is_readable($newdir."/".$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php$/i', $file, $reg)) { $part1 = $reg[1]; $part2 = $reg[2]; $part3 = $reg[3]; $nbfile++; // Check if trigger file is disabled by name if (preg_match('/NORUN$/i', $file)) { continue; } // Check if trigger file is for a particular module $qualified = true; if (strtolower($reg[2]) != 'all') { $module = preg_replace('/^mod/i', '', $reg[2]); $constparam = 'MAIN_MODULE_'.strtoupper($module); if (empty($conf->global->$constparam)) { $qualified = false; } } if (!$qualified) { //dol_syslog(get_class($this)."::run_triggers action=".$action." Triggers for file '".$file."' need module to be enabled", LOG_DEBUG); continue; } $modName = "Interface".ucfirst($reg[3]); //print "file=$file - modName=$modName\n"; if (in_array($modName, $modules)) { // $modules = list of modName already loaded $langs->load("errors"); dol_syslog(get_class($this)."::run_triggers action=".$action." ".$langs->trans("ErrorDuplicateTrigger", $newdir."/".$file, $fullpathfiles[$modName]), LOG_WARNING); continue; } try { //print 'Todo for '.$modName." : ".$newdir.'/'.$file."\n"; include_once $newdir.'/'.$file; //print 'Done for '.$modName."\n"; } catch (Exception $e) { dol_syslog('ko for '.$modName." ".$e->getMessage()."\n", LOG_ERR); } $modules[$i] = $modName; $files[$i] = $file; $fullpathfiles[$modName] = $newdir.'/'.$file; $orders[$i] = $part1.'_'.$part2.'_'.$part3; // Set sort criteria value $i++; } } closedir($handle); } } asort($orders); // Loop on each trigger foreach ($orders as $key => $value) { $modName = $modules[$key]; if (empty($modName)) { continue; } $objMod = new $modName($this->db); if ($objMod) { $dblevelbefore = $this->db->transaction_opened; $result = 0; if (method_exists($objMod, 'runTrigger')) { // New method to implement //dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_DEBUG); $result = $objMod->runTrigger($action, $object, $user, $langs, $conf); } elseif (method_exists($objMod, 'run_trigger')) { // Deprecated method dol_syslog(get_class($this)."::run_triggers action=".$action." Launch old method run_trigger (rename your trigger into runTrigger) for file '".$files[$key]."'", LOG_WARNING); $result = $objMod->run_trigger($action, $object, $user, $langs, $conf); } else { dol_syslog(get_class($this)."::run_triggers action=".$action." A trigger was declared for class ".get_class($objMod)." but method runTrigger was not found", LOG_ERR); } $dblevelafter = $this->db->transaction_opened; if ($dblevelbefore != $dblevelafter) { $errormessage = "Error, the balance begin/close of db transactions has been broken into trigger ".$modName." with action=".$action." before=".$dblevelbefore." after=".$dblevelafter; $this->errors[] = $errormessage; dol_syslog($errormessage, LOG_ERR); $result = -1; } if ($result > 0) { // Action OK $nbtotal++; $nbok++; } if ($result == 0) { // Aucune action faite $nbtotal++; } if ($result < 0) { // Action KO //dol_syslog("Error in trigger ".$action." - result = ".$result." - Nb of error string returned = ".count($objMod->errors), LOG_ERR); $nbtotal++; $nbko++; if (!empty($objMod->errors)) { $this->errors = array_merge($this->errors, $objMod->errors); } elseif (!empty($objMod->error)) { $this->errors[] = $objMod->error; } //dol_syslog("Error in trigger ".$action." - Nb of error string returned = ".count($this->errors), LOG_ERR); } } else { dol_syslog(get_class($this)."::run_triggers action=".$action." Failed to instantiate trigger for file '".$files[$key]."'", LOG_ERR); } } if ($nbko) { dol_syslog(get_class($this)."::run_triggers action=".$action." Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko." - Nb of error string returned in this->errors = ".count($this->errors), LOG_ERR); return -$nbko; } else { //dol_syslog(get_class($this)."::run_triggers Files found: ".$nbfile.", Files launched: ".$nbtotal.", Done: ".$nbok.", Failed: ".$nbko, LOG_DEBUG); return $nbok; } } /** * Return list of triggers. Function used by admin page htdoc/admin/triggers. * List is sorted by trigger filename so by priority to run. * * @param array $forcedirtriggers null=All default directories. This parameter is used by modulebuilder module only. * @return array Array list of triggers */ public function getTriggersList($forcedirtriggers = null) { global $conf, $langs, $db; $files = array(); $fullpath = array(); $relpath = array(); $iscoreorexternal = array(); $modules = array(); $orders = array(); $i = 0; $dirtriggers = array_merge(array('/core/triggers/'), $conf->modules_parts['triggers']); if (is_array($forcedirtriggers)) { $dirtriggers = $forcedirtriggers; } foreach ($dirtriggers as $reldir) { $dir = dol_buildpath($reldir, 0); $newdir = dol_osencode($dir); // Check if directory exists (we do not use dol_is_dir to avoid loading files.lib.php at each call) if (!is_dir($newdir)) { continue; } $handle = opendir($newdir); if (is_resource($handle)) { while (($file = readdir($handle)) !== false) { $reg = array(); if (is_readable($newdir.'/'.$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/', $file, $reg)) { if (preg_match('/\.back$/', $file)) { continue; } $part1 = $reg[1]; $part2 = $reg[2]; $part3 = $reg[3]; $modName = 'Interface'.ucfirst($reg[3]); //print "file=$file"; print "modName=$modName"; exit; if (in_array($modName, $modules)) { $langs->load("errors"); print '<div class="error">'.$langs->trans("Error").' : '.$langs->trans("ErrorDuplicateTrigger", $modName, "/htdocs/core/triggers/").'</div>'; } else { include_once $newdir.'/'.$file; } $files[$i] = $file; $fullpath[$i] = $dir.'/'.$file; $relpath[$i] = preg_replace('/^\//', '', $reldir).'/'.$file; $iscoreorexternal[$i] = ($reldir == '/core/triggers/' ? 'internal' : 'external'); $modules[$i] = $modName; $orders[$i] = $part1.'_'.$part2.'_'.$part3; // Set sort criteria value $i++; } } closedir($handle); } } asort($orders); $triggers = array(); $j = 0; // Loop on each trigger foreach ($orders as $key => $value) { $modName = $modules[$key]; if (empty($modName)) { continue; } if (!class_exists($modName)) { print 'Error: A trigger file was found but its class "'.$modName.'" was not found.'."<br>\n"; continue; } $text = ''; try { $objMod = new $modName($db); if (is_subclass_of($objMod, 'DolibarrTriggers')) { // Define disabledbyname and disabledbymodule $disabledbyname = 0; $disabledbymodule = 1; $module = ''; // Check if trigger file is disabled by name if (preg_match('/NORUN$/i', $files[$key])) { $disabledbyname = 1; } // Check if trigger file is for a particular module if (preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php/i', $files[$key], $reg)) { $module = preg_replace('/^mod/i', '', $reg[2]); $constparam = 'MAIN_MODULE_'.strtoupper($module); if (strtolower($module) == 'all') { $disabledbymodule = 0; } elseif (empty($conf->global->$constparam)) { $disabledbymodule = 2; } $triggers[$j]['module'] = strtolower($module); } // We set info of modules $triggers[$j]['picto'] = (!empty($objMod->picto)) ? img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "'); $triggers[$j]['file'] = $files[$key]; $triggers[$j]['fullpath'] = $fullpath[$key]; $triggers[$j]['relpath'] = $relpath[$key]; $triggers[$j]['iscoreorexternal'] = $iscoreorexternal[$key]; $triggers[$j]['version'] = $objMod->getVersion(); $triggers[$j]['status'] = img_picto($langs->trans("Active"), 'tick'); if ($disabledbyname > 0 || $disabledbymodule > 1) { $triggers[$j]['status'] = ''; } $text = '<b>'.$langs->trans("Description").':</b><br>'; $text .= $objMod->getDesc().'<br>'; $text .= '<br><b>'.$langs->trans("Status").':</b><br>'; if ($disabledbyname == 1) { $text .= $langs->trans("TriggerDisabledByName").'<br>'; if ($disabledbymodule == 2) { $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'<br>'; } } else { if ($disabledbymodule == 0) { $text .= $langs->trans("TriggerAlwaysActive").'<br>'; } if ($disabledbymodule == 1) { $text .= $langs->trans("TriggerActiveAsModuleActive", $module).'<br>'; } if ($disabledbymodule == 2) { $text .= $langs->trans("TriggerDisabledAsModuleDisabled", $module).'<br>'; } } } else { $triggers[$j]['picto'] = (!empty($objMod->picto)) ? img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "'); $triggers[$j]['file'] = $files[$key]; $triggers[$j]['fullpath'] = $fullpath[$key]; $triggers[$j]['relpath'] = $relpath[$key]; $triggers[$j]['status'] = img_picto('Error: Trigger '.$modName.' does not extends DolibarrTriggers', 'warning'); //print 'Error: Trigger '.$modName.' does not extends DolibarrTriggers<br>'; $text = 'Error: Trigger '.$modName.' does not extends DolibarrTriggers'; } } catch (Exception $e) { print $e->getMessage(); } $triggers[$j]['info'] = $text; $j++; } return $triggers; } }