"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/handler/page/permissions.php" between
wacko.6.1.14.zip and wacko.6.1.15.zip

About: WackoWiki is a multilingual Wiki-engine that supports WYTIWYG-editing, page rights (ACLs), design themes (skins), file upload, email notification and much more.

permissions.php  (wacko.6.1.14):permissions.php  (wacko.6.1.15)
skipping to change at line 44 skipping to change at line 44
"WHERE u.user_id = " . (int) $user_id . " " . "WHERE u.user_id = " . (int) $user_id . " " .
"LIMIT 1"); "LIMIT 1");
} }
else else
{ {
$new_owner = $this->load_user('', $user_id); $new_owner = $this->load_user('', $user_id);
} }
if (!$new_owner) if (!$new_owner)
{ {
$this->set_message(Ut::perc_replace($this->_t('AclNoNewOw ner'), $user_id), 'error'); $this->set_message(Ut::perc_replace($this->_t('AclNoNewOw ner'), '<code>' . $user_id . '</code>'), 'error');
$this->reload_me(); $this->reload_me();
} }
// assigned as system page, forward message to Admin // assigned as system page, forward message to Admin
if ($new_owner['user_name'] === 'System') if ($new_owner['user_name'] === 'System')
{ {
$new_owner['email'] = $this->db->admin_email; $new_owner['email'] = $this->db->admin_email;
$new_owner['user_lang'] = $this->db->language; $new_owner['user_lang'] = $this->db->language;
} }
// where we collect new pages for emailing to user // where we collect new pages for emailing to user
$new_owner['owned_page'] = ''; $new_owner['owned_page'] = '';
} }
else else
{ {
$new_owner = false; $new_owner = false;
} }
$user_id = $this->get_user_id(); $user_id = $this->get_user_id();
$update_page_acls = function ($page) use (&$new_owner, $upload_allowed, $ user_id) $update_page_acls = function ($page) use (&$new_owner, $prefix, $upload_a llowed, $user_id)
{ {
$page_id = $page['page_id']; $page_id = $page['page_id'];
// store lists // store lists
$this->save_acl($page_id, 'read', $_POST['read_acl' ]); $this->save_acl($page_id, 'read', $_POST['read_acl' ]);
$this->save_acl($page_id, 'write', $_POST['write_acl ']); $this->save_acl($page_id, 'write', $_POST['write_acl ']);
$this->save_acl($page_id, 'comment', $_POST['comment_acl']); $this->save_acl($page_id, 'comment', $_POST['comment_acl']);
$this->save_acl($page_id, 'create', $_POST['create_ac l']); $this->save_acl($page_id, 'create', $_POST['create_ac l']);
if ($upload_allowed) if ($upload_allowed)
skipping to change at line 106 skipping to change at line 106
// TODO: set optional new owner but only if the comment b elongs to selected old user // TODO: set optional new owner but only if the comment b elongs to selected old user
# if ($new_owner = $_new_owner) # if ($new_owner = $_new_owner)
# { # {
# $new_owner_id = $this->get_user_id($new_owner); # $new_owner_id = $this->get_user_id($new_owner);
# $this->set_page_owner($comment['page_id'], $new_o wner_id); # $this->set_page_owner($comment['page_id'], $new_o wner_id);
# } # }
} }
// change owner? // change owner?
if ($new_owner if ($new_owner
&& ($new_id = (int) $new_owner['user_id']) != ($former_id = (int) $page['owner_id'])) && ($new_owner_id = (int) $new_owner['user_id']) != ($old _owner_id = (int) $page['owner_id']))
{ {
// update user statistics // update user statistics
$this->db->sql_query( $this->db->sql_query(
"UPDATE " . $prefix . "user SET " . "UPDATE " . $prefix . "user SET " .
"total_pages = total_pages - 1 " . "total_pages = total_pages - 1 " .
"WHERE user_id = " . (int) $former_id . " " . "WHERE user_id = " . (int) $old_owner_id . " " .
"LIMIT 1"); "LIMIT 1");
$this->db->sql_query( $this->db->sql_query(
"UPDATE " . $prefix . "user SET " . "UPDATE " . $prefix . "user SET " .
"total_pages = total_pages + 1 " . "total_pages = total_pages + 1 " .
"WHERE user_id = " . (int) $new_id." " . "WHERE user_id = " . (int) $new_owner_id . " " .
"LIMIT 1"); "LIMIT 1");
// set new owner // set new owner
$this->db->sql_query( $this->db->sql_query(
"UPDATE " . $prefix . "page SET " . "UPDATE " . $prefix . "page SET " .
"owner_id = " . (int) $new_ id . " " . "owner_id = " . (int) $new_ owner_id . " " .
"WHERE page_id = " . (int) $page_id . " " . "WHERE page_id = " . (int) $page_id . " " .
"LIMIT 1"); "LIMIT 1");
$new_owner['owned_page'] .= $this->href('', $page['tag'], null, null, null, null, true, true) . "\n"; $new_owner['owned_page'] .= $this->href('', $page['tag'], null, null, null, null, true, true) . "\n";
// log event // log event
$this->log(2, Ut::perc_replace( $this->log(2, Ut::perc_replace(
$this->_t('LogOwnershipChanged', SYSTEM_LANG), $this->_t('LogOwnershipChanged', SYSTEM_LANG),
$page['tag'] . ' ' . $page['title'], $page['tag'] . ' ' . $page['title'],
$new_owner['user_name'])); $new_owner['user_name']));
skipping to change at line 172 skipping to change at line 172
if ($new_owner && $new_owner['owned_page']) if ($new_owner && $new_owner['owned_page'])
{ {
if ($this->db->enable_email if ($this->db->enable_email
&& $this->db->enable_email_notification && $this->db->enable_email_notification
&& $new_owner['enabled'] && $new_owner['enabled']
&& !$new_owner['email_confirm']) && !$new_owner['email_confirm'])
{ {
$this->notify_new_owner($new_owner); $this->notify_new_owner($new_owner);
} }
$message .= $this->_t('AclGaveOwnership') . '<code>' . $new_owner ['user_name'] . '</code>'; $message .= Ut::perc_replace($this->_t('AclGaveOwnership'), '<cod e>' . $new_owner['user_name'] . '</code>');
} }
// purge SQL queries cache // purge SQL queries cache
$this->db->invalidate_sql_cache(); $this->db->invalidate_sql_cache();
$this->set_message($message, 'success'); $this->set_message($message, 'success');
$this->show_must_go_on(); $this->show_must_go_on();
} }
$page_id = $this->page['page_id']; $page_id = $this->page['page_id'];
 End of changes. 7 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)