Index: trunk/extensions/LdapAuthentication/LdapAutoAuthentication.php |
— | — | @@ -5,9 +5,10 @@ |
6 | 6 | /** |
7 | 7 | * Does the web server authentication piece of the LDAP plugin. |
8 | 8 | * |
9 | | - * @access public |
| 9 | + * @param $user User |
| 10 | + * @param $result |
10 | 11 | */ |
11 | | - static function Authenticate( $user, &$result = null ) { |
| 12 | + public static function Authenticate( $user, &$result = null ) { |
12 | 13 | global $wgAuth, $wgLDAPAutoAuthUsername; |
13 | 14 | |
14 | 15 | $wgAuth->printDebug( "Entering AutoAuthentication.", NONSENSITIVE ); |
— | — | @@ -62,7 +63,12 @@ |
63 | 64 | return true; |
64 | 65 | } |
65 | 66 | |
66 | | - static function attemptAddUser( $user, $mungedUsername ) { |
| 67 | + /** |
| 68 | + * @param $user User |
| 69 | + * @param $mungedUsername String |
| 70 | + * @return bool |
| 71 | + */ |
| 72 | + public static function attemptAddUser( $user, $mungedUsername ) { |
67 | 73 | global $wgAuth; |
68 | 74 | |
69 | 75 | if ( !$wgAuth->autoCreate() ) { |
— | — | @@ -90,8 +96,13 @@ |
91 | 97 | return true; |
92 | 98 | } |
93 | 99 | |
94 | | - /* No logout link in MW */ |
95 | | - static function NoLogout( &$personal_urls, $title ) { |
| 100 | + /** |
| 101 | + * No logout link in MW |
| 102 | + * @param $personal_urls array |
| 103 | + * @param $title Title |
| 104 | + * @return bool |
| 105 | + */ |
| 106 | + public static function NoLogout( &$personal_urls, $title ) { |
96 | 107 | global $wgAuth; |
97 | 108 | $wgAuth->printDebug( "Entering NoLogout.", NONSENSITIVE ); |
98 | 109 | |
Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php |
— | — | @@ -152,9 +152,8 @@ |
153 | 153 | * |
154 | 154 | * @param string $username |
155 | 155 | * @return bool |
156 | | - * @access public |
157 | 156 | */ |
158 | | - function userExists( $username ) { |
| 157 | + public function userExists( $username ) { |
159 | 158 | global $wgLDAPAddLDAPUsers; |
160 | 159 | |
161 | 160 | $this->printDebug( "Entering userExists", NONSENSITIVE ); |
— | — | @@ -299,9 +298,8 @@ |
300 | 299 | * @param string $username |
301 | 300 | * @param string $password |
302 | 301 | * @return bool |
303 | | - * @access public |
304 | 302 | */ |
305 | | - function authenticate( $username, $password = '' ) { |
| 303 | + public function authenticate( $username, $password = '' ) { |
306 | 304 | global $wgLDAPAuthAttribute; |
307 | 305 | global $wgLDAPAutoAuthUsername; |
308 | 306 | global $wgLDAPLowerCaseUsername; |
— | — | @@ -438,9 +436,8 @@ |
439 | 437 | * Modify options in the login template. |
440 | 438 | * |
441 | 439 | * @param UserLoginTemplate $template |
442 | | - * @access public |
443 | 440 | */ |
444 | | - function modifyUITemplate( &$template, &$type ) { |
| 441 | + public function modifyUITemplate( &$template, &$type ) { |
445 | 442 | global $wgLDAPAddLDAPUsers; |
446 | 443 | global $wgLDAPMailPassword; |
447 | 444 | |
— | — | @@ -491,9 +488,8 @@ |
492 | 489 | * This is just a question, and shouldn't perform any actions. |
493 | 490 | * |
494 | 491 | * @return bool |
495 | | - * @access public |
496 | 492 | */ |
497 | | - function autoCreate() { |
| 493 | + public function autoCreate() { |
498 | 494 | global $wgLDAPDisableAutoCreate; |
499 | 495 | |
500 | 496 | return !( isset( $wgLDAPDisableAutoCreate[$_SESSION['wsDomain']] ) && $wgLDAPDisableAutoCreate[$_SESSION['wsDomain']] ); |
— | — | @@ -506,9 +502,8 @@ |
507 | 503 | * @param User $user |
508 | 504 | * @param string $password |
509 | 505 | * @return bool |
510 | | - * @access public |
511 | 506 | */ |
512 | | - function setPassword( $user, $password ) { |
| 507 | + public function setPassword( $user, $password ) { |
513 | 508 | global $wgLDAPUpdateLDAP, $wgLDAPWriterDN, $wgLDAPWriterPassword; |
514 | 509 | |
515 | 510 | $this->printDebug( "Entering setPassword", NONSENSITIVE ); |
— | — | @@ -576,9 +571,8 @@ |
577 | 572 | * |
578 | 573 | * @param User $user |
579 | 574 | * @return bool |
580 | | - * @access public |
581 | 575 | */ |
582 | | - function updateExternalDB( $user ) { |
| 576 | + public function updateExternalDB( $user ) { |
583 | 577 | global $wgLDAPUpdateLDAP; |
584 | 578 | global $wgLDAPWriterDN, $wgLDAPWriterPassword; |
585 | 579 | |
— | — | @@ -642,9 +636,8 @@ |
643 | 637 | * Return true if yes. |
644 | 638 | * |
645 | 639 | * @return bool |
646 | | - * @access public |
647 | 640 | */ |
648 | | - function canCreateAccounts() { |
| 641 | + public function canCreateAccounts() { |
649 | 642 | global $wgLDAPAddLDAPUsers; |
650 | 643 | |
651 | 644 | return ( isset( $wgLDAPAddLDAPUsers[$_SESSION['wsDomain']] ) && $wgLDAPAddLDAPUsers[$_SESSION['wsDomain']] ); |
— | — | @@ -656,9 +649,8 @@ |
657 | 650 | * Return true if yes. |
658 | 651 | * |
659 | 652 | * @return bool |
660 | | - * @access public |
661 | 653 | */ |
662 | | - function allowPasswordChange() { |
| 654 | + public function allowPasswordChange() { |
663 | 655 | global $wgLDAPUpdateLDAP, $wgLDAPMailPassword; |
664 | 656 | global $wgLDAPUseLocal; |
665 | 657 | |
— | — | @@ -689,9 +681,8 @@ |
690 | 682 | * @param User $user |
691 | 683 | * @param string $password |
692 | 684 | * @return bool |
693 | | - * @access public |
694 | 685 | */ |
695 | | - function addUser( $user, $password, $email = '', $realname = '' ) { |
| 686 | + public function addUser( $user, $password, $email = '', $realname = '' ) { |
696 | 687 | global $wgLDAPAddLDAPUsers, $wgLDAPWriterDN, $wgLDAPWriterPassword; |
697 | 688 | global $wgLDAPSearchAttributes; |
698 | 689 | global $wgLDAPWriteLocation; |
— | — | @@ -806,9 +797,8 @@ |
807 | 798 | * Set the domain this plugin is supposed to use when authenticating. |
808 | 799 | * |
809 | 800 | * @param string $domain |
810 | | - * @access public |
811 | 801 | */ |
812 | | - function setDomain( $domain ) { |
| 802 | + public function setDomain( $domain ) { |
813 | 803 | $this->printDebug( "Setting domain as: $domain", NONSENSITIVE ); |
814 | 804 | $_SESSION['wsDomain'] = $domain; |
815 | 805 | } |
— | — | @@ -819,9 +809,8 @@ |
820 | 810 | * |
821 | 811 | * @param string $domain |
822 | 812 | * @return bool |
823 | | - * @access public |
824 | 813 | */ |
825 | | - function validDomain( $domain ) { |
| 814 | + public function validDomain( $domain ) { |
826 | 815 | global $wgLDAPDomainNames, $wgLDAPUseLocal; |
827 | 816 | |
828 | 817 | $this->printDebug( "Entering validDomain", NONSENSITIVE ); |
— | — | @@ -838,11 +827,10 @@ |
839 | 828 | /** |
840 | 829 | * When a user logs in, update user with information from LDAP. |
841 | 830 | * |
842 | | - * @param User $user |
843 | | - * @access public |
| 831 | + * @param $user User |
844 | 832 | * TODO: fix the setExternalID stuff |
845 | 833 | */ |
846 | | - function updateUser( &$user ) { |
| 834 | + public function updateUser( &$user ) { |
847 | 835 | global $wgLDAPRetrievePrefs, $wgLDAPPreferences; |
848 | 836 | global $wgLDAPUseLDAPGroups; |
849 | 837 | global $wgLDAPUniqueBlockLogin, $wgLDAPUniqueRenameUser; |
— | — | @@ -910,10 +898,9 @@ |
911 | 899 | * When creating a user account, initialize user with information from LDAP. |
912 | 900 | * |
913 | 901 | * @param User $user |
914 | | - * @access public |
915 | 902 | * TODO: fix setExternalID stuff |
916 | 903 | */ |
917 | | - function initUser( &$user, $autocreate = false ) { |
| 904 | + public function initUser( &$user, $autocreate = false ) { |
918 | 905 | $this->printDebug( "Entering initUser", NONSENSITIVE ); |
919 | 906 | |
920 | 907 | if ( $this->authFailed ) { |
— | — | @@ -945,9 +932,8 @@ |
946 | 933 | * This is just a question, and shouldn't perform any actions. |
947 | 934 | * |
948 | 935 | * @return bool |
949 | | - * @access public |
950 | 936 | */ |
951 | | - function strict() { |
| 937 | + public function strict() { |
952 | 938 | global $wgLDAPUseLocal, $wgLDAPMailPassword; |
953 | 939 | |
954 | 940 | $this->printDebug( "Entering strict.", NONSENSITIVE ); |
— | — | @@ -967,9 +953,8 @@ |
968 | 954 | * |
969 | 955 | * @param string $username |
970 | 956 | * @return string |
971 | | - * @access public |
972 | 957 | */ |
973 | | - function getCanonicalName( $username ) { |
| 958 | + public function getCanonicalName( $username ) { |
974 | 959 | global $wgLDAPUseFetchedUsername; |
975 | 960 | $this->printDebug( "Entering getCanonicalName", NONSENSITIVE ); |
976 | 961 | |
— | — | @@ -1020,10 +1005,8 @@ |
1021 | 1006 | /** |
1022 | 1007 | * Configures the authentication plugin for use with auto-authentication |
1023 | 1008 | * plugins. |
1024 | | - * |
1025 | | - * @access public |
1026 | 1009 | */ |
1027 | | - function autoAuthSetup() { |
| 1010 | + public function autoAuthSetup() { |
1028 | 1011 | global $wgLDAPAutoAuthDomain; |
1029 | 1012 | |
1030 | 1013 | $this->setDomain( $wgLDAPAutoAuthDomain ); |