function print_pdf_update_6004 in Printer, email and PDF versions 5.x
Same name and namespace in other branches
- 5.4 print_pdf/print_pdf.install \print_pdf_update_6004()
- 6 print_pdf/print_pdf.install \print_pdf_update_6004()
Update to version 6.x-1.8
File
- print_pdf/
print_pdf.install, line 234 - Install file of the print_pdf module
Code
function print_pdf_update_6004() {
// add new 'access PDF version' permission to any role which has 'access print'
$ret = array();
$dbret = db_query('SELECT * FROM {permission}');
while ($role = db_fetch_object($dbret)) {
if (strpos($role->perm, 'access print') !== FALSE) {
$role->perm = db_escape_string('access PDF version, ' . $role->perm);
$ret[] = update_sql("UPDATE {permission} SET perm = '{$role->perm}' WHERE rid = {$role->rid}");
}
}
return $ret;
}