| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Changed names of some permissions
|
| 6 |
*/
|
| 7 |
function usercomment_update_1() {
|
| 8 |
$result = db_query("SELECT * FROM {permission}");
|
| 9 |
while ($permission = db_fetch_object($result)) {
|
| 10 |
$perms = array();
|
| 11 |
foreach (explode(', ', $permission->perm) as $perm) {
|
| 12 |
if (preg_match("/^((approve|delete) comments on) (\w+) content$/", $perm, $matches)) {
|
| 13 |
$perm = $matches[1] . ' own ' . $matches[3] . ' content';
|
| 14 |
}
|
| 15 |
$perms[] = $perm;
|
| 16 |
}
|
| 17 |
db_query("UPDATE {permission} SET perm = '%s'", implode(', ', $perms));
|
| 18 |
}
|
| 19 |
}
|