CategoryView modified to use css columns
[lhc/web/wiklou.git] / includes / EditPage.php
index 8e433e4..f5d98a7 100644 (file)
@@ -504,7 +504,7 @@ class EditPage {
                        }
                }
 
-               $permErrors = $this->getEditPermissionErrors();
+               $permErrors = $this->getEditPermissionErrors( $this->save ? 'secure' : 'full' );
                if ( $permErrors ) {
                        wfDebug( __METHOD__ . ": User can't edit\n" );
                        // Auto-block user's IP if the account was "hard" blocked
@@ -515,7 +515,6 @@ class EditPage {
                        return;
                }
 
-
                $this->isConflict = false;
                // css / js subpages of user pages get a special treatment
                $this->isCssJsSubpage = $this->mTitle->isCssJsSubpage();
@@ -560,15 +559,22 @@ class EditPage {
        }
 
        /**
+        * @param string $rigor Same format as Title::getUserPermissionErrors()
         * @return array
         */
-       protected function getEditPermissionErrors() {
+       protected function getEditPermissionErrors( $rigor = 'secure' ) {
                global $wgUser;
-               $permErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser );
+
+               $permErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser, $rigor );
                # Can this title be created?
                if ( !$this->mTitle->exists() ) {
-                       $permErrors = array_merge( $permErrors,
-                               wfArrayDiff2( $this->mTitle->getUserPermissionsErrors( 'create', $wgUser ), $permErrors ) );
+                       $permErrors = array_merge(
+                               $permErrors,
+                               wfArrayDiff2(
+                                       $this->mTitle->getUserPermissionsErrors( 'create', $wgUser, $rigor ),
+                                       $permErrors
+                               )
+                       );
                }
                # Ignore some permissions errors when a user is just previewing/viewing diffs
                $remove = array();
@@ -580,6 +586,7 @@ class EditPage {
                        }
                }
                $permErrors = wfArrayDiff2( $permErrors, $remove );
+
                return $permErrors;
        }
 
@@ -721,7 +728,6 @@ class EditPage {
        function importFormData( &$request ) {
                global $wgContLang, $wgUser;
 
-
                # Section edit can come from either the form or a link
                $this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) );
 
@@ -975,7 +981,6 @@ class EditPage {
        protected function getContentObject( $def_content = null ) {
                global $wgOut, $wgRequest, $wgUser, $wgContLang;
 
-
                $content = false;
 
                // For message page not locally set, use the i18n message.
@@ -1519,7 +1524,6 @@ class EditPage {
 
                $status = Status::newGood();
 
-
                if ( !Hooks::run( 'EditPage::attemptSave', array( $this ) ) ) {
                        wfDebug( "Hook 'EditPage::attemptSave' aborted article saving\n" );
                        $status->fatal( 'hookaborted' );
@@ -1565,7 +1569,6 @@ class EditPage {
                                $code = $wgUser->isAnon() ? self::AS_IMAGE_REDIRECT_ANON : self::AS_IMAGE_REDIRECT_LOGGED;
                                $status->setResult( false, $code );
 
-
                                return $status;
                }
 
@@ -1663,7 +1666,6 @@ class EditPage {
                        return $status;
                }
 
-
                # Load the page data from the master. If anything changes in the meantime,
                # we detect it by using page_latest like a token in a 1 try compare-and-swap.
                $this->mArticle->loadPageData( 'fromdbmaster' );
@@ -2302,7 +2304,6 @@ class EditPage {
        function showEditForm( $formCallback = null ) {
                global $wgOut, $wgUser;
 
-
                # need to parse the preview early so that we know which templates are used,
                # otherwise users with "show preview after edit box" will get a blank list
                # we parse this near the beginning so that setHeaders can do the title
@@ -3176,7 +3177,6 @@ HTML
                        return '';
                }
 
-
                $limitReport = Html::rawElement( 'div', array( 'class' => 'mw-limitReportExplanation' ),
                        wfMessage( 'limitreport-title' )->parseAsBlock()
                );
@@ -3211,7 +3211,6 @@ HTML
                        Html::closeElement( 'table' ) .
                        Html::closeElement( 'div' );
 
-
                return $limitReport;
        }
 
@@ -3397,7 +3396,6 @@ HTML
                global $wgOut, $wgUser, $wgRawHtml, $wgLang;
                global $wgAllowUserCss, $wgAllowUserJs;
 
-
                if ( $wgRawHtml && !$this->mTokenOk ) {
                        // Could be an offsite preview attempt. This is very unsafe if
                        // HTML is enabled, as it could be an attack.