index.php
changeset 28 dd2edcdc6c03
parent 21 663fcf528726
child 32 4d87aad3c4c0
equal deleted inserted replaced
27:dd659f6ba891 28:dd2edcdc6c03
   309       break;
   309       break;
   310     case 'deletepage':
   310     case 'deletepage':
   311       if(!$session->get_permissions('delete_page')) die_friendly('Access denied', '<p>Deleting pages <u>requires</u> admin rights.</p>');
   311       if(!$session->get_permissions('delete_page')) die_friendly('Access denied', '<p>Deleting pages <u>requires</u> admin rights.</p>');
   312       if(isset($_POST['_adiossucker']))
   312       if(isset($_POST['_adiossucker']))
   313       {
   313       {
   314         $template->header();
   314         $reason = ( isset($_POST['reason']) ) ? $_POST['reason'] : false;
   315           $result = PageUtils::deletepage($paths->cpage['urlname_nons'], $paths->namespace);
   315         if ( empty($reason) )
   316           echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">Return to the page</a>.</p>';
   316           $error = 'Please enter a reason for deleting this page.';
   317         $template->footer();
   317         else
   318         break;
   318         {
       
   319           $template->header();
       
   320             $result = PageUtils::deletepage($paths->cpage['urlname_nons'], $paths->namespace, $reason);
       
   321             echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">Return to the page</a>.</p>';
       
   322           $template->footer();
       
   323           break;
       
   324         }
   319       }
   325       }
   320       $template->header();
   326       $template->header();
   321         ?>
   327         ?>
   322         <form action="<?php echo makeUrl($paths->page, 'do=deletepage'); ?>" method="post">
   328         <form action="<?php echo makeUrl($paths->page, 'do=deletepage'); ?>" method="post">
   323           <h3>You are about to <span style="color: red;">destroy</span> this page.</h3>
   329           <h3>You are about to <span style="color: red;">destroy</span> this page.</h3>
   324            <p>While the deletion of the page itself is completely reversible, it is impossible to recover any comments or category information on this page. If this is a file page, the file along with all older revisions of it will be permanently deleted. Also, any custom information that this page is tagged with, such as a custom name, protection status, or additional settings such as whether to allow comments, will be permanently lost.</p>
   330            <p>While the deletion of the page itself is completely reversible, it is impossible to recover any comments or category information on this page. If this is a file page, the file along with all older revisions of it will be permanently deleted. Also, any custom information that this page is tagged with, such as a custom name, protection status, or additional settings such as whether to allow comments, will be permanently lost.</p>
   325            <p>Are you <u>absolutely sure</u> that you want to continue?<br />
   331            <p>Are you <u>absolutely sure</u> that you want to continue?<br />
   326               You will not be asked again.</p>
   332               You will not be asked again.</p>
       
   333            <?php if ( isset($error) ) echo "<p>$error</p>"; ?>
       
   334            <p>Reason for deleting: <input type="text" name="reason" size="50" /></p>
   327            <p><input type="submit" name="_adiossucker" value="Delete this page" style="color: red; font-weight: bold;" /></p>
   335            <p><input type="submit" name="_adiossucker" value="Delete this page" style="color: red; font-weight: bold;" /></p>
   328         </form>
   336         </form>
   329         <?php
   337         <?php
   330       $template->footer();
   338       $template->footer();
   331       break;
   339       break;