Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » Joomla »

Modificar registro en Joomla!

Estas en el tema de Modificar registro en Joomla! en el foro de Joomla en Foros del Web. Hola! Bueno, en este caso posteo porque estoy haciendo una nueva versión de mi web en Joomla, y quiero modificar los datos del formulario de ...
  #1 (permalink)  
Antiguo 23/01/2006, 18:47
Avatar de colettainternet
Usuario baneado!
 
Fecha de Ingreso: noviembre-2005
Ubicación: En la cima, claro.
Mensajes: 933
Antigüedad: 18 años, 5 meses
Puntos: 0
Modificar registro en Joomla!

Hola!

Bueno, en este caso posteo porque estoy haciendo una nueva versión de mi web en Joomla, y quiero modificar los datos del formulario de registro.

Los únicos datos que solicita el registro son: Nombre, usuario, e-mail y la clave. ¿¿Cómo puedo hacer para agregar otros datos, y para personalizar el mail que se envía al que se registró??

Muchas gracias!!

SaLu2 :ados:

Última edición por metacortex; 18/03/2006 a las 18:44 Razón: Autopromoción
  #2 (permalink)  
Antiguo 23/01/2006, 20:03
Avatar de elbar
Colaborador
 
Fecha de Ingreso: enero-2004
Ubicación: Buenos Aires
Mensajes: 1.406
Antigüedad: 20 años, 3 meses
Puntos: 8
En la ruta: components/com_registration de Jomla, tenes los archivos de registro, creo que deberias modificar el registration.html
  #3 (permalink)  
Antiguo 24/01/2006, 13:17
Avatar de colettainternet
Usuario baneado!
 
Fecha de Ingreso: noviembre-2005
Ubicación: En la cima, claro.
Mensajes: 933
Antigüedad: 18 años, 5 meses
Puntos: 0
Bueno, en ese directorio tengo 2 archivos.

REGISTRATION.HTML.PHP (le saqué la cabecera xq el mensaje quedaba muy largo)

Cita:
<?php
/**
* @version $Id: registration.html.php 85 2005-09-15 23:12:03Z eddieajau $
* @package Joomla
* @subpackage Users
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );

/**
* @package Joomla
* @subpackage Users
*/
class HTML_registration {
function lostPassForm($option) {
?>
<form action="index.php" method="post">

<div class="componentheading">
<?php echo _PROMPT_PASSWORD; ?>
</div>

<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
<tr>
<td colspan="2">

<?php echo _NEW_PASS_DESC; ?>
</td>
</tr>
<tr>
<td>
<?php echo _PROMPT_UNAME; ?>
</td>
<td>
<input type="text" name="checkusername" class="inputbox" size="40" maxlength="25" />

</td>
</tr>
<tr>
<td>
<?php echo _PROMPT_EMAIL; ?>
</td>
<td>
<input type="text" name="confirmEmail" class="inputbox" size="40" />
</td>

</tr>
<tr>
<td colspan="2">
<input type="hidden" name="option" value="<?php echo $option;?>" />
<input type="hidden" name="task" value="sendNewPass" /> <input type="submit" class="button" value="<?php echo _BUTTON_SEND_PASS; ?>" />
</td>
</tr>
</table>

</form>
<?php
}

function registerForm($option, $useractivation) {
?>
<script language="javascript" type="text/javascript">
function submitbutton() {
var form = document.mosForm;
var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");

// do field validation
if (form.name.value == "") {
alert( "<?php echo html_entity_decode(_REGWARN_NAME);?>" );
} else if (form.username.value == "") {
alert( "<?php echo html_entity_decode(_REGWARN_UNAME);?>" );
} else if (r.exec(form.username.value) || form.username.value.length < 3) {
alert( "<?php printf( html_entity_decode(_VALID_AZ09), html_entity_decode(_PROMPT_UNAME), 2 );?>" );
} else if (form.email.value == "") {
alert( "<?php echo html_entity_decode(_REGWARN_MAIL);?>" );
} else if (form.password.value.length < 6) {
alert( "<?php echo html_entity_decode(_REGWARN_PASS);?>" );
} else if (form.password2.value == "") {
alert( "<?php echo html_entity_decode(_REGWARN_VPASS1);?>" );
} else if ((form.password.value != "") && (form.password.value != form.password2.value)){
alert( "<?php echo html_entity_decode(_REGWARN_VPASS2);?>" );
} else if (r.exec(form.password.value)) {
alert( "<?php printf( html_entity_decode(_VALID_AZ09), html_entity_decode(_REGISTER_PASS), 6 );?>" );
} else {
form.submit();
}
}
</script>
<form action="index.php" method="post" name="mosForm">

<div class="componentheading">
<?php echo _REGISTER_TITLE; ?>
</div>

<table cellpadding="0" cellspacing="0" border="0" width="100%" class="contentpane">
<tr>
<td colspan="2"><?php echo _REGISTER_REQUIRED; ?></td>
</tr>
<tr>
<td width="30%">
<?php echo _REGISTER_NAME; ?> *
</td>
<td>

<input type="text" name="name" size="40" value="" class="inputbox" />
</td>
</tr>
<tr>
<td>
<?php echo _REGISTER_UNAME; ?> *
</td>
<td>
<input type="text" name="username" size="40" value="" class="inputbox" />

</td>
<tr>
<td>
<?php echo _REGISTER_EMAIL; ?> *
</td>
<td>
<input type="text" name="email" size="40" value="" class="inputbox" />
</td>
</tr>

<tr>
<td>
<?php echo _REGISTER_PASS; ?> *
</td>
<td>
<input class="inputbox" type="password" name="password" size="40" value="" />
</td>
</tr>
<tr>

<td>
<?php echo _REGISTER_VPASS; ?> *
</td>
<td>
<input class="inputbox" type="password" name="password2" size="40" value="" />
</td>
</tr>
<tr>
<td colspan="2">

</td>
</tr>
<tr>
<td colspan=2>
</td>
</tr>
</table>

<input type="hidden" name="id" value="0" />

<input type="hidden" name="gid" value="0" />
<input type="hidden" name="useractivation" value="<?php echo $useractivation;?>" />
<input type="hidden" name="option" value="<?php echo $option; ?>" />
<input type="hidden" name="task" value="saveRegistration" />
<input type="button" value="<?php echo _BUTTON_SEND_REG; ?>" class="button" onclick="submitbutton()" />
</form>
<?php
}
}
?>

