Administration - I accidentally lost my admin account! What can I do: Difference between revisions From Online Manual

Jump to: navigation, search
No edit summary
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:¡Accidentalmente perdí mi cuenta de "Admin"! ¿Qué puedo hacer?}}
{{DISPLAYTITLE:I accidentally lost my admin account! What can I do?}}
Si Ud. elimina acidentalmente su cuenta de administrador, necesitará registrarse de nuevo y ejecutar la consulta adecuada a su versión de SMF en phpMyAdmin.
If you accidentally delete your administrator account, you will need to register again and run the appropriate query for your SMF version in phpMyAdmin.  


Si Ud. solo pierde su Grupo de Usuarios y sus privilegios en el Foro debido a un error o conversión, necesitará ejecutar la consulta adecuada a su versión de SMF. Afortunadamente, en este caso, no tendrá que registrar su cuenta de nuevo.
If you lose your administrator membergroup and privileges because of a mistake or conversion, you will need to run the appropriate query for your SMF version. Fortunately, in this case, you do not have to register your account again.


{{TOC limit|3}}
{{TOC limit|3}}


==Script para SMF 2.0: administrate.php ==
==Script for SMF 2.0: administrate.php ==


El Script [http://www.simplemachines.org/community/index.php?topic=425480 administrate.php] para SMF 2.0 ha sido creado para solucionar este problema. '''Este Script  no tiene soporte oficial, así que úselo bajo su propia responsabilidad. Asegúrese de realizar un [[backup|back up]] de su Base de Datos antes de empezar.
The [http://www.simplemachines.org/community/index.php?topic=425480 administrate.php] script for SMF 2.0 has been created to solve this problem. '''This script is not officially supported, so use it at your own discretion'''. Make sure you [[backup|back up]] your database before you begin.


Para empezar:  
To begin:  
# Conéctese en el Foro.
# Log in to the forum.
# Suba el archivo, ''administrate.php'', al directorio de su Foro (donde se encuentra el archivo ''SSI.php'').
# Upload the file, ''administrate.php'', to your forum directory (where ''SSI.php'' is found).
# Usando su navegador, visite ''administrate.php''.
# Using your browser, visit ''administrate.php''.


==Otros Enfoques==
==Other Approaches==


===Configurando una cuenta de Nuevo Usuario como Admin===
===Setting up a New User Account to be Admin===


Las consultas a continuación le añadirán nuevamente como administrador en el foro SMF. '''No olvide reemplazar el prefijo "smf_" con el prefijo de su base de datos, e introduza el nombre de usuario correcto.''' Estas consultas se pueden ejecutar desde [[phpMyAdmin]] o, si no tiene instalado phpMyAdmin, desde un simple script de propósito único.
The queries below will add you back as an administrator on an SMF forum. '''Do not forget to replace smf_ with your database prefix.''' These queries can be run from within [[phpMyAdmin]], or, if you do not have phpMyAdmin installed, from a simple single-purpose script.


Para '''SMF 1.1''', ejecute esta consulta:
For '''SMF 1.1''', run this query:


{{code|1=UPDATE smf_members SET ID_GROUP = '1' WHERE memberName = 'adminsusername'}}
{{code|1=UPDATE smf_members SET ID_GROUP = '1' WHERE memberName = 'adminsusername'}}


Para '''SMF 2.0''', ejecute esta consulta:
For '''SMF 2.0''', run this query:


{{code|1=UPDATE smf_members SET id_group = '1' WHERE member_name = 'adminsusername'}}
{{code|1=UPDATE smf_members SET id_group = '1' WHERE member_name = 'adminsusername'}}


Además, SMF 2.0 le permite reatribuir publicaciones: ''Centro de administración > [[Mantenimiento del foro]] > Reatribuir publicaciones de usuarios''. Solo necesita completar el formulario con la dirección de correo electrónico o el nombre de usuario de la cuenta de usuario anterior y el nombre de usuario del miembro que tendrá esas publicaciones. Esto solo funciona para publicaciones de invitados (las publicaciones restantes de miembros eliminados se consideran publicaciones de invitados).
In addition, SMF 2.0 allows you to re-attribute posts: ''Administration Center > [[Forum Maintenance]] > Reattribute User Posts''. You just need to fill in the form using the e-mail address or username of the old user account, and the username for the member who is to have those posts. This only works for guest posts (remaining posts from deleted members are considered guest posts).


====Creación de un script de propósito único====
====Creating a Single-Purpose Script====


Siga estas instrucciones:
Follow these instructions:


# Crea un archivo PHP llamado '''createadmin.php'''.
# Create a PHP file called '''createadmin.php'''.
# Copie y pegue dentro de este archivo el código de abajo, de acuerdo a su versión de SMF.
# Copy and paste within this file the code below, according to your SMF version.
# Reemplace ''adminusername'' con el nombre de inicio de sesión que desea establecer como administrador.
# Replace ''adminusername'' with the login name you want to set as admin.
# Utilizando [[FTP_-_How_do_I_use_FTP|FTP]] suba '''createadmin.php'' a su directorio del foro, que es el mismo directorio que tiene ''SSI.php''.
# Using [[FTP_-_How_do_I_use_FTP|FTP]] upload '''createadmin.php'' to your forum directory, which is the same directory that has ''SSI.php'' in it.
# Ejecute el script, accediendo desde su navegador por URL como<br><nowiki>http://www.yourwebsite.tld/forum/createadmin.php</nowiki>.
# Run the script, accessing it from your browser by URL as<br><nowiki>http://www.yourwebsite.tld/forum/createadmin.php</nowiki>.
# Luego, asegúrese de eliminar '''createadmin.php''' del directorio de su foro.
# Afterwards, make sure to delete '''createadmin.php''' from your forum's directory.


Para '''SMF 1.1''':
For '''SMF 1.1''':


{{code|1=<nowiki><?php
{{code|1=<nowiki><?php
Line 64: Line 64:
?></nowiki>}}
?></nowiki>}}


Para '''SMF 2.0''':
For '''SMF 2.0''':


{{code|1=<nowiki><?php
{{code|1=<nowiki><?php
Line 94: Line 94:
?></nowiki>}}
?></nowiki>}}


===Necesito un Admin para activar la nueva cuenta antes de poder conectar===
===I Need Admin to Activate the New Account before I Can Log in===


Soluciónn: Desactive la activación de la cuenta por completo. En phpMyAdmin, o en un script de un solo propósito, ejecute la consulta adecuada para su versión de SMF. Luego, asegúrese de volver a configurar la activación de la cuenta como lo desea.
Solution: turn off account activation altogether. In phpMyAdmin, or in a single-purpose script, run the appropriate query for your version of SMF. Afterwards, be sure to set account activation back the way you want it.


Para '''SMF 1.1''':
For '''SMF 1.1''':  


{{code|1=UPDATE smf_members SET is_activated = 1 WHERE memberName = 'yourusername';}}
{{code|1=UPDATE smf_members SET is_activated = 1 WHERE memberName = 'yourusername';}}


Para '''SMF 2.0''':
For '''SMF 2.0''':


El [[#Creating_a_Single-Purpose_Script | script PHP SSI]] de arriba activará automáticamente la cuenta, pero si Ud. prefiere usar phpMyAdmin directamente, entonces la siguiente consulta activará el usuario:
The [[#Creating_a_Single-Purpose_Script | SSI PHP script]] above will automatically activate the account, but if you prefer to use phpMyAdmin directly then the following query will activate the user:


{{code|1=UPDATE smf_members SET is_activated = 1 WHERE member_name = 'yourusername';}}
{{code|1=UPDATE smf_members SET is_activated = 1 WHERE member_name = 'yourusername';}}


===Olvidé mi contraseña y no puedo crear una cuenta nueva===
===I Forgot My Password and I Cannot Create a New Account===


En phpMyAdmin, o en un script de un solo uso, ejecute esta consulta:
In phpMyAdmin, or in a single-purpose script, run this query:


{{code|1=UPDATE {$db_prefix}_settings SET value = 0 WHERE variable = 'registration_method';}}
{{code|1=UPDATE {$db_prefix}_settings SET value = 0 WHERE variable = 'registration_method';}}
Por último, asegúrese de configurar el método de registro de la forma que desee.
Afterwards, be sure to set the registration method the way you want it.


===Necesito crear una nueva cuenta para administrador, pero mi foro está en modo de mantenimiento===
===I Need to Create a New Account for Admin, but My Forum is in Maintenance Mode===


Si el modo de mantenimiento le impide registrar una nueva cuenta, puede [[Maintenance_mode#How_to_Set_Maintenance_Mode_without_Logging_into_the_Forum | desactivarlo en el archivo ''Settings.php'']].
If maintenance mode is preventing you from registering a new account, you can [[Maintenance_mode#How_to_Set_Maintenance_Mode_without_Logging_into_the_Forum | disable it in ''Settings.php'']].


===Restablecimiento de la contraseña de un usuario administrador===
===Resetting the Password of an Admin User===


Siga estas instrucciones:
Follow these instructions:


# Use phpMyAdmin (o similar) para ubicar (dentro de la tabla "_members") al usuario cuya contraseña quiera restablecer.
# Use phpMyAdmin (or similar) to locate (within the "_members" table) the member whose password is to be reset.
# En el campo de la tabla titulado "passwd", ingrese una nueva contraseña usando texto sin formato (texto plano).
# In the database field entitled "passwd", enter a new password using plain text.
# Limpiar (borrar) cualquier contenido existente en el campo de la tabla titulado "password_salt".
# Clear out (erase) any existing content in the database field entitled "password_salt".


La próxima vez que el miembro inicie sesión (con su nueva contraseña), SMF volverá a cifrar automáticamente las credenciales del usuario.
The next time the member logs in (using the new password), SMF will automatically re-encrypt the user's credentials.


[[Category:FAQ|Categoría: FAQ]]
[[Category:FAQ]]

Revision as of 09:48, 23 April 2022

If you accidentally delete your administrator account, you will need to register again and run the appropriate query for your SMF version in phpMyAdmin.

If you lose your administrator membergroup and privileges because of a mistake or conversion, you will need to run the appropriate query for your SMF version. Fortunately, in this case, you do not have to register your account again.

Script for SMF 2.0: administrate.php

The administrate.php script for SMF 2.0 has been created to solve this problem. This script is not officially supported, so use it at your own discretion. Make sure you back up your database before you begin.

To begin:

  1. Log in to the forum.
  2. Upload the file, administrate.php, to your forum directory (where SSI.php is found).
  3. Using your browser, visit administrate.php.

Other Approaches

Setting up a New User Account to be Admin

The queries below will add you back as an administrator on an SMF forum. Do not forget to replace smf_ with your database prefix. These queries can be run from within phpMyAdmin, or, if you do not have phpMyAdmin installed, from a simple single-purpose script.

For SMF 1.1, run this query:

UPDATE smf_members SET ID_GROUP = '1' WHERE memberName = 'adminsusername'

For SMF 2.0, run this query:

UPDATE smf_members SET id_group = '1' WHERE member_name = 'adminsusername'

In addition, SMF 2.0 allows you to re-attribute posts: Administration Center > Forum Maintenance > Reattribute User Posts. You just need to fill in the form using the e-mail address or username of the old user account, and the username for the member who is to have those posts. This only works for guest posts (remaining posts from deleted members are considered guest posts).

Creating a Single-Purpose Script

Follow these instructions:

  1. Create a PHP file called createadmin.php.
  2. Copy and paste within this file the code below, according to your SMF version.
  3. Replace adminusername with the login name you want to set as admin.
  4. Using FTP upload 'createadmin.php to your forum directory, which is the same directory that has SSI.php in it.
  5. Run the script, accessing it from your browser by URL as
    http://www.yourwebsite.tld/forum/createadmin.php.
  6. Afterwards, make sure to delete createadmin.php from your forum's directory.

For SMF 1.1:

<?php

// Pick a username to be the new admin user -- use the login name, not the display name
$yourusername='adminusername';

//---------------------------------------------------------------------------

// You should not need to change anything past this point in the script.
//Here we include SSI for globals used within the sql statement
include_once('SSI.php');
global $db_prefix;

//  Now run the query.
$querystring='UPDATE ' . $db_prefix . 'members
SET ID_GROUP = \'1\' WHERE memberName = \'' . $yourusername . '\'';
$adminsquirt = db_query($querystring, __FILE__,  __LINE__);

echo $yourusername . ' should now be an admin';
?>

For SMF 2.0:

<?php

// Pick a username to be the new admin user -- use the login name, not the display name
$yourusername = 'adminusername';

//---------------------------------------------------------------------------

// You should not need to change anything past this point in the script.
// Here we include SSI for globals used within the sql statement
include_once('SSI.php');

// Now run the query to elevate the user to administrator
// Also make sure that the account is activated!
$smcFunc['db_query']('', '
	UPDATE {db_prefix}members
	SET id_group = {int:admingrp},
		is_activated = {int:is_activated}
	WHERE member_name = {string:name}',
	array(
		'admingrp' => 1,
		'is_activated' => 1,
		'name' => $yourusername,
	)
);

echo $yourusername . ' should now be an admin';
?>

I Need Admin to Activate the New Account before I Can Log in

Solution: turn off account activation altogether. In phpMyAdmin, or in a single-purpose script, run the appropriate query for your version of SMF. Afterwards, be sure to set account activation back the way you want it.

For SMF 1.1:

UPDATE smf_members SET is_activated = 1 WHERE memberName = 'yourusername';

For SMF 2.0:

The SSI PHP script above will automatically activate the account, but if you prefer to use phpMyAdmin directly then the following query will activate the user:

UPDATE smf_members SET is_activated = 1 WHERE member_name = 'yourusername';

I Forgot My Password and I Cannot Create a New Account

In phpMyAdmin, or in a single-purpose script, run this query:

UPDATE {$db_prefix}_settings SET value = 0 WHERE variable = 'registration_method';

Afterwards, be sure to set the registration method the way you want it.

I Need to Create a New Account for Admin, but My Forum is in Maintenance Mode

If maintenance mode is preventing you from registering a new account, you can disable it in Settings.php.

Resetting the Password of an Admin User

Follow these instructions:

  1. Use phpMyAdmin (or similar) to locate (within the "_members" table) the member whose password is to be reset.
  2. In the database field entitled "passwd", enter a new password using plain text.
  3. Clear out (erase) any existing content in the database field entitled "password_salt".

The next time the member logs in (using the new password), SMF will automatically re-encrypt the user's credentials.



Advertisement: