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.112
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
html /
bdc.bdcloud.fr /
core /
class /
Delete
Unzip
Name
Size
Permission
Date
Action
CSMSFile.class.php
8.1
KB
-rwxr-x---
2023-04-04 15:51
antivir.class.php
5.23
KB
-rwxr-x---
2023-04-04 15:51
canvas.class.php
7.11
KB
-rwxr-x---
2023-04-04 15:51
ccountry.class.php
8.65
KB
-rwxr-x---
2023-04-04 15:51
cgenericdic.class.php
11.63
KB
-rwxr-x---
2023-04-04 15:51
comment.class.php
9.46
KB
-rwxr-x---
2023-04-04 15:51
commondocgenerator.class.php
65.1
KB
-rwxr-x---
2023-04-04 15:51
commonincoterm.class.php
3.84
KB
-rwxr-x---
2023-04-04 15:51
commoninvoice.class.php
76.01
KB
-rwxr-x---
2023-04-04 15:51
commonobjectline.class.php
4.55
KB
-rwxr-x---
2023-04-04 15:51
commonorder.class.php
3.52
KB
-rwxr-x---
2023-04-04 15:51
commonstickergenerator.class.php
10.83
KB
-rwxr-x---
2023-04-04 15:51
conf.class.php
44.03
KB
-rwxr-x---
2023-04-04 15:51
cproductnature.class.php
8.73
KB
-rwxr-x---
2023-04-04 15:51
cstate.class.php
7.16
KB
-rwxr-x---
2023-04-04 15:51
ctypent.class.php
7.4
KB
-rwxr-x---
2023-04-04 15:51
ctyperesource.class.php
10.8
KB
-rwxr-x---
2023-04-04 15:51
cunits.class.php
13.56
KB
-rwxr-x---
2023-04-04 15:51
defaultvalues.class.php
12.24
KB
-rwxr-x---
2023-04-04 15:51
discount.class.php
26.65
KB
-rwxr-x---
2023-04-04 15:51
doleditor.class.php
18.58
KB
-rwxr-x---
2023-04-04 15:51
dolexception.class.php
1
KB
-rwxr-x---
2023-04-04 15:51
dolgeoip.class.php
6.19
KB
-rwxr-x---
2023-04-04 15:51
dolgraph.class.php
47.53
KB
-rwxr-x---
2023-04-04 15:51
dolreceiptprinter.class.php
39.7
KB
-rwxr-x---
2023-04-04 15:51
emailsenderprofile.class.php
12.8
KB
-rwxr-x---
2023-04-04 15:51
events.class.php
7.99
KB
-rwxr-x---
2023-04-04 15:51
extralanguages.class.php
5.65
KB
-rwxr-x---
2023-04-04 15:51
fileupload.class.php
18
KB
-rwxr-x---
2023-04-04 15:51
fiscalyear.class.php
13.5
KB
-rwxr-x---
2023-04-04 15:51
genericobject.class.php
1.16
KB
-rwxr-x---
2023-04-04 15:51
google.class.php
2.32
KB
-rwxr-x---
2023-04-04 15:51
hookmanager.class.php
14.99
KB
-rwxr-x---
2023-04-04 15:51
html.formaccounting.class.php
21.03
KB
-rwxr-x---
2023-04-04 15:51
html.formactions.class.php
17.04
KB
-rwxr-x---
2023-04-04 15:51
html.formadmin.class.php
15.21
KB
-rwxr-x---
2023-04-04 15:51
html.formbank.class.php
2.14
KB
-rwxr-x---
2023-04-04 15:51
html.formbarcode.class.php
7.23
KB
-rwxr-x---
2023-04-04 15:51
html.formcategory.class.php
4.77
KB
-rwxr-x---
2023-04-04 15:51
html.formcompany.class.php
41.1
KB
-rwxr-x---
2023-04-04 15:51
html.formcontract.class.php
6.72
KB
-rwxr-x---
2023-04-04 15:51
html.formcron.class.php
2.98
KB
-rwxr-x---
2023-04-04 15:51
html.formexpensereport.class.php
3.98
KB
-rwxr-x---
2023-04-04 15:51
html.formfile.class.php
91.64
KB
-rwxr-x---
2023-04-04 15:51
html.formintervention.class.php
4.37
KB
-rwxr-x---
2023-04-04 15:51
html.formldap.class.php
5.37
KB
-rwxr-x---
2023-04-04 15:51
html.formmail.class.php
66.68
KB
-rwxr-x---
2023-04-04 15:51
html.formmailing.class.php
1.84
KB
-rwxr-x---
2023-04-04 15:51
html.formmargin.class.php
13.61
KB
-rwxr-x---
2023-04-04 15:51
html.formorder.class.php
3.25
KB
-rwxr-x---
2023-04-04 15:51
html.formother.class.php
59.16
KB
-rwxr-x---
2023-04-04 15:51
html.formprojet.class.php
28.03
KB
-rwxr-x---
2023-04-04 15:51
html.formpropal.class.php
4.24
KB
-rwxr-x---
2023-04-04 15:51
html.formsetup.class.php
34.35
KB
-rwxr-x---
2023-04-04 15:51
html.formsms.class.php
10.86
KB
-rwxr-x---
2023-04-04 15:51
html.formsocialcontrib.class.php
3.87
KB
-rwxr-x---
2023-04-04 15:51
html.formticket.class.php
66.86
KB
-rwxr-x---
2023-04-04 15:51
html.formwebsite.class.php
9.75
KB
-rwxr-x---
2023-04-04 15:51
infobox.class.php
9.76
KB
-rwxr-x---
2023-04-04 15:51
interfaces.class.php
13.76
KB
-rwxr-x---
2023-04-04 15:51
ldap.class.php
45.49
KB
-rwxr-x---
2023-04-04 15:51
lessc.class.php
96.72
KB
-rwxr-x---
2023-04-04 15:51
link.class.php
9.6
KB
-rwxr-x---
2023-04-04 15:51
menubase.class.php
25.14
KB
-rwxr-x---
2023-04-04 15:51
notify.class.php
38.24
KB
-rwxr-x---
2023-04-04 15:51
openid.class.php
13.02
KB
-rwxr-x---
2023-04-04 15:51
rssparser.class.php
22.4
KB
-rwxr-x---
2023-04-04 15:51
smtps.class.php
63.95
KB
-rwxr-x---
2023-04-04 15:51
stats.class.php
20.17
KB
-rwxr-x---
2023-04-04 15:51
utils.class.php
50.13
KB
-rwxr-x---
2023-04-04 15:51
utils_diff.class.php
10.94
KB
-rwxr-x---
2023-04-04 15:51
validate.class.php
7.7
KB
-rwxr-x---
2023-04-04 15:51
vcard.class.php
9.68
KB
-rwxr-x---
2023-04-04 15:51
workboardresponse.class.php
1.81
KB
-rwxr-x---
2023-04-04 15:51
Save
Rename
<?php /* Copyright (C) 2021 John BOTELLA <john.botella@atm-consulting.fr> * * 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 * 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/validate.class.php * \ingroup core * \brief File for Utils class */ /** * Class toolbox to validate values */ class Validate { /** * @var DoliDb Database handler (result of a new DoliDB) */ public $db; /** * @var Translate $outputLang */ public $outputLang; /** * @var string Error string * @see $errors */ public $error; /** * Constructor * * @param DoliDB $db Database handler * @param Translate $outputLang Output lang for error */ public function __construct($db, $outputLang = null) { global $langs; if (empty($outputLang)) { $this->outputLang = $langs; } else { $this->outputLang = $outputLang; } if (!is_object($this->outputLang) || !method_exists($this->outputLang, 'load')) { return false; } $this->outputLang->loadLangs(array('validate', 'errors')); $this->db = $db; } /** * Use to clear errors msg or other ghost vars * @return null */ protected function clear() { $this->error = ''; } /** * Use to clear errors msg or other ghost vars * * @param string $errMsg your error message * @return null */ protected function setError($errMsg) { $this->error = $errMsg; } /** * Check for e-mail validity * * @param string $email e-mail address to validate * @param int $maxLength string max length * @return boolean Validity is ok or not */ public function isEmail($email, $maxLength = false) { if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $this->error = $this->outputLang->trans('RequireValidEmail'); return false; } return true; } /** * Check for price validity * * @param string $price Price to validate * @return boolean Validity is ok or not */ public function isPrice($price) { if (!preg_match('/^[0-9]{1,10}(\.[0-9]{1,9})?$/ui', $price)) { $this->error = $this->outputLang->trans('RequireValidValue'); return false; } return true; } /** * Check for timestamp validity * * @param string|int $stamp timestamp to validate * @return boolean Validity is ok or not */ public function isTimestamp($stamp) { if (!is_numeric($stamp) && (int) $stamp == $stamp) { $this->error = $this->outputLang->trans('RequireValidDate'); return false; } return true; } /** * Check for phone validity * * @param string $phone Phone string to validate * @return boolean Validity is ok or not */ public function isPhone($phone) { if (!preg_match('/^[+0-9. ()-]*$/ui', $phone)) { $this->error = $this->outputLang->trans('RequireValidPhone'); return false; } return true; } /** * Check for string max length validity * * @param string $string to validate * @param int $length max length * @return boolean Validity is ok or not */ public function isMaxLength($string, $length) { if (strlen($string) > $length) { $this->error = $this->outputLang->trans('RequireMaxLength', $length); return false; } return true; } /** * Check for string not empty * * @param string $string to validate * @return boolean Validity is ok or not */ public function isNotEmptyString($string) { if (!strlen($string)) { $this->error = $this->outputLang->trans('RequireANotEmptyValue'); return false; } return true; } /** * Check for string min length validity * * @param string $string to validate * @param int $length max length * @return boolean Validity is ok or not */ public function isMinLength($string, $length) { if (strlen($string) < $length) { $this->error = $this->outputLang->trans('RequireMinLength', $length); return false; } return true; } /** * Check url validity * * @param string $url to validate * @return boolean Validity is ok or not */ public function isUrl($url) { if (!filter_var($url, FILTER_VALIDATE_URL)) { $this->error = $this->outputLang->trans('RequireValidUrl'); return false; } return true; } /** * Check Duration validity * * @param mixed $duration to validate * @return boolean Validity is ok or not */ public function isDuration($duration) { if (!is_int($duration) && $duration >= 0) { $this->error = $this->outputLang->trans('RequireValidDuration'); return false; } return true; } /** * Check numeric validity * * @param mixed $string to validate * @return boolean Validity is ok or not */ public function isNumeric($string) { if (!is_numeric($string)) { $this->error = $this->outputLang->trans('RequireValidNumeric'); return false; } return true; } /** * Check for boolean validity * * @param boolean $bool Boolean to validate * @return boolean Validity is ok or not */ public function isBool($bool) { if (!(is_null($bool) || is_bool($bool) || preg_match('/^[0|1]{1}$/ui', $bool))) { $this->error = $this->outputLang->trans('RequireValidBool'); return false; } return true; } /** * Check for all values in db * * @param array $values Boolean to validate * @param string $table the db table name without $this->db->prefix() * @param string $col the target col * @return boolean Validity is ok or not * @throws Exception */ public function isInDb($values, $table, $col) { if (!is_array($values)) { $value_arr = array($values); } else { $value_arr = $values; } if (!count($value_arr)) { $this->error = $this->outputLang->trans('RequireValue'); return false; } foreach ($value_arr as $val) { $sql = "SELECT ".$col." FROM ".$this->db->prefix().$table." WHERE ".$col." = '".$this->db->escape($val)."' LIMIT 1"; // more quick than count(*) to check existing of a row $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); if ($obj) { continue; } } // If something was wrong $this->error = $this->outputLang->trans('RequireValidExistingElement'); return false; } return true; } /** * Check for all values in db * * @param integer $id of element * @param string $classname the class name * @param string $classpath the class path * @return boolean Validity is ok or not * @throws Exception */ public function isFetchable($id, $classname, $classpath) { if (!empty($classpath)) { if (dol_include_once($classpath)) { if ($classname && class_exists($classname)) { /** @var CommonObject $object */ $object = new $classname($this->db); if (!is_callable(array($object, 'fetch')) || !is_callable(array($object, 'isExistingObject'))) { $this->error = $this->outputLang->trans('BadSetupOfFieldFetchNotCallable'); return false; } if (!empty($object->table_element) && $object->isExistingObject($object->table_element, $id)) { return true; } else { $this->error = $this->outputLang->trans('RequireValidExistingElement'); } } else { $this->error = $this->outputLang->trans('BadSetupOfFieldClassNotFoundForValidation'); } } else { $this->error = $this->outputLang->trans('BadSetupOfFieldFileNotFound'); } } else { $this->error = $this->outputLang->trans('BadSetupOfField'); } return false; } }