dolibarr
25.0.0-alpha
Main Page
Related Pages
Topics
Classes
Files
File List
File Members
dolibarr_dev
htdocs
core
modules
modFTP.class.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
4
* Copyright (C) 2026 Frédéric France <frederic.france@free.fr>
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <https://www.gnu.org/licenses/>.
18
*/
19
28
include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php'
;
29
30
34
class
modFTP
extends
DolibarrModules
35
{
41
public
function
__construct
($db)
42
{
43
$this->db = $db;
44
45
// Id for module (must be unique).
46
// Use here a free id.
47
$this->numero = 2800;
48
49
// Family can be 'crm','financial','hr','projects','product','ecm','technic','other'
50
// It is used to sort modules in module setup page
51
$this->family =
"interface"
;
52
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
53
$this->
name
= preg_replace(
'/^mod/i'
,
''
, get_class($this));
54
// Module description used if translation string 'ModuleXXXDesc' not found (XXX is id value)
55
$this->
description
=
"FTP Client"
;
56
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
57
$this->version =
'dolibarr_deprecated'
;
58
// Key used in llx_const table to save module status enabled/disabled (XXX is id value)
59
$this->const_name =
'MAIN_MODULE_'
.strtoupper($this->
name
);
60
// Name of png file (without png) used for this module
61
$this->picto =
'folder'
;
62
63
// Data directories to create when module is enabled
64
$this->dirs = array(
"/ftp/temp"
);
65
66
// Langs file within the module
67
$this->langfiles = array(
"ftp"
);
68
69
// Config pages. Put here list of php page names stored in admmin directory used to setup module
70
$this->config_page_url = array(
'ftpclient.php@ftp'
);
71
72
// Dependencies
73
$this->depends = array();
// List of modules id that must be enabled if this module is enabled
74
$this->requiredby = array();
// List of modules id to disable if this one is disabled
75
76
// Constants
77
$this->
const
= [
78
[
'FTP_CONNECT_WITH_SSL'
,
'chaine'
,
'0'
,
'Use FTPS for FTP module'
, 1,
'current'
, 1],
79
[
'FTP_CONNECT_WITH_SFTP'
,
'chaine'
,
'0'
,
'Use SFTP for FTP module'
, 1,
'current'
, 1],
80
];
// List of parameters
81
82
// Boxes
83
$this->boxes = [];
// List of boxes
84
$r = 0;
85
86
// Add here list of php file(s) stored in core/boxes that contains class to show a box.
87
// Example:
88
//$this->boxes[$r][1] = "myboxa.php";
89
//$r++;
90
//$this->boxes[$r][1] = "myboxb.php";
91
//$r++;
92
93
// Permissions
94
$this->rights_class =
'ftp'
;
// Permission key
95
$this->rights = array();
// Permission array used by this module
96
97
$r++;
98
$this->rights[$r][0] = 2801;
99
$this->rights[$r][1] =
'Use FTP client in read mode (browse and download only)'
;
100
$this->rights[$r][2] =
'r'
;
101
$this->rights[$r][3] = 0;
102
$this->rights[$r][4] =
'read'
;
103
104
$r++;
105
$this->rights[$r][0] = 2802;
106
$this->rights[$r][1] =
'Use FTP client in write mode (delete or upload files)'
;
107
$this->rights[$r][2] =
'w'
;
108
$this->rights[$r][3] = 0;
109
$this->rights[$r][4] =
'write'
;
110
111
112
// Menus
113
//-------
114
$this->menu[$r] = array(
'fk_menu'
=>0,
115
'type'
=>
'top'
,
116
'titre'
=>
'FTP'
,
117
'prefix'
=>
img_picto
(
''
, $this->picto,
'class="pictofixedwidth em092"'
),
118
'mainmenu'
=>
'ftp'
,
119
'url'
=>
'/ftp/index.php'
,
120
'langs'
=>
'ftp'
,
121
'position'
=>100,
122
'enabled'
=>
'isModEnabled("ftp")'
,
123
'perms'
=>
'$user->hasRight("ftp", "read") || $user->hasRight("ftp", "write") || $user->hasRight("ftp", "setup")'
,
124
'target'
=>
''
,
125
'user'
=>2);
// 0=Menu for internal users, 1=external users, 2=both
126
$r++;
127
}
128
}
DolibarrModules
Class DolibarrModules.
Definition
DolibarrModules.class.php:39
modFTP
Description and activation class for module FTP.
Definition
modFTP.class.php:35
modFTP\__construct
__construct($db)
Constructor.
Definition
modFTP.class.php:41
description
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
Definition
email_expire_services_to_customers.php:96
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
Definition
html.lib.php:1291
name
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition
repair.php:133
Generated on Tue Sep 1 2026 01:00:39 for
dolibarr
by Doxygen 1.11.0