"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/setup/insert_pages.php" between
wacko.6.1.18.zip and wacko.6.1.19.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.

insert_pages.php  (wacko.6.1.18):insert_pages.php  (wacko.6.1.19)
skipping to change at line 95 skipping to change at line 95
} }
// insert default page, all related acls and menu items // insert default page, all related acls and menu items
function insert_page($tag, $title, $body, $lang, $rights = 'Admins', $critical = false, $set_menu = 0, $menu_title = false, $noindex = 1) function insert_page($tag, $title, $body, $lang, $rights = 'Admins', $critical = false, $set_menu = 0, $menu_title = false, $noindex = 1)
{ {
global $config_global, $dblink_global, $lang_global; global $config_global, $dblink_global, $lang_global;
sanitize_page_tag($tag); sanitize_page_tag($tag);
$prefix = $config_global['table_prefix']; $prefix = $config_global['table_prefix'];
$owner_id = "SELECT user_id FROM " . $prefix . "use $q_owner_id = "SELECT user_id FROM " . $prefix . "use
r WHERE user_name = 'System' LIMIT 1"; r WHERE user_name = 'System' LIMIT 1";
$page_id = "SELECT page_id FROM " . $prefix . "pag $q_page_id = "SELECT page_id FROM " . $prefix . "pag
e WHERE tag = '" . _quote($tag) . "' LIMIT 1"; e WHERE tag = '" . _q($tag) . "' LIMIT 1";
$page_select = $page_id; $page_select = $q_page_id;
if ($set_menu != SET_MENU_ONLY) if ($set_menu != SET_MENU_ONLY)
{ {
// user_id for user 'System' // user_id for user 'System'
// we specify values for columns body_r (MEDIUMTEXT) and body_toc (TEXT) that don't have defaults // we specify values for columns body_r (MEDIUMTEXT) and body_toc (TEXT) that don't have defaults
// the additional parentheses around $owner_id and $page_id are n ecessary for the sub-select queries // the additional parentheses around $owner_id and $page_id are n ecessary for the sub-select queries
$page_insert = $page_insert =
"INSERT INTO " . "INSERT INTO " . $prefix . "page (
$prefix . "page ( tag,
tag, title,
title, body,
body, body_r,
body_r, body_toc,
body_toc, user_id,
user_id, owner_id,
owner_id, created,
created, modified,
modified, latest,
latest, page_size,
page_size, page_lang,
page_lang, footer_comments,
footer_comments, footer_files,
footer_files, noindex
noindex )
)
VALUES ( VALUES (
'" . _quote($tag) . "', '" . _q($tag) . "',
'" . _quote($title) . "' , '" . _q($title) . "' ,
'" . _quote($body) . "', '" . _q($body) . "',
'', '',
'', '',
(" . $owner_id . "), (" . $q_owner_id . "),
(" . $owner_id . "), (" . $q_owner_id . "),
UTC_TIMESTAMP(), UTC_TIMESTAMP(),
UTC_TIMESTAMP(), UTC_TIMESTAMP(),
1, 1,
" . strlen($body) . ", " . strlen($body) . ",
'" . _quote($lang) . "', '" . _q($lang) . "',
0, 0,
0, 0,
" . (int) $noindex . " " . (int) $noindex . "
)"; )";
$perm_insert = $perm_insert =
"INSERT INTO " . "INSERT INTO " . $prefix . "acl (
$prefix . "acl ( page_id, privilege, list
page_id, privilege, list )
)
VALUES VALUES
((" . $page_id . "), 'read', '*'), ((" . $q_page_id . "), 'read', '*'),
((" . $page_id . "), 'write', '" . _quo ((" . $q_page_id . "), 'write', '" . _q($
te($rights) . "'), rights) . "'),
((" . $page_id . "), 'comment', '$'), ((" . $q_page_id . "), 'comment', '
((" . $page_id . "), 'create', '$'), $'),
((" . $page_id . "), 'upload', '')"; ((" . $q_page_id . "), 'create', '
$'),
((" . $q_page_id . "), 'upload', '
')";
$insert_data[] = [$page_insert, $lang_global['ErrorInsert Page']]; $insert_data[] = [$page_insert, $lang_global['ErrorInsert Page']];
$insert_data[] = [$perm_insert, $lang_global['ErrorInsert PagePermission']]; $insert_data[] = [$perm_insert, $lang_global['ErrorInsert PagePermission']];
} }
$default_menu_item = $default_menu_item =
"INSERT INTO " . "INSERT INTO " . $prefix . "menu (
$prefix . "menu ( user_id,
user_id, page_id,
page_id, menu_lang,
menu_lang, menu_title
menu_title )
)
VALUES ( VALUES (
(" . $owner_id . "), (" . $q_owner_id . "),
(" . $page_id . "), (" . $q_page_id . "),
'" . _quote($lang) . "', '" . _q($lang) . "',
'" . _quote($menu_title) . "' '" . _q($menu_title) . "'
) )
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
menu_title = '" . _quote($menu_title) . "'"; menu_title = '" . _q($menu_title) . "'";
if ($set_menu) if ($set_menu)
{ {
$insert_data[] = [$default_menu_item, $lang_global['ErrorInsert DefaultMenuItem']]; $insert_data[] = [$default_menu_item, $lang_global['ErrorInsert DefaultMenuItem']];
} }
switch ($config_global['db_driver']) switch ($config_global['db_driver'])
{ {
case 'mysqli_legacy': case 'mysqli_legacy':
$add_page = false; $add_page = false;
 End of changes. 10 change blocks. 
51 lines changed or deleted 51 lines changed or added

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