r38764 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38763‎ | r38764 | r38765 >
Date:10:43, 7 August 2008
Author:krimpet
Status:old
Tags:
Comment:
Non-crap version of r38753 - sorry about that ._.
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/maintenance/Doxyfile (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/Doxyfile
@@ -16,7 +16,7 @@
1717 PROJECT_NAME = MediaWiki
1818 PROJECT_NUMBER = {{CURRENT_VERSION}}
1919 OUTPUT_DIRECTORY = {{OUTPUT_DIRECTORY}}
20 -CREATE_SUBDIRS = NO
 20+CREATE_SUBDIRS = YES
2121 OUTPUT_LANGUAGE = English
2222 BRIEF_MEMBER_DESC = YES
2323 REPEAT_BRIEF = YES
@@ -175,7 +175,7 @@
176176 HHC_LOCATION =
177177 GENERATE_CHI = NO
178178 BINARY_TOC = NO
179 -TOC_EXPAND = NO
 179+TOC_EXPAND = YES
180180 DISABLE_INDEX = NO
181181 ENUM_VALUES_PER_LINE = 4
182182 GENERATE_TREEVIEW = YES
@@ -191,8 +191,8 @@
192192 PAPER_TYPE = a4wide
193193 EXTRA_PACKAGES =
194194 LATEX_HEADER =
195 -PDF_HYPERLINKS = NO
196 -USE_PDFLATEX = NO
 195+PDF_HYPERLINKS = YES
 196+USE_PDFLATEX = YES
197197 LATEX_BATCHMODE = NO
198198 LATEX_HIDE_INDICES = NO
199199 #---------------------------------------------------------------------------
@@ -207,7 +207,7 @@
208208 #---------------------------------------------------------------------------
209209 # configuration options related to the man page output
210210 #---------------------------------------------------------------------------
211 -GENERATE_MAN = YES
 211+GENERATE_MAN = NO
212212 MAN_OUTPUT = man
213213 MAN_EXTENSION = .3
214214 MAN_LINKS = NO
Index: trunk/phase3/includes/User.php
@@ -461,8 +461,8 @@
462462 * addresses like this, if we allowed accounts like this to be created
463463 * new users could get the old edits of these anonymous users.
464464 *
465 - * @param $name \type{\string}
466 - * @return \type{\bool}
 465+ * @param $name \type{\string} String to match
 466+ * @return \type{\bool} True or false
467467 */
468468 static function isIP( $name ) {
469469 return preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.(?:xxx|\d{1,3})$/',$name) || IP::isIPv6($name);
@@ -476,8 +476,8 @@
477477 * is longer than the maximum allowed username size or doesn't begin with
478478 * a capital letter.
479479 *
480 - * @param $name \type{\string}
481 - * @return \type{\bool}
 480+ * @param $name \type{\string} String to match
 481+ * @return \type{\bool} True or false
482482 */
483483 static function isValidUserName( $name ) {
484484 global $wgContLang, $wgMaxNameChars;
@@ -530,8 +530,8 @@
531531 * If an account already exists in this form, login will be blocked
532532 * by a failure to pass this function.
533533 *
534 - * @param $name \type{\string}
535 - * @return \type{\bool}
 534+ * @param $name \type{\string} String to match
 535+ * @return \type{\bool} True or false
536536 */
537537 static function isUsableName( $name ) {
538538 global $wgReservedUsernames;
@@ -568,8 +568,8 @@
569569 * rather than in isValidUserName() to avoid disrupting
570570 * existing accounts.
571571 *
572 - * @param $name \type{\string}
573 - * @return \type{\bool}
 572+ * @param $name \type{\string} String to match
 573+ * @return \type{\bool} True or false
574574 */
575575 static function isCreatableName( $name ) {
576576 return
@@ -583,7 +583,7 @@
584584 * Is the input a valid password for this user?
585585 *
586586 * @param $password \type{\string} Desired password
587 - * @return \type{\bool}
 587+ * @return \type{\bool} True or false
588588 */
589589 function isValidPassword( $password ) {
590590 global $wgMinimalPasswordLength, $wgContLang;
@@ -609,7 +609,7 @@
610610 * @todo Check for RFC 2822 compilance (bug 959)
611611 *
612612 * @param $addr \type{\string} E-mail address
613 - * @return \type{\bool}
 613+ * @return \type{\bool} True or false
614614 */
615615 public static function isValidEmailAddr( $addr ) {
616616 $result = null;
@@ -717,7 +717,7 @@
718718 * Return a random password. Sourced from mt_rand, so it's not particularly secure.
719719 * @todo hash random numbers to improve security, like generateToken()
720720 *
721 - * @return \type{\string}
 721+ * @return \type{\string} New random password
722722 */
723723 static function randomPassword() {
724724 global $wgMinimalPasswordLength;
@@ -979,7 +979,7 @@
980980 * Get a given default option value.
981981 *
982982 * @param $opt \type{\string} Name of option to retrieve
983 - * @return \type{\string}
 983+ * @return \type{\string} Default option value
984984 */
985985 public static function getDefaultOption( $opt ) {
986986 $defOpts = self::getDefaultOptions();
@@ -992,7 +992,7 @@
993993
994994 /**
995995 * Get a list of user toggle names
996 - * @return \arrayof{\string}
 996+ * @return \arrayof{\string} Array of user toggle names
997997 */
998998 static function getToggles() {
999999 global $wgContLang;
@@ -1080,7 +1080,7 @@
10811081 * Whether the given IP is in the SORBS blacklist.
10821082 *
10831083 * @param $ip \type{\string} IP to check
1084 - * @return \type{\bool}
 1084+ * @return \type{\bool} True if blacklisted
10851085 */
10861086 function inSorbsBlacklist( $ip ) {
10871087 global $wgEnableSorbs, $wgSorbsUrl;
@@ -1094,7 +1094,7 @@
10951095 *
10961096 * @param $ip \type{\string} IP to check
10971097 * @param $base \type{\string} URL of the DNS blacklist
1098 - * @return \type{\bool}
 1098+ * @return \type{\bool} True if blacklisted
10991099 */
11001100 function inDnsBlacklist( $ip, $base ) {
11011101 wfProfileIn( __METHOD__ );
@@ -1128,7 +1128,7 @@
11291129 /**
11301130 * Is this user subject to rate limiting?
11311131 *
1132 - * @return \type{\bool}
 1132+ * @return \type{\bool} True if rate limited
11331133 */
11341134 public function isPingLimitable() {
11351135 global $wgRateLimitsExcludedGroups;
@@ -1317,7 +1317,7 @@
13181318
13191319 /**
13201320 * Get the user name, or the IP of an anonymous user
1321 - * @return \type{\string}
 1321+ * @return \type{\string} User's name or IP address
13221322 */
13231323 function getName() {
13241324 if ( !$this->mDataLoaded && $this->mFrom == 'name' ) {
@@ -1353,7 +1353,7 @@
13541354
13551355 /**
13561356 * Get the user's name escaped by underscores.
1357 - * @return \type{\string}
 1357+ * @return \type{\string} Username escaped by underscores
13581358 */
13591359 function getTitleKey() {
13601360 return str_replace( ' ', '_', $this->getName() );
@@ -1623,7 +1623,7 @@
16241624
16251625 /**
16261626 * Get the user's current token.
1627 - * @return \type{\string}
 1627+ * @return \type{\string} Token
16281628 */
16291629 function getToken() {
16301630 $this->load();
@@ -1682,7 +1682,7 @@
16831683 /**
16841684 * Has password reminder email been sent within the last
16851685 * $wgPasswordReminderResendTime hours?
1686 - * @return \type{\bool}
 1686+ * @return \type{\bool} True or false
16871687 */
16881688 function isPasswordReminderThrottled() {
16891689 global $wgPasswordReminderResendTime;
@@ -1696,7 +1696,7 @@
16971697
16981698 /**
16991699 * Get the user's e-mail address
1700 - * @return \type{\string}
 1700+ * @return \type{\string} User's e-mail address
17011701 */
17021702 function getEmail() {
17031703 $this->load();
@@ -1726,7 +1726,7 @@
17271727
17281728 /**
17291729 * Get the user's real name
1730 - * @return \type{\string}
 1730+ * @return \type{\string} User's real name
17311731 */
17321732 function getRealName() {
17331733 $this->load();
@@ -1828,7 +1828,7 @@
18291829
18301830 /**
18311831 * Get the user's preferred date format.
1832 - * @return \type{\string}
 1832+ * @return \type{\string} User's preferred date format
18331833 */
18341834 function getDatePreference() {
18351835 // Important migration for old data rows
@@ -1846,7 +1846,7 @@
18471847
18481848 /**
18491849 * Get the permissions this user has.
1850 - * @return \arrayof{\string}
 1850+ * @return \arrayof{\string} Array of permission names
18511851 */
18521852 function getRights() {
18531853 if ( is_null( $this->mRights ) ) {
@@ -1861,7 +1861,7 @@
18621862 /**
18631863 * Get the list of explicit group memberships this user has.
18641864 * The implicit * and user groups are not included.
1865 - * @return \arrayof{\string}
 1865+ * @return \arrayof{\string} Array of internal group names
18661866 */
18671867 function getGroups() {
18681868 $this->load();
@@ -1872,8 +1872,9 @@
18731873 * Get the list of implicit group memberships this user has.
18741874 * This includes all explicit groups, plus 'user' if logged in,
18751875 * '*' for all accounts and autopromoted groups
 1876+ *
18761877 * @param $recache \type{\bool} Whether to avoid the cache
1877 - * @return \arrayof{\string}
 1878+ * @return \arrayof{\string} Array of internal group names
18781879 */
18791880 function getEffectiveGroups( $recache = false ) {
18801881 if ( $recache || is_null( $this->mEffectiveGroups ) ) {
@@ -1896,7 +1897,7 @@
18971898
18981899 /**
18991900 * Get the user's edit count.
1900 - * @return \type{\int}
 1901+ * @return \type{\int} User's edit count
19011902 */
19021903 function getEditCount() {
19031904 if ($this->mId) {
@@ -1960,7 +1961,7 @@
19611962
19621963 /**
19631964 * Get whether the user is logged in
1964 - * @return \type{\bool}
 1965+ * @return \type{\bool} True or false
19651966 */
19661967 function isLoggedIn() {
19671968 return $this->getID() != 0;
@@ -1968,7 +1969,7 @@
19691970
19701971 /**
19711972 * Get whether the user is anonymous
1972 - * @return \type{\bool}
 1973+ * @return \type{\bool} True or false
19731974 */
19741975 function isAnon() {
19751976 return !$this->isLoggedIn();
@@ -1976,7 +1977,7 @@
19771978
19781979 /**
19791980 * Get whether the user is a bot
1980 - * @return \type{\bool}
 1981+ * @return \type{\bool} True or false
19811982 * @deprecated
19821983 */
19831984 function isBot() {
@@ -1999,7 +2000,7 @@
20002001
20012002 /**
20022003 * Check whether to enable recent changes patrol features for this user
2003 - * @return \type{\bool}
 2004+ * @return \type{\bool} True or false
20042005 */
20052006 public function useRCPatrol() {
20062007 global $wgUseRCPatrol;
@@ -2008,7 +2009,7 @@
20092010
20102011 /**
20112012 * Check whether to enable new pages patrol features for this user
2012 - * @return \type{\bool}
 2013+ * @return \type{\bool} True or false
20132014 */
20142015 public function useNPPatrol() {
20152016 global $wgUseRCPatrol, $wgUseNPPatrol;
@@ -2017,7 +2018,7 @@
20182019
20192020 /**
20202021 * Get the current skin, loading it if required
2021 - * @return \type{Skin}
 2022+ * @return \type{Skin} Current skin
20222023 * @todo FIXME : need to check the old failback system [AV]
20232024 */
20242025 function &getSkin() {
@@ -2456,7 +2457,7 @@
24572458 * which will give them a chance to modify this key based on their own
24582459 * settings.
24592460 *
2460 - * @return \type{\string}
 2461+ * @return \type{\string} Page rendering hash
24612462 */
24622463 function getPageRenderingHash() {
24632464 global $wgContLang, $wgUseDynamicDates, $wgLang;
@@ -2491,7 +2492,7 @@
24922493
24932494 /**
24942495 * Get whether the user is explicitly blocked from account creation.
2495 - * @return \type{\bool}
 2496+ * @return \type{\bool} True if blocked
24962497 */
24972498 function isBlockedFromCreateAccount() {
24982499 $this->getBlockedStatus();
@@ -2500,7 +2501,7 @@
25012502
25022503 /**
25032504 * Get whether the user is blocked from using Special:Emailuser.
2504 - * @return \type{\bool}
 2505+ * @return \type{\bool} True if blocked
25052506 */
25062507 function isBlockedFromEmailuser() {
25072508 $this->getBlockedStatus();
@@ -2509,7 +2510,7 @@
25102511
25112512 /**
25122513 * Get whether the user is allowed to create an account.
2513 - * @return \type{\bool}
 2514+ * @return \type{\bool} True if allowed
25142515 */
25152516 function isAllowedToCreateAccount() {
25162517 return $this->isAllowed( 'createaccount' ) && !$this->isBlockedFromCreateAccount();
@@ -2525,7 +2526,7 @@
25262527 /**
25272528 * Get this user's personal page title.
25282529 *
2529 - * @return \type{Title}
 2530+ * @return \type{Title} User's personal page title
25302531 */
25312532 function getUserPage() {
25322533 return Title::makeTitle( NS_USER, $this->getName() );
@@ -2534,7 +2535,7 @@
25352536 /**
25362537 * Get this user's talk page title.
25372538 *
2538 - * @return \type{Title}
 2539+ * @return \type{Title} User's talk page title
25392540 */
25402541 function getTalkPage() {
25412542 $title = $this->getUserPage();
@@ -2543,7 +2544,7 @@
25442545
25452546 /**
25462547 * Get the maximum valid user ID.
2547 - * @return \type{\int}
 2548+ * @return \type{\int} %User ID
25482549 * @static
25492550 */
25502551 function getMaxID() {
@@ -2635,7 +2636,7 @@
26362637 /**
26372638 * Check if the given clear-text password matches the temporary password
26382639 * sent by e-mail for password reset operations.
2639 - * @return \type{\bool}
 2640+ * @return \type{\bool} True if matches, false otherwise
26402641 */
26412642 function checkTemporaryPassword( $plaintext ) {
26422643 return self::comparePasswords( $this->mNewpassword, $plaintext, $this->getId() );
@@ -2739,7 +2740,7 @@
27402741 * @param $subject \type{\string} Message subject
27412742 * @param $body \type{\string} Message body
27422743 * @param $from \type{\string} Optional From address; if unspecified, default $wgPasswordSender will be used
2743 - * @param $replyto \type{\string}
 2744+ * @param $replyto \type{\string} Reply-to address
27442745 * @return \twotypes{\bool,WikiError} True on success, a WikiError object on failure
27452746 */
27462747 function sendMail( $subject, $body, $from = null, $replyto = null ) {
@@ -2761,7 +2762,7 @@
27622763 * this change to the database.
27632764 *
27642765 * @param[out] &$expiration \type{\mixed} Accepts the expiration time
2765 - * @return \type{\string}
 2766+ * @return \type{\string} New token
27662767 * @private
27672768 */
27682769 function confirmationToken( &$expiration ) {
@@ -2779,7 +2780,7 @@
27802781 /**
27812782 * Return a URL the user can use to confirm their email address.
27822783 * @param $token \type{\string} Accepts the email confirmation token
2783 - * @return \type{\string}
 2784+ * @return \type{\string} New token URL
27842785 * @private
27852786 */
27862787 function confirmationTokenUrl( $token ) {
@@ -2787,8 +2788,9 @@
27882789 }
27892790 /**
27902791 * Return a URL the user can use to invalidate their email address.
 2792+ *
27912793 * @param $token \type{\string} Accepts the email confirmation token
2792 - * @return \type{\string}
 2794+ * @return \type{\string} New token URL
27932795 * @private
27942796 */
27952797 function invalidationTokenUrl( $token ) {
@@ -2855,7 +2857,7 @@
28562858 /**
28572859 * Is this user allowed to send e-mails within limits of current
28582860 * site configuration?
2859 - * @return \type{\bool}
 2861+ * @return \type{\bool} True if allowed
28602862 */
28612863 function canSendEmail() {
28622864 $canSend = $this->isEmailConfirmed();
@@ -2866,7 +2868,7 @@
28672869 /**
28682870 * Is this user allowed to receive e-mails within limits of current
28692871 * site configuration?
2870 - * @return \type{\bool}
 2872+ * @return \type{\bool} True if allowed
28712873 */
28722874 function canReceiveEmail() {
28732875 return $this->isEmailConfirmed() && !$this->getOption( 'disablemail' );
@@ -2880,7 +2882,7 @@
28812883 * confirmed their address by returning a code or using a password
28822884 * sent to the address from the wiki.
28832885 *
2884 - * @return \type{\bool}
 2886+ * @return \type{\bool} True if confirmed
28852887 */
28862888 function isEmailConfirmed() {
28872889 global $wgEmailAuthentication;
@@ -2901,7 +2903,7 @@
29022904
29032905 /**
29042906 * Check whether there is an outstanding request for e-mail confirmation.
2905 - * @return \type{\bool}
 2907+ * @return \type{\bool} True if pending
29062908 */
29072909 function isEmailConfirmationPending() {
29082910 global $wgEmailAuthentication;
@@ -2962,7 +2964,7 @@
29632965 * Get the localized descriptive name for a group, if it exists
29642966 *
29652967 * @param $group \type{\string} Internal group name
2966 - * @return \type{\string}
 2968+ * @return \type{\string} Localized descriptive group name
29672969 */
29682970 static function getGroupName( $group ) {
29692971 global $wgMessageCache;
@@ -2978,7 +2980,7 @@
29792981 * Get the localized descriptive name for a member of a group, if it exists
29802982 *
29812983 * @param $group \type{\string} Internal group name
2982 - * @return \type{\string}
 2984+ * @return \type{\string} Localized name for group member
29832985 */
29842986 static function getGroupMember( $group ) {
29852987 global $wgMessageCache;
@@ -2994,7 +2996,7 @@
29952997 * Return the set of defined explicit groups.
29962998 * The implicit groups (by default *, 'user' and 'autoconfirmed')
29972999 * are not included, as they are defined automatically, not in the database.
2998 - * @return \arrayof{\string}
 3000+ * @return \arrayof{\string} Array of internal group names
29993001 */
30003002 static function getAllGroups() {
30013003 global $wgGroupPermissions;
@@ -3006,7 +3008,7 @@
30073009
30083010 /**
30093011 * Get a list of all available permissions.
3010 - * @return \arrayof{\string}
 3012+ * @return \arrayof{\string} Array of permission names
30113013 */
30123014 static function getAllRights() {
30133015 if ( self::$mAllRights === false ) {
@@ -3023,7 +3025,7 @@
30243026
30253027 /**
30263028 * Get a list of implicit groups
3027 - * @return \arrayof{\string}
 3029+ * @return \arrayof{\string} Array of internal group names
30283030 */
30293031 public static function getImplicitGroups() {
30303032 global $wgImplicitGroups;
@@ -3141,7 +3143,7 @@
31423144 * Get the description of a given right
31433145 *
31443146 * @param $right \type{\string} Right to query
3145 - * @return \type{\string}
 3147+ * @return \type{\string} Localized description of the right
31463148 */
31473149 static function getRightDescription( $right ) {
31483150 global $wgMessageCache;
@@ -3197,7 +3199,7 @@
31983200 * @param $hash \type{\string} Password hash
31993201 * @param $password \type{\string} Plain-text password to compare
32003202 * @param $userId \type{\string} %User ID for old-style password salt
3201 - * @return \type{\bool}
 3203+ * @return \type{\bool} True if matches, false otherwise
32023204 */
32033205 static function comparePasswords( $hash, $password, $userId = false ) {
32043206 $m = false;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r38753Finishing touches on User.php documentationkrimpet08:22, 7 August 2008

Status & tagging log