dolibarr  7.0.0-beta
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  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
27 include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php';
28 
29 
33 class modFTP extends DolibarrModules
34 {
35 
41  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 = "other";
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';
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  // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific)
61  $this->special = 1;
62  // Name of png file (without png) used for this module
63  $this->picto='dir';
64 
65  // Data directories to create when module is enabled
66  $this->dirs = array("/ftp/temp");
67 
68  // Langs file within the module
69  $this->langfiles = array("ftp");
70 
71  // Config pages. Put here list of php page names stored in admmin directory used to setup module
72  $this->config_page_url = array('ftpclient.php@ftp');
73 
74  // Dependencies
75  $this->depends = array(); // List of modules id that must be enabled if this module is enabled
76  $this->requiredby = array(); // List of modules id to disable if this one is disabled
77 
78  // Constants
79  $this->const = array(
80  1=>array('FTP_CONNECT_WITH_SSL','chaine','0','Use FTPS for FTP module', 1, 'current', 1),
81  2=>array('FTP_CONNECT_WITH_SFTP','chaine','0','Use SFTP for FTP module', 1, 'current', 1)
82  ); // List of parameters
83 
84  // Boxes
85  $this->boxes = array(); // List of boxes
86  $r=0;
87 
88  // Add here list of php file(s) stored in core/boxes that contains class to show a box.
89  // Example:
90  //$this->boxes[$r][1] = "myboxa.php";
91  //$r++;
92  //$this->boxes[$r][1] = "myboxb.php";
93  //$r++;
94 
95  // Permissions
96  $this->rights_class = 'ftp'; // Permission key
97  $this->rights = array(); // Permission array used by this module
98 
99  $r++;
100  $this->rights[$r][0] = 2801;
101  $this->rights[$r][1] = 'Use FTP client in read mode (browse and download only)';
102  $this->rights[$r][2] = 'r';
103  $this->rights[$r][3] = 0;
104  $this->rights[$r][4] = 'read';
105 
106  $r++;
107  $this->rights[$r][0] = 2802;
108  $this->rights[$r][1] = 'Use FTP client in write mode (delete or upload files)';
109  $this->rights[$r][2] = 'w';
110  $this->rights[$r][3] = 0;
111  $this->rights[$r][4] = 'write';
112 
113 
114  // Menus
115  //-------
116  $this->menu[$r]=array('fk_menu'=>0,
117  'type'=>'top',
118  'titre'=>'FTP',
119  'mainmenu'=>'ftp',
120  'url'=>'/ftp/index.php',
121  'langs'=>'ftp',
122  'position'=>100,
123  'enabled'=>'$conf->ftp->enabled',
124  'perms'=>'$user->rights->ftp->read || $user->rights->ftp->write || $user->rights->ftp->setup',
125  'target'=>'',
126  'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
127  $r++;
128  }
129 }
130 
Class DolibarrModules.
</td >< tdclass="liste_titre"align="right"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow img yes disabled img no img no< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="'.$i.'"'.$disabled.'></td >< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"></td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:554
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104
Description and activation class for module FTP.
__construct($db)
Constructor.