Only list Create account when permissions allow it
authorDan Poltawski <dan@moodle.com>
Fri, 13 Jun 2014 15:16:15 +0000 (16:16 +0100)
committerDan Poltawski <dan@moodle.com>
Sat, 14 Jun 2014 07:19:09 +0000 (08:19 +0100)
Bug: 66589
Change-Id: I3848ae3e19aae7625acbf3ec332f8820d02215d6

includes/specials/SpecialCreateAccount.php

index 448637e..f3af312 100644 (file)
@@ -42,6 +42,14 @@ class SpecialCreateAccount extends SpecialRedirectToSpecial {
                return true;
        }
 
+       public function isRestricted() {
+               return true;
+       }
+
+       public function userCanExecute( User $user ) {
+               return $user->isAllowed( 'createaccount' );
+       }
+
        protected function getGroupName() {
                return 'login';
        }