index.php
changeset 220 d44492e34ab3
parent 213 1316404e4ea8
child 228 b0a4d179be85
equal deleted inserted replaced
219:b1530b6a06d2 220:d44492e34ab3
   123       $template->header();
   123       $template->header();
   124       if(isset($_POST['_preview']))
   124       if(isset($_POST['_preview']))
   125       {
   125       {
   126         $text = $_POST['page_text'];
   126         $text = $_POST['page_text'];
   127         echo PageUtils::genPreview($_POST['page_text']);
   127         echo PageUtils::genPreview($_POST['page_text']);
   128       }
   128         $text = htmlspecialchars($text);
   129       else $text = RenderMan::getPage($paths->cpage['urlname_nons'], $paths->namespace, 0, false, false, false, false);
   129       }
       
   130       else
       
   131       {
       
   132         $text = RenderMan::getPage($paths->cpage['urlname_nons'], $paths->namespace, 0, false, false, false, false);
       
   133       }
   130       echo '
   134       echo '
   131         <form action="'.makeUrl($paths->page, 'do=edit').'" method="post" enctype="multipart/form-data">
   135         <form action="'.makeUrl($paths->page, 'do=edit').'" method="post" enctype="multipart/form-data">
   132         <br />
   136         <br />
   133         <textarea name="page_text" rows="20" cols="60" style="width: 97%;">'.$text.'</textarea><br />
   137         <textarea name="page_text" rows="20" cols="60" style="width: 97%;">'.$text.'</textarea><br />
   134         <br />
   138         <br />
   135         ';
   139         ';
   136       if($paths->wiki_mode)
   140       if($paths->wiki_mode)
   137         echo 'Edit summary: <input name="edit_summary" type="text" size="40" /><br /><label><input type="checkbox" name="minor" /> This is a minor edit</label><br />';  
   141         echo $lang->get('editor_lbl_edit_summary') . ' <input name="edit_summary" type="text" size="40" /><br /><label><input type="checkbox" name="minor" /> This is a minor edit</label><br />';  
   138       echo '<br />
   142       echo '<br />
   139           <input type="submit" name="_save" value="Save changes" style="font-weight: bold;" />
   143           <input type="submit" name="_save"    value="' . $lang->get('editor_btn_save') . '" style="font-weight: bold;" />
   140           <input type="submit" name="_preview" value="Preview changes" />
   144           <input type="submit" name="_preview" value="' . $lang->get('editor_btn_preview') . '" />
   141           <input type="submit" name="_revert" value="Revert changes" />
   145           <input type="submit" name="_revert"  value="' . $lang->get('editor_btn_revert') . '" />
   142           <input type="submit" name="_cancel" value="Cancel" />
   146           <input type="submit" name="_cancel"  value="' . $lang->get('editor_btn_cancel') . '" />
   143         </form>
   147         </form>
   144       ';
   148       ';
   145       if ( getConfig('wiki_edit_notice') == '1' )
   149       if ( getConfig('wiki_edit_notice') == '1' )
   146       {
   150       {
   147         $notice = getConfig('wiki_edit_notice_text');
   151         $notice = getConfig('wiki_edit_notice_text');
   155       echo '
   159       echo '
   156         <form action="'.makeUrl($paths->page, 'do=edit').'" method="post">
   160         <form action="'.makeUrl($paths->page, 'do=edit').'" method="post">
   157         <br />
   161         <br />
   158         <textarea readonly="readonly" name="page_text" rows="20" cols="60" style="width: 97%;">'.$text.'</textarea>';
   162         <textarea readonly="readonly" name="page_text" rows="20" cols="60" style="width: 97%;">'.$text.'</textarea>';
   159       echo '<br />
   163       echo '<br />
   160           <input type="submit" name="_cancel" value="Close viewer" />
   164           <input type="submit" name="_cancel" value="' . $lang->get('editor_btn_closeviewer') . '" />
   161         </form>
   165         </form>
   162       ';
   166       ';
   163       $template->footer();
   167       $template->footer();
   164       break;
   168       break;
   165     case 'history':
   169     case 'history':
   197       echo $c[1];
   201       echo $c[1];
   198       $template->footer();
   202       $template->footer();
   199       break;
   203       break;
   200     case 'moreoptions':
   204     case 'moreoptions':
   201       $template->header();
   205       $template->header();
   202       echo '<div class="menu_nojs" style="width: 150px; padding: 0;"><ul style="display: block;"><li><div class="label">More options for this page</div><div style="clear: both;"></div></li>'.$template->tpl_strings['TOOLBAR_EXTRAS'].'</ul></div>';
   206       echo '<div class="menu_nojs" style="width: 150px; padding: 0;"><ul style="display: block;"><li><div class="label">' . $lang->get('ajax_lbl_moreoptions_nojs') . '</div><div style="clear: both;"></div></li>'.$template->toolbar_menu.'</ul></div>';
   203       $template->footer();
   207       $template->footer();
   204       break;
   208       break;
   205     case 'protect':
   209     case 'protect':
   206       if (!isset($_REQUEST['level'])) die_friendly('Invalid request', '<p>No protection level specified</p>');
   210       if (!isset($_REQUEST['level'])) die_friendly('Invalid request', '<p>No protection level specified</p>');
   207       if(!empty($_POST['reason']))
   211       if(!empty($_POST['reason']))
   208       {
   212       {
   209         if(!preg_match('#^([0-2]*){1}$#', $_POST['level'])) die_friendly('Error protecting page', '<p>Request validation failed</p>');
   213         if(!preg_match('#^([0-2]*){1}$#', $_POST['level'])) die_friendly('Error protecting page', '<p>Request validation failed</p>');
   210         PageUtils::protect($paths->cpage['urlname_nons'], $paths->namespace, intval($_POST['level']), $_POST['reason']);
   214         PageUtils::protect($paths->cpage['urlname_nons'], $paths->namespace, intval($_POST['level']), $_POST['reason']);
   211         die_friendly('Page protected', '<p>The protection setting has been applied. <a href="'.makeUrl($paths->page).'">Return to the page</a>.</p>');
   215         
       
   216         die_friendly($lang->get('page_protect_lbl_success_title'), '<p>' . $lang->get('page_protect_lbl_success_body', array( 'page_link' => makeUrl($paths->page) )) . '</p>');
   212       }
   217       }
   213       $template->header();
   218       $template->header();
   214       ?>
   219       ?>
   215       <form action="<?php echo makeUrl($paths->page, 'do=protect'); ?>" method="post">
   220       <form action="<?php echo makeUrl($paths->page, 'do=protect'); ?>" method="post">
   216         <input type="hidden" name="level" value="<?php echo $_REQUEST['level']; ?>" />
   221         <input type="hidden" name="level" value="<?php echo $_REQUEST['level']; ?>" />
   217         <?php if(isset($_POST['reason'])) echo '<p style="color: red;">Error: you must enter a reason for protecting this page.</p>'; ?>
   222         <?php if(isset($_POST['reason'])) echo '<p style="color: red;">' . $lang->get('page_protect_err_need_reason') . '</p>'; ?>
   218         <p>Reason for protecting the page:</p>
   223         <p><?php echo $lang->get('page_protect_lbl_reason'); ?></p>
   219         <p><input type="text" name="reason" size="40" /><br />
   224         <p><input type="text" name="reason" size="40" /><br />
   220            Protecion level to be applied: <b><?php
   225            <?php echo $lang->get('page_protect_lbl_level'); ?> <b><?php
   221              switch($_REQUEST['level'])
   226              switch($_REQUEST['level'])
   222              {
   227              {
   223                case '0':
   228                case '0':
   224                  echo 'No protection';
   229                  echo $lang->get('page_protect_lbl_level_none');
   225                  break;
   230                  break;
   226                case '1':
   231                case '1':
   227                  echo 'Full protection';
   232                  echo $lang->get('page_protect_lbl_level_full');
   228                  break;
   233                  break;
   229                case '2':
   234                case '2':
   230                  echo 'Semi-protection';
   235                  echo $lang->get('page_protect_lbl_level_semi');
   231                  break;
   236                  break;
   232                default:
   237                default:
   233                  echo 'None;</b> Warning: request validation will fail after clicking submit<b>';
   238                  echo 'None;</b> Warning: request validation will fail after clicking submit<b>';
   234              }
   239              }
   235            ?></b></p>
   240            ?></b></p>
   236         <p><input type="submit" value="Protect page" style="font-weight: bold;" /></p> 
   241         <p><input type="submit" value="<?php echo htmlspecialchars($lang->get('page_protect_btn_submit')) ?>" style="font-weight: bold;" /></p> 
   237       </form>
   242       </form>
   238       <?php
   243       <?php
   239       $template->footer();
   244       $template->footer();
   240       break;
   245       break;
   241     case 'rename':
   246     case 'rename':
   242       if(!empty($_POST['newname']))
   247       if(!empty($_POST['newname']))
   243       {
   248       {
   244         $r = PageUtils::rename($paths->cpage['urlname_nons'], $paths->namespace, $_POST['newname']);
   249         $r = PageUtils::rename($paths->cpage['urlname_nons'], $paths->namespace, $_POST['newname']);
   245         die_friendly('Page renamed', '<p>'.nl2br($r).' <a href="'.makeUrl($paths->page).'">Return to the page</a>.</p>');
   250         die_friendly('Page renamed', '<p>'.nl2br($r).' <a href="'.makeUrl($paths->page).'">' . $lang->get('etc_return_to_page') . '</a>.</p>');
   246       }
   251       }
   247       $template->header();
   252       $template->header();
   248       ?>
   253       ?>
   249       <form action="<?php echo makeUrl($paths->page, 'do=rename'); ?>" method="post">
   254       <form action="<?php echo makeUrl($paths->page, 'do=rename'); ?>" method="post">
   250         <?php if(isset($_POST['newname'])) echo '<p style="color: red;">Error: you must enter a new name for this page.</p>'; ?>
   255         <?php if(isset($_POST['newname'])) echo '<p style="color: red;">' . $lang->get('page_rename_err_need_name') . '</p>'; ?>
   251         <p>Please enter a new name for this page:</p>
   256         <p><?php echo $lang->get('page_rename_lbl'); ?></p>
   252         <p><input type="text" name="newname" size="40" /></p>
   257         <p><input type="text" name="newname" size="40" /></p>
   253         <p><input type="submit" value="Rename page" style="font-weight: bold;" /></p> 
   258         <p><input type="submit" value="<?php echo htmlspecialchars($lang->get('page_rename_btn_submit')); ?>" style="font-weight: bold;" /></p> 
   254       </form>
   259       </form>
   255       <?php
   260       <?php
   256       $template->footer();    
   261       $template->footer();    
   257       break;
   262       break;
   258     case 'flushlogs':
   263     case 'flushlogs':
   259       if(!$session->get_permissions('clear_logs')) die_friendly('Access denied', '<p>Flushing the logs for a page <u>requires</u> administrative rights.</p>');
   264       if(!$session->get_permissions('clear_logs'))
       
   265       {
       
   266         die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('etc_access_denied') . '</p>');
       
   267       }
   260       if(isset($_POST['_downthejohn']))
   268       if(isset($_POST['_downthejohn']))
   261       {
   269       {
   262         $template->header();
   270         $template->header();
   263           $result = PageUtils::flushlogs($paths->cpage['urlname_nons'], $paths->namespace);
   271           $result = PageUtils::flushlogs($paths->cpage['urlname_nons'], $paths->namespace);
   264           echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">Return to the page</a>.</p>';
   272           echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">' . $lang->get('etc_return_to_page') . '</a>.</p>';
   265         $template->footer();
   273         $template->footer();
   266         break;
   274         break;
   267       }
   275       }
   268       $template->header();
   276       $template->header();
   269         ?>
   277         ?>
   270         <form action="<?php echo makeUrl($paths->page, 'do=flushlogs'); ?>" method="post">
   278         <form action="<?php echo makeUrl($paths->page, 'do=flushlogs'); ?>" method="post">
   271           <h3>You are about to <span style="color: red;">destroy</span> all logged edits and actions on this page.</h3>
   279            <?php echo $lang->get('page_flushlogs_warning_stern'); ?>
   272            <p>Unlike deleting or editing this page, this action is <u>not reversible</u>! You should only do this if you are desparate for
   280            <p><input type="submit" name="_downthejohn" value="<?php echo htmlspecialchars($lang->get('page_flushlogs_btn_submit')); ?>" style="color: red; font-weight: bold;" /></p>
   273               database space.</p>
       
   274            <p>Do you really want to continue?</p>
       
   275            <p><input type="submit" name="_downthejohn" value="Flush logs" style="color: red; font-weight: bold;" /></p>
       
   276         </form>
   281         </form>
   277         <?php
   282         <?php
   278       $template->footer();
   283       $template->footer();
   279       break;
   284       break;
   280     case 'delvote':
   285     case 'delvote':
   281       if(isset($_POST['_ballotbox']))
   286       if(isset($_POST['_ballotbox']))
   282       {
   287       {
   283         $template->header();
   288         $template->header();
   284         $result = PageUtils::delvote($paths->cpage['urlname_nons'], $paths->namespace);
   289         $result = PageUtils::delvote($paths->cpage['urlname_nons'], $paths->namespace);
   285         echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">Return to the page</a>.</p>';
   290         echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">' . $lang->get('etc_return_to_page') . '</a>.</p>';
   286         $template->footer();
   291         $template->footer();
   287         break;
   292         break;
   288       }
   293       }
   289       $template->header();
   294       $template->header();
   290         ?>
   295         ?>
   291         <form action="<?php echo makeUrl($paths->page, 'do=delvote'); ?>" method="post">
   296         <form action="<?php echo makeUrl($paths->page, 'do=delvote'); ?>" method="post">
   292           <h3>Your vote counts.</h3>
   297            <?php
   293            <p>If you think that this page is not relavent to the content on this site, or if it looks like this page was only created in
   298              echo $lang->get('page_delvote_warning_stern');
   294               an attempt to spam the site, you can request that this page be deleted by an administrator.</p>
   299              echo '<p>';
   295            <p>After you vote, you should leave a comment explaining the reason for your vote, especially if you are the first person to
   300              switch($paths->cpage['delvotes'])
   296               vote against this page.</p>
   301              {
   297            <p>So far, <?php echo ( $paths->cpage['delvotes'] == 1 ) ? $paths->cpage['delvotes'] . ' person has' : $paths->cpage['delvotes'] . ' people have'; ?> voted to delete this page.</p>
   302                case 0:  echo $lang->get('page_delvote_count_zero'); break;
   298            <p><input type="submit" name="_ballotbox" value="Vote to delete this page" /></p>
   303                case 1:  echo $lang->get('page_delvote_count_one'); break;
       
   304                default: echo $lang->get('page_delvote_count_plural', array('delvotes' => $paths->cpage['delvotes'])); break;
       
   305              }
       
   306              echo '</p>';
       
   307            ?>
       
   308            <p><input type="submit" name="_ballotbox" value="<?php echo htmlspecialchars($lang->get('page_delvote_btn_submit')); ?>" /></p>
   299         </form>
   309         </form>
   300         <?php
   310         <?php
   301       $template->footer();
   311       $template->footer();
   302       break;
   312       break;
   303     case 'resetvotes':
   313     case 'resetvotes':
   304       if(!$session->get_permissions('vote_reset')) die_friendly('Access denied', '<p>Resetting the deletion votes against this page <u>requires</u> admin rights.</p>');
   314       if(!$session->get_permissions('vote_reset'))
       
   315       {
       
   316         die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('etc_access_denied') . '</p>');
       
   317       }
   305       if(isset($_POST['_youmaylivealittlelonger']))
   318       if(isset($_POST['_youmaylivealittlelonger']))
   306       {
   319       {
   307         $template->header();
   320         $template->header();
   308           $result = PageUtils::resetdelvotes($paths->cpage['urlname_nons'], $paths->namespace);
   321           $result = PageUtils::resetdelvotes($paths->cpage['urlname_nons'], $paths->namespace);
   309           echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">Return to the page</a>.</p>';
   322           echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">' . $lang->get('etc_return_to_page') . '</a>.</p>';
   310         $template->footer();
   323         $template->footer();
   311         break;
   324         break;
   312       }
   325       }
   313       $template->header();
   326       $template->header();
   314         ?>
   327         ?>
   315         <form action="<?php echo makeUrl($paths->page, 'do=resetvotes'); ?>" method="post">
   328         <form action="<?php echo makeUrl($paths->page, 'do=resetvotes'); ?>" method="post">
   316           <p>This action will reset the number of votes against this page to zero. Are you sure you want to do this?</p>
   329           <p><?php echo $lang->get('ajax_delvote_reset_confirm'); ?></p>
   317           <p><input type="submit" name="_youmaylivealittlelonger" value="Reset votes" /></p>
   330           <p><input type="submit" name="_youmaylivealittlelonger" value="<?php echo htmlspecialchars($lang->get('page_delvote_reset_btn_submit')); ?>" /></p>
   318         </form>
   331         </form>
   319         <?php
   332         <?php
   320       $template->footer();
   333       $template->footer();
   321       break;
   334       break;
   322     case 'deletepage':
   335     case 'deletepage':
   323       if(!$session->get_permissions('delete_page')) die_friendly('Access denied', '<p>Deleting pages <u>requires</u> admin rights.</p>');
   336       if(!$session->get_permissions('delete_page'))
       
   337       {
       
   338         die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('etc_access_denied') . '</p>');
       
   339       }
   324       if(isset($_POST['_adiossucker']))
   340       if(isset($_POST['_adiossucker']))
   325       {
   341       {
   326         $reason = ( isset($_POST['reason']) ) ? $_POST['reason'] : false;
   342         $reason = ( isset($_POST['reason']) ) ? $_POST['reason'] : false;
   327         if ( empty($reason) )
   343         if ( empty($reason) )
   328           $error = 'Please enter a reason for deleting this page.';
   344           $error = $lang->get('ajax_delete_prompt_reason');
   329         else
   345         else
   330         {
   346         {
   331           $template->header();
   347           $template->header();
   332             $result = PageUtils::deletepage($paths->cpage['urlname_nons'], $paths->namespace, $reason);
   348             $result = PageUtils::deletepage($paths->cpage['urlname_nons'], $paths->namespace, $reason);
   333             echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">Return to the page</a>.</p>';
   349             echo '<p>'.$result.' <a href="'.makeUrl($paths->page).'">' . $lang->get('etc_return_to_page') . '</a>.</p>';
   334           $template->footer();
   350           $template->footer();
   335           break;
   351           break;
   336         }
   352         }
   337       }
   353       }
   338       $template->header();
   354       $template->header();
   339         ?>
   355         ?>
   340         <form action="<?php echo makeUrl($paths->page, 'do=deletepage'); ?>" method="post">
   356         <form action="<?php echo makeUrl($paths->page, 'do=deletepage'); ?>" method="post">
   341           <h3>You are about to <span style="color: red;">destroy</span> this page.</h3>
   357            <?php echo $lang->get('page_delete_warning_stern'); ?>
   342            <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>
       
   343            <p>Are you <u>absolutely sure</u> that you want to continue?<br />
       
   344               You will not be asked again.</p>
       
   345            <?php if ( isset($error) ) echo "<p>$error</p>"; ?>
   358            <?php if ( isset($error) ) echo "<p>$error</p>"; ?>
   346            <p>Reason for deleting: <input type="text" name="reason" size="50" /></p>
   359            <p><?php echo $lang->get('page_delete_lbl_reason'); ?> <input type="text" name="reason" size="50" /></p>
   347            <p><input type="submit" name="_adiossucker" value="Delete this page" style="color: red; font-weight: bold;" /></p>
   360            <p><input type="submit" name="_adiossucker" value="<?php echo htmlspecialchars($lang->get('page_delete_btn_submit')); ?>" style="color: red; font-weight: bold;" /></p>
   348         </form>
   361         </form>
   349         <?php
   362         <?php
   350       $template->footer();
   363       $template->footer();
   351       break;
   364       break;
   352     case 'setwikimode':
   365     case 'setwikimode':
   353       if(!$session->get_permissions('set_wiki_mode')) die_friendly('Access denied', '<p>Changing the wiki mode setting <u>requires</u> admin rights.</p>');
   366       if(!$session->get_permissions('set_wiki_mode'))
       
   367       {
       
   368         die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('etc_access_denied') . '</p>');
       
   369       }
   354       if ( isset($_POST['finish']) )
   370       if ( isset($_POST['finish']) )
   355       {
   371       {
   356         $level = intval($_POST['level']);
   372         $level = intval($_POST['level']);
   357         if ( !in_array($level, array(0, 1, 2) ) )
   373         if ( !in_array($level, array(0, 1, 2) ) )
   358         {
   374         {
   359           die_friendly('Invalid request', '<p>Level not specified</p>');
   375           die_friendly('Invalid request', '<p>Level not specified</p>');
   360         }
   376         }
   361         $q = $db->sql_query('UPDATE '.table_prefix.'pages SET wiki_mode=' . $level . ' WHERE urlname=\'' . $db->escape($paths->cpage['urlname_nons']) . '\' AND namespace=\'' . $paths->namespace . '\';');
   377         $q = $db->sql_query('UPDATE '.table_prefix.'pages SET wiki_mode=' . $level . ' WHERE urlname=\'' . $db->escape($paths->cpage['urlname_nons']) . '\' AND namespace=\'' . $paths->namespace . '\';');
   362         if ( !$q )
   378         if ( !$q )
   363           $db->_die();
   379           $db->_die();
   364         redirect(makeUrl($paths->page), htmlspecialchars($paths->cpage['name']), 'Wiki mode for this page has been set. Redirecting you to the page...', 2);
   380         redirect(makeUrl($paths->page), htmlspecialchars($paths->cpage['name']), $lang->get('page_wikimode_success_redirect'), 2);
   365       }
   381       }
   366       else
   382       else
   367       {
   383       {
   368         $template->header();
   384         $template->header();
   369         if(!isset($_GET['level']) || ( isset($_GET['level']) && !preg_match('#^([0-9])$#', $_GET['level']))) die_friendly('Invalid request', '<p>Level not specified</p>');
   385         if(!isset($_GET['level']) || ( isset($_GET['level']) && !preg_match('#^([0-9])$#', $_GET['level']))) die_friendly('Invalid request', '<p>Level not specified</p>');
   373             die_friendly('Invalid request', '<p>Level not specified</p>');
   389             die_friendly('Invalid request', '<p>Level not specified</p>');
   374           }
   390           }
   375         echo '<form action="' . makeUrl($paths->page, 'do=setwikimode', true) . '" method="post">';
   391         echo '<form action="' . makeUrl($paths->page, 'do=setwikimode', true) . '" method="post">';
   376         echo '<input type="hidden" name="finish" value="foo" />';
   392         echo '<input type="hidden" name="finish" value="foo" />';
   377         echo '<input type="hidden" name="level" value="' . $level . '" />';
   393         echo '<input type="hidden" name="level" value="' . $level . '" />';
   378         $level_txt = ( $level == 0 ) ? 'disabled' : ( ( $level == 1 ) ? 'enabled' : 'use the global setting' );
   394         $level_txt = ( $level == 0 ) ? 'page_wikimode_level_off' : ( ( $level == 1 ) ? 'page_wikimode_level_on' : 'page_wikimode_level_global' );
   379         $blurb = ( $level == 0 || ( $level == 2 && getConfig('wiki_mode') != '1' ) ) ? 'Because this will disable the wiki behavior on this page, several features, most
   395         $blurb = ( $level == 0 || ( $level == 2 && getConfig('wiki_mode') != '1' ) ) ? 'page_wikimode_blurb_disable' : 'page_wikimode_blurb_enable';
   380            notably the ability for users to vote to have this page deleted, will be disabled as they are not relevant to non-wiki pages. In addition, users will not be able
       
   381            to edit this page unless an ACL rule specifically permits them.' : 'Because this will enable the wiki behavior on this page, users will gain the ability to
       
   382            freely edit this page unless an ACL rule specifically denies them. If your site is public and gets good traffic, you should be aware of the possiblity of vandalism, and you need to be ready to revert
       
   383            malicious edits to this page.';
       
   384         ?>
   396         ?>
   385         <h3>You are changing wiki mode for this page.</h3>
   397         <h3><?php echo $lang->get('page_wikimode_heading'); ?></h3>
   386         <p>Wiki features will be set to <?php echo $level_txt; ?>. <?php echo $blurb; ?></p>
   398         <p><?php echo $lang->get($level_txt) . ' ' . $lang->get($blurb); ?></p>
   387         <p>If you want to continue, please click the button below.</p>
   399         <p><?php echo $lang->get('page_wikimode_warning'); ?></p>
   388         <p><input type="submit" value="Set wiki mode" /></p>
   400         <p><input type="submit" value="<?php echo htmlspecialchars($lang->get('page_wikimode_btn_submit')); ?>" /></p>
   389         <?php
   401         <?php
   390         echo '</form>';
   402         echo '</form>';
   391         $template->footer();
   403         $template->footer();
   392       }
   404       }
   393       break;
   405       break;
   402       $template->footer();
   414       $template->footer();
   403       break;
   415       break;
   404     case 'detag':
   416     case 'detag':
   405       if ( $session->user_level < USER_LEVEL_ADMIN )
   417       if ( $session->user_level < USER_LEVEL_ADMIN )
   406       {
   418       {
   407         die_friendly('Access denied', '<p>You need to be an administrator to detag pages.</p>');
   419         die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('etc_access_denied') . '</p>');
   408       }
   420       }
   409       if ( $paths->page_exists )
   421       if ( $paths->page_exists )
   410       {
   422       {
   411         die_friendly('Invalid request', '<p>The detag action is only valid for pages that have been deleted in the past.</p>');
   423         die_friendly($lang->get('etc_invalid_request_short'), '<p>' . $lang->get('page_detag_err_page_exists') . '</p>');
   412       }
   424       }
   413       $q = $db->sql_query('DELETE FROM '.table_prefix.'tags WHERE page_id=\'' . $db->escape($paths->cpage['urlname_nons']) . '\' AND namespace=\'' . $paths->namespace . '\';');
   425       $q = $db->sql_query('DELETE FROM '.table_prefix.'tags WHERE page_id=\'' . $db->escape($paths->cpage['urlname_nons']) . '\' AND namespace=\'' . $paths->namespace . '\';');
   414       if ( !$q )
   426       if ( !$q )
   415         $db->_die('Detag query, index.php:'.__LINE__);
   427         $db->_die('Detag query, index.php:'.__LINE__);
   416       die_friendly('Page detagged', '<p>All stale tags have been removed from this page.</p>');
   428       die_friendly($lang->get('page_detag_success_title'), '<p>' . $lang->get('page_detag_success_body') . '</p>');
   417       break;
   429       break;
   418     case 'aclmanager':
   430     case 'aclmanager':
   419       $data = ( isset($_POST['data']) ) ? $_POST['data'] : Array('mode' => 'listgroups');
   431       $data = ( isset($_POST['data']) ) ? $_POST['data'] : Array('mode' => 'listgroups');
   420       PageUtils::aclmanager($data);
   432       PageUtils::aclmanager($data);
   421       break;
   433       break;