r105375 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105374‎ | r105375 | r105376 >
Date:23:02, 6 December 2011
Author:reedy
Status:deferred
Tags:
Comment:
Swap @access public for public on function names

Minor documentation updates
Modified paths:
  • /trunk/extensions/LdapAuthentication/LdapAuthentication.php (modified) (history)
  • /trunk/extensions/LdapAuthentication/LdapAutoAuthentication.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LdapAuthentication/LdapAutoAuthentication.php
@@ -5,9 +5,10 @@
66 /**
77 * Does the web server authentication piece of the LDAP plugin.
88 *
9 - * @access public
 9+ * @param $user User
 10+ * @param $result
1011 */
11 - static function Authenticate( $user, &$result = null ) {
 12+ public static function Authenticate( $user, &$result = null ) {
1213 global $wgAuth, $wgLDAPAutoAuthUsername;
1314
1415 $wgAuth->printDebug( "Entering AutoAuthentication.", NONSENSITIVE );
@@ -62,7 +63,12 @@
6364 return true;
6465 }
6566
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 ) {
6773 global $wgAuth;
6874
6975 if ( !$wgAuth->autoCreate() ) {
@@ -90,8 +96,13 @@
9197 return true;
9298 }
9399
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 ) {
96107 global $wgAuth;
97108 $wgAuth->printDebug( "Entering NoLogout.", NONSENSITIVE );
98109
Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php
@@ -152,9 +152,8 @@
153153 *
154154 * @param string $username
155155 * @return bool
156 - * @access public
157156 */
158 - function userExists( $username ) {
 157+ public function userExists( $username ) {
159158 global $wgLDAPAddLDAPUsers;
160159
161160 $this->printDebug( "Entering userExists", NONSENSITIVE );
@@ -299,9 +298,8 @@
300299 * @param string $username
301300 * @param string $password
302301 * @return bool
303 - * @access public
304302 */
305 - function authenticate( $username, $password = '' ) {
 303+ public function authenticate( $username, $password = '' ) {
306304 global $wgLDAPAuthAttribute;
307305 global $wgLDAPAutoAuthUsername;
308306 global $wgLDAPLowerCaseUsername;
@@ -438,9 +436,8 @@
439437 * Modify options in the login template.
440438 *
441439 * @param UserLoginTemplate $template
442 - * @access public
443440 */
444 - function modifyUITemplate( &$template, &$type ) {
 441+ public function modifyUITemplate( &$template, &$type ) {
445442 global $wgLDAPAddLDAPUsers;
446443 global $wgLDAPMailPassword;
447444
@@ -491,9 +488,8 @@
492489 * This is just a question, and shouldn't perform any actions.
493490 *
494491 * @return bool
495 - * @access public
496492 */
497 - function autoCreate() {
 493+ public function autoCreate() {
498494 global $wgLDAPDisableAutoCreate;
499495
500496 return !( isset( $wgLDAPDisableAutoCreate[$_SESSION['wsDomain']] ) && $wgLDAPDisableAutoCreate[$_SESSION['wsDomain']] );
@@ -506,9 +502,8 @@
507503 * @param User $user
508504 * @param string $password
509505 * @return bool
510 - * @access public
511506 */
512 - function setPassword( $user, $password ) {
 507+ public function setPassword( $user, $password ) {
513508 global $wgLDAPUpdateLDAP, $wgLDAPWriterDN, $wgLDAPWriterPassword;
514509
515510 $this->printDebug( "Entering setPassword", NONSENSITIVE );
@@ -576,9 +571,8 @@
577572 *
578573 * @param User $user
579574 * @return bool
580 - * @access public
581575 */
582 - function updateExternalDB( $user ) {
 576+ public function updateExternalDB( $user ) {
583577 global $wgLDAPUpdateLDAP;
584578 global $wgLDAPWriterDN, $wgLDAPWriterPassword;
585579
@@ -642,9 +636,8 @@
643637 * Return true if yes.
644638 *
645639 * @return bool
646 - * @access public
647640 */
648 - function canCreateAccounts() {
 641+ public function canCreateAccounts() {
649642 global $wgLDAPAddLDAPUsers;
650643
651644 return ( isset( $wgLDAPAddLDAPUsers[$_SESSION['wsDomain']] ) && $wgLDAPAddLDAPUsers[$_SESSION['wsDomain']] );
@@ -656,9 +649,8 @@
657650 * Return true if yes.
658651 *
659652 * @return bool
660 - * @access public
661653 */
662 - function allowPasswordChange() {
 654+ public function allowPasswordChange() {
663655 global $wgLDAPUpdateLDAP, $wgLDAPMailPassword;
664656 global $wgLDAPUseLocal;
665657
@@ -689,9 +681,8 @@
690682 * @param User $user
691683 * @param string $password
692684 * @return bool
693 - * @access public
694685 */
695 - function addUser( $user, $password, $email = '', $realname = '' ) {
 686+ public function addUser( $user, $password, $email = '', $realname = '' ) {
696687 global $wgLDAPAddLDAPUsers, $wgLDAPWriterDN, $wgLDAPWriterPassword;
697688 global $wgLDAPSearchAttributes;
698689 global $wgLDAPWriteLocation;
@@ -806,9 +797,8 @@
807798 * Set the domain this plugin is supposed to use when authenticating.
808799 *
809800 * @param string $domain
810 - * @access public
811801 */
812 - function setDomain( $domain ) {
 802+ public function setDomain( $domain ) {
813803 $this->printDebug( "Setting domain as: $domain", NONSENSITIVE );
814804 $_SESSION['wsDomain'] = $domain;
815805 }
@@ -819,9 +809,8 @@
820810 *
821811 * @param string $domain
822812 * @return bool
823 - * @access public
824813 */
825 - function validDomain( $domain ) {
 814+ public function validDomain( $domain ) {
826815 global $wgLDAPDomainNames, $wgLDAPUseLocal;
827816
828817 $this->printDebug( "Entering validDomain", NONSENSITIVE );
@@ -838,11 +827,10 @@
839828 /**
840829 * When a user logs in, update user with information from LDAP.
841830 *
842 - * @param User $user
843 - * @access public
 831+ * @param $user User
844832 * TODO: fix the setExternalID stuff
845833 */
846 - function updateUser( &$user ) {
 834+ public function updateUser( &$user ) {
847835 global $wgLDAPRetrievePrefs, $wgLDAPPreferences;
848836 global $wgLDAPUseLDAPGroups;
849837 global $wgLDAPUniqueBlockLogin, $wgLDAPUniqueRenameUser;
@@ -910,10 +898,9 @@
911899 * When creating a user account, initialize user with information from LDAP.
912900 *
913901 * @param User $user
914 - * @access public
915902 * TODO: fix setExternalID stuff
916903 */
917 - function initUser( &$user, $autocreate = false ) {
 904+ public function initUser( &$user, $autocreate = false ) {
918905 $this->printDebug( "Entering initUser", NONSENSITIVE );
919906
920907 if ( $this->authFailed ) {
@@ -945,9 +932,8 @@
946933 * This is just a question, and shouldn't perform any actions.
947934 *
948935 * @return bool
949 - * @access public
950936 */
951 - function strict() {
 937+ public function strict() {
952938 global $wgLDAPUseLocal, $wgLDAPMailPassword;
953939
954940 $this->printDebug( "Entering strict.", NONSENSITIVE );
@@ -967,9 +953,8 @@
968954 *
969955 * @param string $username
970956 * @return string
971 - * @access public
972957 */
973 - function getCanonicalName( $username ) {
 958+ public function getCanonicalName( $username ) {
974959 global $wgLDAPUseFetchedUsername;
975960 $this->printDebug( "Entering getCanonicalName", NONSENSITIVE );
976961
@@ -1020,10 +1005,8 @@
10211006 /**
10221007 * Configures the authentication plugin for use with auto-authentication
10231008 * plugins.
1024 - *
1025 - * @access public
10261009 */
1027 - function autoAuthSetup() {
 1010+ public function autoAuthSetup() {
10281011 global $wgLDAPAutoAuthDomain;
10291012
10301013 $this->setDomain( $wgLDAPAutoAuthDomain );

Status & tagging log