summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2009-07-09 12:42:18 (GMT)
committer Joao Ventura2009-07-09 12:42:18 (GMT)
commit3d0a9447ab3ee55eef5d054648f49413893a4e62 (patch)
treebf8f27f33bc42ad642bea35d2e89f6cf1210cc42
parent2b011462b4fdef842c89d8bd3733f3649fd6638d (diff)
add new 'access send to friend' and 'access PDF version' permissions to any role which has 'access print'
-rw-r--r--print_mail/print_mail.install16
-rw-r--r--print_pdf/print_pdf.install16
2 files changed, 32 insertions, 0 deletions
diff --git a/print_mail/print_mail.install b/print_mail/print_mail.install
index 9dcacba..c0766a6 100644
--- a/print_mail/print_mail.install
+++ b/print_mail/print_mail.install
@@ -249,3 +249,19 @@ function print_mail_update_6003() {
menu_rebuild();
return $ret;
}
+
+/**
+ * Update to version 6.x-1.8
+ */
+function print_mail_update_6004() {
+ // add new 'access send to friend' 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 = 'access send to friend, ' . $role->perm;
+ $ret[] = update_sql("UPDATE {permission} SET perm = '$role->perm' WHERE rid = $role->rid");
+ }
+ }
+ return $ret;
+}
diff --git a/print_pdf/print_pdf.install b/print_pdf/print_pdf.install
index db9ef03..5445d6d 100644
--- a/print_pdf/print_pdf.install
+++ b/print_pdf/print_pdf.install
@@ -224,3 +224,19 @@ function print_pdf_update_6003() {
menu_rebuild();
return $ret;
}
+
+/**
+ * Update to version 6.x-1.8
+ */
+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 = 'access PDF version, ' . $role->perm;
+ $ret[] = update_sql("UPDATE {permission} SET perm = '$role->perm' WHERE rid = $role->rid");
+ }
+ }
+ return $ret;
+}