ajax.php
changeset 800 9cdfe82c56cd
parent 714 2f1706c4231f
child 801 eb8b23f11744
equal deleted inserted replaced
799:4629ad98ee88 800:9cdfe82c56cd
    30       header('Content-type: text/plain');
    30       header('Content-type: text/plain');
    31       $password = ( isset($_GET['pagepass']) ) ? $_GET['pagepass'] : false;
    31       $password = ( isset($_GET['pagepass']) ) ? $_GET['pagepass'] : false;
    32       $revid = ( isset($_GET['revid']) ) ? intval($_GET['revid']) : 0;
    32       $revid = ( isset($_GET['revid']) ) ? intval($_GET['revid']) : 0;
    33       $page = new PageProcessor($paths->page_id, $paths->namespace, $revid);
    33       $page = new PageProcessor($paths->page_id, $paths->namespace, $revid);
    34       $page->password = $password;
    34       $page->password = $password;
       
    35       
    35       $have_draft = false;
    36       $have_draft = false;
    36       if ( $src = $page->fetch_source() )
    37       if ( $src = $page->fetch_source() )
    37       {
    38       {
    38         $allowed = true;
    39         $allowed = true;
    39         $q = $db->sql_query('SELECT author, time_id, page_text, edit_summary FROM ' . table_prefix . 'logs WHERE log_type = \'page\' AND action = \'edit\'
    40         $q = $db->sql_query('SELECT author, time_id, page_text, edit_summary FROM ' . table_prefix . 'logs WHERE log_type = \'page\' AND action = \'edit\'
   149       
   150       
   150       echo enano_json_encode($return);
   151       echo enano_json_encode($return);
   151       break;
   152       break;
   152     case "getpage":
   153     case "getpage":
   153       // echo PageUtils::getpage($paths->page, false, ( (isset($_GET['oldid'])) ? $_GET['oldid'] : false ));
   154       // echo PageUtils::getpage($paths->page, false, ( (isset($_GET['oldid'])) ? $_GET['oldid'] : false ));
       
   155       $output = new Output_Striptease();
       
   156       
   154       $revision_id = ( (isset($_GET['oldid'])) ? intval($_GET['oldid']) : 0 );
   157       $revision_id = ( (isset($_GET['oldid'])) ? intval($_GET['oldid']) : 0 );
   155       $page = new PageProcessor( $paths->page_id, $paths->namespace, $revision_id );
   158       $page = new PageProcessor( $paths->page_id, $paths->namespace, $revision_id );
   156       
   159       
   157       $pagepass = ( isset($_REQUEST['pagepass']) ) ? $_REQUEST['pagepass'] : '';
   160       $pagepass = ( isset($_REQUEST['pagepass']) ) ? $_REQUEST['pagepass'] : '';
   158       $page->password = $pagepass;
   161       $page->password = $pagepass;