y tengo el otro archivo (registration.php) que lo pongo en el siguiente post porque me limita a 10.000 caracteres por mensaje y no me alcanza.


Continua:
  #4 (permalink)  
Antiguo 24/01/2006, 13:20
Avatar de colettainternet
Usuario baneado!
 
Fecha de Ingreso: noviembre-2005
Ubicación: En la cima, claro.
Mensajes: 933
Antigüedad: 18 años, 5 meses
Puntos: 0
Parte II

Bueno, aquí el archivo registration.php

Cita:
getPath( 'front_html' ) ); switch( $task ) { case 'lostPassword': lostPassForm( $option ); break; case 'sendNewPass': sendNewPass( $option ); break; case 'register': registerForm( $option, $mosConfig_useractivation ); break; case 'saveRegistration': saveRegistration( $option ); break; case 'activate': activate( $option ); break; } function lostPassForm( $option ) { global $mainframe; $mainframe->SetPageTitle(_PROMPT_PASSWORD); HTML_registration::lostPassForm($option); } function sendNewPass( $option ) { global $database, $Itemid; global $mosConfig_live_site, $mosConfig_sitename; global $mosConfig_mailfrom, $mosConfig_fromname; $_live_site = $mosConfig_live_site; $_sitename = $mosConfig_sitename; // ensure no malicous sql gets past $checkusername = mosGetParam( $_POST, 'checkusername', '' ); $checkusername = $database->getEscaped( $checkusername ); $confirmEmail = mosGetParam( $_POST, 'confirmEmail', ''); $confirmEmail = $database->getEscaped( $confirmEmail ); $query = "SELECT id" . "\n FROM #__users" . "\n WHERE username = '$checkusername'" . "\n AND email = '$confirmEmail'" ; $database->setQuery( $query ); if (!($user_id = $database->loadResult()) || !$checkusername || !$confirmEmail) { mosRedirect( "index.php?option=$option&task=lostPassword&mosmsg ="._ERROR_PASS ); } $newpass = mosMakePassword(); $message = _NEWPASS_MSG; eval ("\$message = \"$message\";"); $subject = _NEWPASS_SUB; eval ("\$subject = \"$subject\";"); mosMail($mosConfig_mailfrom, $mosConfig_fromname, $confirmEmail, $subject, $message); $newpass = md5( $newpass ); $sql = "UPDATE #__users" . "\n SET password = '$newpass'" . "\n WHERE id = $user_id" ; $database->setQuery( $sql ); if (!$database->query()) { die("SQL error" . $database->stderr(true)); } mosRedirect( "index.php?Itemid=$Itemid&mosmsg="._NEWPASS_SE NT ); } function registerForm( $option, $useractivation ) { global $mainframe; if (!$mainframe->getCfg( 'allowUserRegistration' )) { mosNotAuth(); return; } $mainframe->SetPageTitle(_REGISTER_TITLE); HTML_registration::registerForm($option, $useractivation); } function saveRegistration( $option ) { global $database, $acl; global $mosConfig_sitename, $mosConfig_live_site, $mosConfig_useractivation, $mosConfig_allowUserRegistration; global $mosConfig_mailfrom, $mosConfig_fromname, $mosConfig_mailfrom, $mosConfig_fromname; if ($mosConfig_allowUserRegistration=='0') { mosNotAuth(); return; } $row = new mosUser( $database ); if (!$row->bind( $_POST, 'usertype' )) { mosErrorAlert( $row->getError() ); } mosMakeHtmlSafe($row); $row->id = 0; $row->usertype = ''; $row->gid = $acl->get_group_id( 'Registered', 'ARO' ); if ($mosConfig_useractivation == '1') { $row->activation = md5( mosMakePassword() ); $row->block = '1'; } if (!$row->check()) { echo "\n"; exit(); } $pwd = $row->password; $row->password = md5( $row->password ); $row->registerDate = date('Y-m-d H:i:s'); if (!$row->store()) { echo "\n"; exit(); } $row->checkin(); $name = $row->name; $email = $row->email; $username = $row->username; $subject = sprintf (_SEND_SUB, $name, $mosConfig_sitename); $subject = html_entity_decode($subject, ENT_QUOTES); if ($mosConfig_useractivation=="1"){ $message = sprintf (_USEND_MSG_ACTIVATE, $name, $mosConfig_sitename, $mosConfig_live_site."/index.php?option=com_registration&task=activate&ac tivation=".$row->activation, $mosConfig_live_site, $username, $pwd); } else { $message = sprintf (_USEND_MSG, $name, $mosConfig_sitename, $mosConfig_live_site); } $message = html_entity_decode($message, ENT_QUOTES); // Send email to user if ($mosConfig_mailfrom != "" && $mosConfig_fromname != "") { $adminName2 = $mosConfig_fromname; $adminEmail2 = $mosConfig_mailfrom; } else { $query = "SELECT name, email" . "\n FROM #__users" . "\n WHERE LOWER( usertype ) = 'superadministrator'" . "\n OR LOWER( usertype ) = 'super administrator'" ; $database->setQuery( $query ); $rows = $database->loadObjectList(); $row2 = $rows[0]; $adminName2 = $row2->name; $adminEmail2 = $row2->email; } mosMail($adminEmail2, $adminName2, $email, $subject, $message); // Send notification to all administrators $subject2 = sprintf (_SEND_SUB, $name, $mosConfig_sitename); $message2 = sprintf (_ASEND_MSG, $adminName2, $mosConfig_sitename, $row->name, $email, $username); $subject2 = html_entity_decode($subject2, ENT_QUOTES); $message2 = html_entity_decode($message2, ENT_QUOTES); // get superadministrators id $admins = $acl->get_group_objects( 25, 'ARO' ); foreach ( $admins['users'] AS $id ) { $query = "SELECT email, sendEmail" . "\n FROM #__users" ."\n WHERE id = $id" ; $database->setQuery( $query ); $rows = $database->loadObjectList(); $row = $rows[0]; if ($row->sendEmail) { mosMail($adminEmail2, $adminName2, $row->email, $subject2, $message2); } } if ( $mosConfig_useractivation == 1 ){ echo _REG_COMPLETE_ACTIVATE; } else { echo _REG_COMPLETE; } } function activate( $option ) { global $database; global $mosConfig_useractivation, $mosConfig_allowUserRegistration; if ($mosConfig_allowUserRegistration == '0' || $mosConfig_useractivation == '0') { mosNotAuth(); return; } $activation = mosGetParam( $_REQUEST, 'activation', '' ); $activation = $database->getEscaped( $activation ); if (empty( $activation )) { echo _REG_ACTIVATE_NOT_FOUND; return; } $query = "SELECT id" . "\n FROM #__users" . "\n WHERE activation = '$activation'" . "\n AND block = 1" ; $database->setQuery( $query ); $result = $database->loadResult(); if ($result) { $query = "UPDATE #__users" . "\n SET block = 0, activation = ''" . "\n WHERE activation = '$activation'" . "\n AND block = 1" ; $database->setQuery( $query ); if (!$database->query()) { echo "SQL error" . $database->stderr(true); } echo _REG_ACTIVATE_COMPLETE; } else { echo _REG_ACTIVATE_NOT_FOUND; } } function is_email($email){ $rBool=false; if(preg_match("/[\w\.\-]+@\w+[\w\.\-]*?\.\w{1,4}/", $email)){ $rBool=true; } return $rBool; } ?>
Bueno...ahora si...la pregunta del millón...¿¿Dónde y cómo tengo que modificar alguno de estos archivos para agregar mas campos en el registro??

Desde ya muchas gracias y SaLu2 :adioz:
  #5 (permalink)  
Antiguo 24/01/2006, 20:26
 
Fecha de Ingreso: diciembre-2004
Mensajes: 413
Antigüedad: 19 años, 4 meses
Puntos: 0
note compliques usa este componente http://developer.joomla.org/sf/go/proj1030
__________________
Directorio Empresas
agrega ya tu enlace
Seo Costa Rica
  #6 (permalink)  
Antiguo 14/05/2008, 07:31
 
Fecha de Ingreso: mayo-2008
Mensajes: 2
Antigüedad: 16 años
Puntos: 0
Re: Modificar registro en Joomla!

Usa esta herramienta


http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,2034/Itemid,35/

Última edición por bolilloman; 14/05/2008 a las 07:41
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta

SíEste tema le ha gustado a 1 personas (incluyéndote)




La zona horaria es GMT -6. Ahora son las 19:27.