Fix retarded mistake in 57997, move break to within the if block or it defeats the...
[lhc/web/wiklou.git] / includes / AuthPlugin.php
index 29be2de..eacabd4 100644 (file)
@@ -63,8 +63,9 @@ class AuthPlugin {
         * Modify options in the login template.
         *
         * @param $template UserLoginTemplate object.
+        * @param $type String 'signup' or 'login'.
         */
-       public function modifyUITemplate( &$template ) {
+       public function modifyUITemplate( &$template, &$type ) {
                # Override this!
                $template->set( 'usedomain', false );
        }
@@ -123,38 +124,30 @@ class AuthPlugin {
        }
 
        /**
-        * Can users change their passwords?
-        *
-        * @return bool
-        */
-       public function allowPasswordChange() {
-               return true;
-       }
-       
-       /**
-        * Can users change their Real Name?
+        * Allow a property change? Properties are the same as preferences
+        * and use the same keys. 'Realname' 'Emailaddress' and 'Nickname'
+        * all reference this.
         *
         * @return bool
         */
-       public function allowRealNameChange() {
-               return true;
+       public function allowPropChange( $prop = '' ) {
+               if( $prop == 'realname' && is_callable( array( $this, 'allowRealNameChange' ) ) ) {
+                       return $this->allowRealNameChange();
+               } elseif( $prop == 'emailaddress' && is_callable( array( $this, 'allowEmailChange' ) ) ) {
+                       return $this->allowEmailChange();
+               } elseif( $prop == 'nickname' && is_callable( array( $this, 'allowNickChange' ) ) ) {
+                       return $this->allowNickChange();
+               } else {
+                       return true;
+               }
        }
 
        /**
-        * Can users change their email address?
-        *
-        * @return bool
-        */
-       public function allowEmailChange() {
-               return true;
-       }
-
-       /**
-        * Can users change their Nickname?
+        * Can users change their passwords?
         *
         * @return bool
         */
-       public function allowNickChange() {
+       public function allowPasswordChange() {
                return true;
        }