# HG changeset patch # User Dan # Date 1229739837 18000 # Node ID 82560fba0fd1d8711456e6e37ae6a7b10d0f0088 # Parent 60c132a5bc8edeb91a5e11e5b7c3b3546e7f4e78 Removed the completely obsolete old Special:CreatePage function diff -r 60c132a5bc8e -r 82560fba0fd1 plugins/SpecialPageFuncs.php --- a/plugins/SpecialPageFuncs.php Tue Dec 02 21:11:22 2008 -0500 +++ b/plugins/SpecialPageFuncs.php Fri Dec 19 21:23:57 2008 -0500 @@ -265,160 +265,6 @@ $template->footer(); } -function page_Special_CreatePage_Old() -{ - global $db, $session, $paths, $template, $plugins; // Common objects - global $lang; - - if ( isset($_POST['do']) ) - { - $p = $_POST['pagename']; - $k = array_keys($paths->nslist); - for ( $i = 0; $i < sizeof( $paths->nslist ); $i++ ) - { - $ln = strlen( $paths->nslist[$k[$i]] ); - if ( substr($p, 0, $ln) == $paths->nslist[$k[$i]] ) - { - $namespace = $k[$i]; - } - } - if ( $namespace == 'Special' || ( $namespace == 'System' && $session->user_level < USER_LEVEL_ADMIN ) || $namespace == 'Admin') - { - $template->header(); - - echo '

' . $lang->get('pagetools_create_err_title') . '

-

' . $lang->get('pagetools_create_err_name_invalid', array('page_name' => htmlspecialchars($p))) . '

'; - - $template->footer(); - $db->close(); - - exit; - } - $name = $db->escape(str_replace('_', ' ', $p)); - $urlname = str_replace(' ', '_', $p); - $namespace = $_POST['namespace']; - if ( $namespace == 'Special' || ( $namespace == 'System' && $session->user_level < USER_LEVEL_ADMIN ) || $namespace == 'Admin') - { - $template->header(); - - echo '

' . $lang->get('pagetools_create_err_title') . '

-

' . $lang->get('pagetools_create_err_name_invalid', array('page_name' => htmlspecialchars($paths->nslist[$namespace].$p))) . '

'; - - $template->footer(); - $db->close(); - - exit; - } - $code = $plugins->setHook('page_create_request'); - foreach ( $code as $cmd ) - { - eval($cmd); - } - if ( substr($urlname, 0, 8) == 'Project:' ) - { - $template->header(); - - echo '

' . $lang->get('pagetools_create_err_title') . '

-

' . $lang->get('pagetools_create_err_project_shortcut', array('page_name' => htmlspecialchars($p))) . '

'; - - $template->footer(); - $db->close(); - - exit; - } - - $tn = $paths->nslist[$_POST['namespace']] . $urlname; - if ( isset($paths->pages[$tn]) ) - { - die_friendly($lang->get('pagetools_create_err_title'), '

' . $lang->get('pagetools_create_err_already_exist') . '

'); - } - - if ( $paths->nslist[$namespace] == substr($urlname, 0, strlen($paths->nslist[$namespace]) ) ) - { - $urlname = substr($urlname, strlen($paths->nslist[$namespace]), strlen($urlname)); - } - - $k = array_keys( $paths->nslist ); - if(!in_array($_POST['namespace'], $k)) - { - $db->_die('An SQL injection attempt was caught at '.dirname(__FILE__).':'.__LINE__.'.'); - } - - $ips = array( - 'ip' => array(), - 'u' => array() - ); - $ips = $db->escape(serialize($ips)); - - $urlname = sanitize_page_id($urlname); - $urlname = $db->escape($urlname); - - $perms = $session->fetch_page_acl($urlname, $namespace); - if ( !$perms->get_permissions('create_page') ) - die_friendly($lang->get('pagetools_create_err_title'), '

An access control rule is preventing you from creating pages.

'); - - $q = $db->sql_query('INSERT INTO '.table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace) VALUES('.time().', \''.enano_date('d M Y h:i a').'\', \'page\', \'create\', \''.$session->username.'\', \''.$urlname.'\', \''.$_POST['namespace'].'\');'); - if ( !$q ) - { - $db->_die('The page log could not be updated.'); - } - - $q = $db->sql_query('INSERT INTO '.table_prefix.'pages(name,urlname,namespace,delvote_ips) VALUES(\''.$name.'\', \''.$urlname.'\', \''.$_POST['namespace'].'\',\'' . $ips . '\');'); - if ( !$q ) - { - $db->_die('The page entry could not be inserted.'); - } - $q = $db->sql_query('INSERT INTO '.table_prefix.'page_text(page_id,namespace,page_text) VALUES(\''.$urlname.'\', \''.$_POST['namespace'].'\', \''.'\');'); - if ( !$q ) - { - $db->_die('The page text entry could not be inserted.'); - } - - header('Location: '.makeUrlNS($_POST['namespace'], sanitize_page_id($p)) . '#do:edit'); - exit; - } - $template->header(); - /* - if ( !$session->get_permissions('create_page') ) - { - echo 'Wiki mode is disabled, only admins can create pages.'; - - $template->footer(); - $db->close(); - - exit; - } - */ - echo '

' . $lang->get('pagetools_create_blurb') . '

'; - ?> -
-

-

-

-
- footer(); -} - function PagelistingFormatter($id, $row) { global $db, $session, $paths, $template, $plugins; // Common objects