dolibarr 21.0.0-alpha
modOpenIDConnect.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2014-2015 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2015 Frederic France <frederic.france@free.fr>
4 * Copyright (C) 2023 Maximilien Rozniecki <mrozniecki@easya.solutions>
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
29include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
30
31
32
37{
43 public function __construct($db)
44 {
45 $this->db = $db;
46 $this->numero = 69000; // ToDo
47 // Family can be 'crm','financial','hr','projects','products','ecm','technic','other'
48 // It is used to group modules in module setup page
49 $this->family = "interface";
50 $this->module_position = '32';
51 // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
52 $this->name = preg_replace('/^mod/i', '', get_class($this));
53 // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
54 $this->description = "Enable OpenID Connect authentication";
55 // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
56 $this->version = 'dolibarr';
57 $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
58 // Name of image file used for this module.
59 // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
60 // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
61 $this->picto = 'technic';
62
63 // Data directories to create when module is enabled.
64 $this->dirs = array();
65
66 // Config pages
67 $this->config_page_url = array("openid_connect.php");
68
69 // Dependencies
70 $this->hidden = false; // A condition to hide module
71 $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled
72 $this->requiredby = array(); // List of module ids to disable if this one is disabled
73 $this->conflictwith = array(); // List of module class names as string this module is in conflict with
74 $this->phpmin = array(7, 0); // Minimum version of PHP required by module // Minimum version of PHP required by module
75 $this->need_dolibarr_version = array(3, 7, -2); // Minimum version of Dolibarr required by module
76 $this->conflictwith = array();
77 $this->langfiles = array("openid_connect");
78
79 // Constants
80 $this->const = array();
81
82 // Boxes
83 $this->boxes = array();
84
85 // Permissions
86 $this->rights = array();
87 $this->rights_class = 'openid_connect';
88
89 // List of menus to add
90 $this->menu = array();
91 }
92
93
102 public function init($options = '')
103 {
104 global $conf;
105
106 // Clean before activation
107 $this->remove($options);
108
109 $sql = array();
110
111 return $this->_init($sql, $options);
112 }
113}
Class DolibarrModules.
_init($array_sql, $options='')
Enables a module.
Class to describe and activate module OpenID Connect.
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
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.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:142