You are here

function signup_update_5202 in Signup 6.2

Same name and namespace in other branches
  1. 5.2 signup.install \signup_update_5202()
  2. 6 signup.install \signup_update_5202()

Add "cancel own signups" permission to all roles that have "sign up for content" permission.

File

./signup.install, line 347

Code

function signup_update_5202() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("UPDATE {permission} SET perm = CONCAT(perm, ', cancel own signups') WHERE CONCAT(perm, ', ') LIKE '%%sign up for content, %%'");
      break;
    case 'pgsql':
      $ret[] = update_sql("UPDATE {permission} SET perm = perm || ', cancel own signups' WHERE perm || ', ' LIKE '%%sign up for content, %%'");
      break;
  }
  drupal_set_message(t("Added the 'cancel own signups' permission to all roles that have the 'sign up for content' permission.") . '<br />' . t('If you do not want your users to cancel their own signups, go to the <a href="@access_url">Access control</a> page and unset this permission.', array(
    '@access_url' => url('/admin/user/access'),
  )));
  return $ret;
}