Manual:ChangePassword.php

This page is a translated version of the page Manual:ChangePassword.php and the translation is 50% complete.
Outdated translations are marked like this.

El archivo "changePassword.php" puede usarse para cambiar la contraseña de un usuario en tu wiki. Las contraseñas deben tener, al menos, 10 caracteres.

Uso

The following examples assume that they are called from the /maintenance/ directory of the wiki code.

php changePassword.php --user=target_username --password=new_password

Por ejemplo:

php changePassword.php --user=JohnSmith --password=Secret12

Usernames and passwords can have spaces, which will need to be protected from your shell (be it bash or cmd.exe; see Troubleshooting, below):

php changePassword.php --user="Anna Graham" --password="fierce sea ceasefire"

Para mostrar un mensaje de ayuda:

php changePassword.php --help

Opciones

  • --user (el nombre del usuario)
  • --password (la "nueva" contraseña del usuario)
  • --help (muestra mensaje de ayuda)

Solución de problemas

  • If your MediaWiki installation uses a memory cache, such as APC, memcached or Redis, then the user object is cached. Thus after making SQL changes you must flush the cache before a user can log in with the new password.
  • Windows has special challenges with parsing double-quoted strings, as when a username or password contains spaces in the second example above.
    • Occasionally triple ("""quoted string""") and quadruple sets of double quotes will solve your problems with Windows' command shell, cmd.exe. You may be happier, though, to try Cygwin and follow the Unix conventions for quoting strings, which require fewer quotation marks.
  • There are no spaces between the parameter=value in the command line.

This will cause a cryptic error:

php changePassword.php --user = username --password = newpassword

Removing the spaces will fix the problem.


See also