From: Antoine Musso Date: Sat, 5 May 2007 20:30:12 +0000 (+0000) Subject: Actually do what the documentation says (r21907) X-Git-Tag: 1.31.0-rc.0~53068 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=f6d07afd2399360e848bda2fc120724a7ccd44d4;p=lhc%2Fweb%2Fwiklou.git Actually do what the documentation says (r21907) --- diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index 98150617a0..b889e1b8e5 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -108,10 +108,25 @@ class userOptions { $user = User::newFromId( $id->user_id ); // Get the options and update stats - foreach( $defaultOptions as $name => $defaultValue ) { - $userValue = $user->getOption( $name ); - if( $userValue <> $defaultValue ) { - @$ret[$name][$userValue]++; + if( $this->mAnOption ) { + + if(!array_key_exists( $this->mAnOption, $defaultOptions ) ) { + print "Invalid user option. Use --list to see valid choices\n"; + exit; + } + + $userValue = $user->getOption( $this->mAnOption ); + if( $userValue <> $defaultOptions[$this->mAnOption] ) { + @$ret[$this->mAnOption][$userValue]++; + } + + } else { + + foreach( $defaultOptions as $name => $defaultValue ) { + $userValue = $user->getOption( $name ); + if( $userValue <> $defaultValue ) { + @$ret[$name][$userValue]++; + } } } }