Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ref] Remove php4 support from BAO_Acl class #16119

Merged
merged 1 commit into from
Dec 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions CRM/ACL/BAO/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ public static function operation() {
/**
* Construct a WHERE clause to handle permissions to $object_*
*
* @deprecated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still in the same comment block - just lower

*
* @param array $tables
* Any tables that may be needed in the FROM.
* @param string $operation
Expand All @@ -95,6 +93,10 @@ public static function operation() {
*
* @return string
* The WHERE clause, or 0 on failure
* @throws \CRM_Core_Exception
*
* @deprecated
*
*/
public static function permissionClause(
&$tables, $operation,
Expand Down Expand Up @@ -318,6 +320,8 @@ public static function permissionClause(
* @return string|null
* WHERE-style clause to filter results,
* or null if $table or $id is null
*
* @throws \CRM_Core_Exception
*/
public static function getClause($table, $id, &$tables) {
$table = CRM_Utils_Type::escape($table, 'String');
Expand Down Expand Up @@ -379,8 +383,10 @@ public function toArray($format = '%s', $hideEmpty = FALSE) {
*
* @return array
* Array of assoc. arrays of ACL rules
*
* @throws \CRM_Core_Exception
*/
public static function &getACLs($contact_id = NULL, $group_id = NULL, $aclRoles = FALSE) {
public static function getACLs($contact_id = NULL, $group_id = NULL, $aclRoles = FALSE) {
$results = [];

if (empty($contact_id)) {
Expand Down Expand Up @@ -444,8 +450,10 @@ public static function &getACLs($contact_id = NULL, $group_id = NULL, $aclRoles
*
* @return array
* Array of assoc. arrays of ACL rules
*
* @throws \CRM_Core_Exception
*/
public static function &getACLRoles($contact_id = NULL, $group_id = NULL) {
public static function getACLRoles($contact_id = NULL, $group_id = NULL) {
$contact_id = CRM_Utils_Type::escape($contact_id, 'Integer');
if ($group_id) {
$group_id = CRM_Utils_Type::escape($group_id, 'Integer');
Expand Down Expand Up @@ -510,8 +518,9 @@ public static function &getACLRoles($contact_id = NULL, $group_id = NULL) {
*
* @return array
* Assoc array of ACL rules
* @throws \CRM_Core_Exception
*/
public static function &getGroupACLs($contact_id, $aclRoles = FALSE) {
public static function getGroupACLs($contact_id, $aclRoles = FALSE) {
$contact_id = CRM_Utils_Type::escape($contact_id, 'Integer');

$rule = new CRM_ACL_BAO_ACL();
Expand Down Expand Up @@ -554,8 +563,9 @@ public static function &getGroupACLs($contact_id, $aclRoles = FALSE) {
*
* @return array
* Array of assoc. arrays of ACL rules
* @throws \CRM_Core_Exception
*/
public static function &getGroupACLRoles($contact_id) {
public static function getGroupACLRoles($contact_id) {
$contact_id = CRM_Utils_Type::escape($contact_id, 'Integer');

$rule = new CRM_ACL_BAO_ACL();
Expand Down Expand Up @@ -626,8 +636,10 @@ public static function &getGroupACLRoles($contact_id) {
*
* @return array
* Assoc array of ACL rules
*
* @throws \CRM_Core_Exception
*/
public static function &getAllByContact($contact_id) {
public static function getAllByContact($contact_id) {
$result = [];

/* First, the contact-specific ACLs, including ACL Roles */
Expand All @@ -644,7 +656,7 @@ public static function &getAllByContact($contact_id) {
*
* @return CRM_ACL_DAO_ACL
*/
public static function create(&$params) {
public static function create($params) {
$dao = new CRM_ACL_DAO_ACL();
$dao->copyValues($params);
$dao->save();
Expand All @@ -653,7 +665,7 @@ public static function create(&$params) {

/**
* @param array $params
* @param $defaults
* @param array $defaults
*/
public static function retrieve(&$params, &$defaults) {
CRM_Core_DAO::commonRetrieve('CRM_ACL_DAO_ACL', $params, $defaults);
Expand Down