diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2007-09-14 13:18:58 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2007-09-14 13:18:58 +0200 |
commit | 8f416baead93a48e5799e44b8bd2e2c4859f4e04 (patch) | |
tree | cd47ac55eb80a39e3225e8b4f3161b88ea16c2cf /maintenance/userOptions.inc | |
parent | d7d08bd1a17618c7d77a6b9b2989e9f7293d6ed6 (diff) |
auf Version 1.11 aktualisiert; Login-Bug behoben
Diffstat (limited to 'maintenance/userOptions.inc')
-rw-r--r-- | maintenance/userOptions.inc | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index 702ab715..b889e1b8 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]++; + } } } } @@ -190,13 +205,13 @@ The new option is NOT validated. Usage: php userOptions.php --list - php userOptions.php <user option> --usage + php userOptions.php [user option] --usage php userOptions.php [options] <user option> --old <old value> --new <new value> Switchs: --list : list available user options and their default value - --usage <option name> : report statistics about an option + --usage : report all options statistics or just one if you specify it. --old <old value> : the value to look for --new <new value> : new value to update users with |