(bug 13454) Article::updateCategoryCounts can attempt to execute empty inserts.
[lhc/web/wiklou.git] / includes / AuthPlugin.php
index e33ef1b..2ad137e 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 /**
- * @package MediaWiki
  */
 # Copyright (C) 2004 Brion Vibber <brion@pobox.com>
 # http://www.mediawiki.org/
  * accounts authenticate externally, or use it only as a fallback; also
  * you can transparently create internal wiki accounts the first time
  * someone logs in who can be authenticated externally.
- *
- * This interface is new, and might change a bit before 1.4.0 final is
- * done...
- *
- * @package MediaWiki
  */
 class AuthPlugin {
        /**
@@ -187,12 +181,14 @@ class AuthPlugin {
         * Add a user to the external authentication database.
         * Return true if successful.
         *
-        * @param User $user
+        * @param User $user - only the name should be assumed valid at this point
         * @param string $password
+        * @param string $email
+        * @param string $realname
         * @return bool
         * @public
         */
-       function addUser( $user, $password ) {
+       function addUser( $user, $password, $email='', $realname='' ) {
                return true;
        }
 
@@ -210,6 +206,18 @@ class AuthPlugin {
                return false;
        }
 
+       /**
+        * Check if a user should authenticate locally if the global authentication fails.
+        * If either this or strict() returns true, local authentication is not used.
+        *
+        * @param $username String: username.
+        * @return bool
+        * @public
+        */
+       function strictUserAuth( $username ) {
+               return false;
+       }
+
        /**
         * When creating a user account, optionally fill in preferences and such.
         * For instance, you might pull the email address or real name from the
@@ -219,9 +227,10 @@ class AuthPlugin {
         * forget the & on your function declaration.
         *
         * @param $user User object.
+        * @param $autocreate bool True if user is being autocreated on login
         * @public
         */
-       function initUser( &$user ) {
+       function initUser( $user, $autocreate=false ) {
                # Override this to do something.
        }
 
@@ -234,4 +243,4 @@ class AuthPlugin {
        }
 }
 
-?>
+