1: <?php
2:
3: /**
4: * This file contains the CONTENIDO rights functions.
5: *
6: * These functions now are all deprecated. The class cRights should be used instead.
7: *
8: * @package Core
9: * @subpackage Backend
10: * @author Martin Horwath
11: * @author Murat Purc <murat@purc.de>
12: * @copyright four for business AG <www.4fb.de>
13: * @license http://www.contenido.org/license/LIZENZ.txt
14: * @link http://www.4fb.de
15: * @link http://www.contenido.org
16: */
17:
18: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
19:
20: /**
21: * Function checks if a language is associated with a given list of clients
22: *
23: * @deprecated [2019-03-26] use cApiClientLanguageCollection::hasLanguageInClients() instead
24: *
25: * @param array $aClients
26: * array of clients to check
27: * @param int $iLang
28: * language id which should be checked
29: * @param array $aCfg
30: * CONTENIDO configruation array (not needed anymore)
31: * @param cDb $oDb
32: * CONTENIDO database object (not needed anymore)
33: *
34: * @return bool
35: * If language id corresponds to list of clients true otherwise false.
36: *
37: * @throws cDbException
38: */
39: function checkLangInClients($aClients, $iLang, $aCfg, $oDb)
40: {
41: $oClientLanguageCollection = new cApiClientLanguageCollection();
42:
43: return $oClientLanguageCollection->hasLanguageInClients($iLang, $aClients);
44: }
45:
46: /**
47: * Duplicate rights for any element.
48: *
49: * @deprecated [2019-03-26] use cRights::copyRightsForElement() instead
50: *
51: * @param string $area
52: * Main area name (e. g. 'lay', 'mod', 'str', 'tpl', etc.)
53: * @param int $iditem
54: * ID of element to copy
55: * @param int $newiditem
56: * ID of the new element
57: * @param bool $idlang
58: * ID of language, if passed only rights for this language
59: * will be created, otherwise for all existing languages
60: *
61: * @return bool
62: * True on success otherwise false
63: *
64: * @throws cDbException
65: * @throws cException
66: * @throws cInvalidArgumentException
67: */
68: function copyRightsForElement($area, $iditem, $newiditem, $idlang = false)
69: {
70: return cRights::copyRightsForElement($area, $iditem, $newiditem, $idlang);
71: }
72:
73: /**
74: * Create rights for any element
75: *
76: * @deprecated [2019-03-26] use cRights::createRightsForElement() instead
77: *
78: * @param string $area
79: * Main area name (e. g. 'lay', 'mod', 'str', 'tpl', etc.)
80: * @param int $iditem
81: * ID of new element
82: * @param bool $idlang
83: * ID of language, if passed only rights for this language
84: * will be created, otherwise for all existing languages
85: *
86: * @return bool
87: * True on success otherwise false
88: *
89: * @throws cDbException
90: * @throws cException
91: * @throws cInvalidArgumentException
92: */
93: function createRightsForElement($area, $iditem, $idlang = false)
94: {
95: return cRights::createRightsForElement($area, $iditem, $idlang);
96: }
97:
98: /**
99: * Delete rights for any element
100: *
101: * @deprecated [2019-03-26] use cRights::deleteRightsForElement() instead
102: *
103: * @param string $area
104: * main area name
105: * @param int $iditem
106: * ID of new element
107: * @param bool $idlang
108: * ID of lang parameter
109: *
110: * @throws cDbException
111: * @throws cException
112: * @throws cInvalidArgumentException
113: */
114: function deleteRightsForElement($area, $iditem, $idlang = false)
115: {
116: cRights::deleteRightsForElement($area, $iditem, $idlang);
117: }
118:
119: /**
120: * Builds user/group permissions (sysadmin, admin, client and language) by
121: * processing request variables ($msysadmin, $madmin, $mclient, $mlang) and
122: * returns the build permissions array.
123: *
124: * @deprecated [2019-03-26] use cRights::buildUserOrGroupPermsFromRequest() instead
125: *
126: * @param bool $bAddUserToClient
127: * Flag to add current user to current client, if no client is specified.
128: *
129: * @return array
130: *
131: * @throws cDbException
132: */
133: function buildUserOrGroupPermsFromRequest($bAddUserToClient = false)
134: {
135: return cRights::buildUserOrGroupPermsFromRequest($bAddUserToClient);
136: }
137:
138: /**
139: * @deprecated [2019-03-26] use cRights::saveRights() instead
140: * @return bool
141: *
142: * @throws cDbException
143: * @throws cException
144: * @throws cInvalidArgumentException
145: */
146: function saveRights()
147: {
148: return cRights::saveRights();
149: }
150:
151: /**
152: * @deprecated [2019-03-26] use cRights::saveGroupRights() instead
153: * @return bool
154: *
155: * @throws cDbException
156: * @throws cException
157: * @throws cInvalidArgumentException
158: */
159: function saveGroupRights()
160: {
161: return cRights::saveGroupRights();
162: }
163:
164: /**
165: * Build list of rights for all relevant and online areas except "login" and their relevant actions.
166: *
167: * @deprecated [2019-03-26] use cRights::getRightsList() instead
168: * @return array
169: */
170: function getRightsList()
171: {
172: return cRights::getRightsList();
173: }
174: