Projet

Général

Profil

Révision cfceb792

Ajouté par Assos Assos il y a plus de 4 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/acl/acl.module
87 87
    ->execute();
88 88
}
89 89

  
90
/**
91
 * Remove all users from an ACL.
92
 */
93
function acl_remove_all_users($acl_id) {
94
  db_delete('acl_user')
95
    ->condition('acl_id', $acl_id)
96
    ->execute();
97
}
98

  
90 99
/**
91 100
 * Provide a form to edit the ACL that can be embedded in other forms.
92 101
 *
......
112 121
  $subselect->addExpression((int) $update, 'grant_update');
113 122
  $subselect->addExpression((int) $delete, 'grant_delete');
114 123
  $subselect->addExpression($priority, 'priority');
115
  db_insert('acl_node')
116
    ->from($subselect)
117
    ->execute();
124
  $query = db_insert('acl_node')
125
    ->fields(array('nid', 'acl_id', 'grant_view', 'grant_update', 'grant_delete', 'priority'));
126
  foreach ($subselect->execute()->fetchAll(PDO::FETCH_ASSOC) as $record) {
127
    $query->values($record);
128
  }
129
  $query->execute();
118 130
}
119 131

  
120 132
/**
......
241 253
  return $uids;
242 254
}
243 255

  
256
/**
257
 * Get the user names of an ACL.
258
 */
259
function acl_get_usernames($acl_id) {
260
  _acl_module_load_include('admin.inc');
261
  return _acl_get_usernames($acl_id);
262
}
263

  
244 264
/**
245 265
 * Implements hook_node_access_records().
246 266
 */
......
308 328
  static $loaded = array();
309 329

  
310 330
  if (!isset($loaded[$type])) {
311
    $path = module_load_include($type, 'acl');
331
    module_load_include($type, 'acl');
312 332
    $loaded[$type] = drupal_get_path('module', 'acl') . "/acl.$type";
313 333
  }
314 334
  return $loaded[$type];
......
335 355
        $acl->tag = $acl->name . '-' . $acl->number;
336 356
      }
337 357
      foreach (user_load_multiple(acl_get_uids($row->gid)) as $account) {
338
        $usernames[] = theme('username', array('account' => $account));
358
        $usernames[] = _acl_format_username($account);
339 359
      }
340 360
      if (isset($usernames)) {
341 361
        $usernames = implode(', ', $usernames);
......
373 393
  return $text;
374 394
}
375 395

  
396
/**
397
 * Helper function to format a user name.
398
 */
399
function _acl_format_username($account) {
400
  return check_plain(format_username($account));
401
}
402

  

Formats disponibles : Unified diff