function show_profile() { global $user, $admin_mode, $user_levels; save_profile(); echo '<div id="genericform-contents"><div id="genericform"><fieldset><legend>'; if (!$admin_mode) echo '<span class="sign">'._('modifica tu perfil')." ($user->username: $user->level)</span></legend>"; else echo '<span class="sign">'."$user->username: $user->level</span></legend>"; echo '<form action="profile.php" method="post" id="thisform">'; echo '<input type="hidden" name="process" value="1">'; echo '<input type="hidden" name="user_id" value="'.$user->id.'">'; if ($admin_mode) echo '<input type="hidden" name="login" value="'.$user->username.'">'; echo '<p class="l-top"><label for="name" accesskey="1">'._('nombre real').':</label><br/>'; echo '<input type="text" name="names" id="names" tabindex="1" value="'.$user->names.'">'; echo '</p>'; echo '<p class="l-mid"><label for="name" accesskey="1">'._('correo electrónico').':</label><br/>'; echo '<input type="text" name="email" id="email" tabindex="2" value="'.$user->email.'">'; echo '</p>'; echo '<p class="l-mid"><label for="name" accesskey="1">'._('página web').':</label><br/>'; echo '<input type="text" name="url" id="url" tabindex="3" value="'.$user->url.'">'; echo '</p>'; echo '<p>'._('Introduce la nueva clave para cambiarla -no se cambiará si la dejas en blanco-:').'</p>'; echo '<p class="l-mid"><label for="password">' . _("clave") . ':</label><br />' . "\n"; echo '<input type="password" id="password" name="password" size="25" tabindex="4"/></p>' . "\n"; echo '<p class="l-mid"><label for="verify">' . _("repite la clave") . ': </label><br />' . "\n"; echo '<input type="password" id="verify" name="password2" size="25" tabindex="5"/></p>' . "\n"; if ($admin_mode) { echo '<p class="l-mid"><label for="verify">' . _("estado") . ': </label><br />' . "\n"; echo '<select name="user_level">'; foreach ($user_levels as $level) { echo '<option value="'.$level.'"'; if ($user->level == $level) echo ' selected="selected"'; echo '>'.$level.'</option>'; } echo '</select>'; } echo '<p class="l-bottom"><input type="submit" name="save_profile" value="'._('actualizar').'" class="genericsubmit"></p>'; echo "</form></fieldset></div></div>\n"; }
if (!$user->read()) { not_found(); } if ($current_user->user_id) { $globals['ads_branding'] = false; } // Enable user AdSense // do_user_ad: 0 = noad, > 0: probability n/100 // 100 if the user is the current one if ($current_user->user_id == $user->id && $globals['external_user_ads'] && !empty($user->adcode)) { $globals['user_adcode'] = $user->adcode; $globals['user_adchannel'] = $user->adchannel; $globals['do_user_ad'] = 100; } if (isset($_POST['process'])) { $messages = save_profile(); } else { //$globals['secure_page'] = False; // This allows to send the user back to the original cross domain authentication and ssl_server //setcookie('return_site', get_server_name(), 0, $globals['base_url'], UserAuth::domain()); $messages = array(); } do_header(_('edición del perfil del usuario') . ': ' . $user->username, 'profile', User::get_menu_items('profile', $login)); //echo $save_messages; // We do it later because teh profile could change header's info //show_profile(); $form = new stdClass(); $form->hash = md5($site_key . $user->id . $current_user->user_id); $form->admin_mode = $admin_mode; $form->auth_link = get_auth_link(); $form->user_levels = $user_levels; $form->avatars_enabled = is_avatars_enabled();
function show_profile() { global $user, $admin_mode, $user_levels, $globals; save_profile(); echo '<div id="genericform-contents"><div id="genericform"><fieldset><legend>'; if (!$admin_mode) echo '<span class="sign">'._('modifica tu perfil')." ($user->username: $user->level)</span></legend>"; else echo '<span class="sign">'."<a href='user.php?login="******"'>$user->username</a>: $user->level</span></legend>"; echo '<img class="sub-nav-img" src="'.$globals['base_url'] . 'backend/get_avatar.php?id='.$user->id.'&size=80&t='.time().'" width="80" height="80" alt="'.$user->username.'" />'; echo '<form enctype="multipart/form-data" action="profile.php" method="post" id="thisform" AUTOCOMPLETE="off">'; echo '<input type="hidden" name="process" value="1" />'; echo '<input type="hidden" name="user_id" value="'.$user->id.'" />'; if ($admin_mode) echo '<input type="hidden" name="login" value="'.$user->username.'" />'; echo '<p class="l-top"><label for="name" accesskey="1">'._('usuario').':</label><br/>'; echo '<input type="text" autocomplete="off" name="username" id="username" tabindex="1" value="'.$user->username.'" onkeyup="enablebutton(this.form.checkbutton1, null, this)" />'; echo ' <span id="checkit"><input type="button" id="checkbutton1" disabled="disabled" value="'._('verificar').'" onclick="checkfield(\'username\', this.form, this.form.username)"/></span>'; echo '<br/><span id="usernamecheckitvalue"></span>' . "\n"; echo '</p>'; echo '<p class="l-top"><label for="name" accesskey="1">'._('nombre real').':</label><br/>'; echo '<input type="text" autocomplete="off" name="names" id="names" tabindex="2" value="'.$user->names.'" />'; echo '</p>'; echo '<p class="l-mid"><label for="name" accesskey="1">'._('correo electrónico').':</label><br/>'; echo '<input type="text" autocomplete="off" name="email" id="email" tabindex="3" value="'.$user->email.'" onkeyup="enablebutton(this.form.checkbutton2, null, this)"/>'; echo ' <input type="button" id="checkbutton2" disabled="disabled" value="'._('verificar').'" onclick="checkfield(\'email\', this.form, this.form.email)"/>'; echo '<br/><span id="emailcheckitvalue"></span>'; echo '</p>'; echo '<p class="l-mid"><label for="name" accesskey="1">'._('página web').':</label><br/>'; echo '<input type="text" autocomplete="off" name="url" id="url" tabindex="4" value="'.$user->url.'" />'; echo '</p>'; if (is_avatars_enabled()) { echo '<input type="hidden" name="MAX_FILE_SIZE" value="300000" />'; echo '<p class="l-mid"><label for="name" accesskey="4">'._('avatar').':</label><br/>'; echo '<span class="genericformnote">' . _('El avatar debe ser una imagen cuadrada en jpeg, gif o png de no más de 100 KB, sin transparencias') . '</span><br/>'; echo '<input type="file" autocomplete="off" name="image" tabindex="5" />'; echo '</p>'; } echo '<p>'._('Introduce la nueva clave para cambiarla -no se cambiará si la dejas en blanco-:').'</p>'; echo '<p class="l-mid"><label for="password">' . _("clave") . ':</label><br />' . "\n"; echo '<input type="password" autocomplete="off" id="password" name="password" size="25" tabindex="6"/></p>' . "\n"; echo '<p class="l-mid"><label for="verify">' . _("repite la clave") . ': </label><br />' . "\n"; echo '<input type="password" autocomplete="off" id="verify" name="password2" size="25" tabindex="7"/></p>' . "\n"; if ($admin_mode) { echo '<p class="l-mid"><label for="verify">' . _("estado") . ': </label><br />' . "\n"; echo '<select name="user_level">'; foreach ($user_levels as $level) { echo '<option value="'.$level.'"'; if ($user->level == $level) echo ' selected="selected"'; echo '>'.$level.'</option>'; } echo '</select>'; echo '<p class="l-mid"><label for="karma" accesskey="1">'._('karma').':</label><br/>'; echo '<input type="text" autocomplete="off" name="karma" id="karma" tabindex="8" value="'.$user->karma.'" />'; echo '</p>'; } echo '<p class="l-bottom"><input type="submit" name="save_profile" value="'._('actualizar').'" class="genericsubmit" /></p>'; echo "</form></fieldset></div></div>\n"; }
$img = ""; $db->query($sql = "UPDATE " . table_users . " SET user_avatar_source='useruploaded' WHERE user_id='{$user->id}'"); unset($cached_users[$user->id]); } else { echo 'An error occured while uploading your avatar.'; } } if (isset($error) && is_array($error)) { while (list($key, $val) = each($error)) { echo $val; echo "<br>"; } } // Save changes if (isset($_POST['email'])) { $savemsg = save_profile(); if (is_string($savemsg)) { $main_smarty->assign('savemsg', $savemsg); } else { $save_message_text = $main_smarty->get_config_vars("PLIGG_Visual_Profile_DataUpdated"); if ($savemsg['username'] == 1) { $save_message_text .= "<br/>" . $main_smarty->get_config_vars("PLIGG_Visual_Profile_UsernameUpdated"); } if ($savemsg['pass'] == 1) { $save_message_text .= "<br/>" . $main_smarty->get_config_vars("PLIGG_Visual_Profile_PassUpdated"); } // Reload the page if no error $_SESSION['savemsg'] = $save_message_text; header("Location: " . getmyurl('user_edit', $login)); exit; }
} elseif ($_REQUEST['action'] === 'delete') { check_session(); if ($_REQUEST['what'] === 'all') { if (isset($_REQUEST['confirm'])) { del_all_messages($U['nickname'], 10, $U['entry']); } else { send_del_confirm(); } } elseif ($_REQUEST['what'] === 'last') { del_last_message(); } send_post(); } elseif ($_REQUEST['action'] === 'profile') { check_session(); if (isset($_REQUEST['do']) && $_REQUEST['do'] === 'save') { save_profile(); } send_profile(); } elseif ($_REQUEST['action'] === 'logout') { kill_session(); send_logout(); } elseif ($_REQUEST['action'] === 'colours') { check_session(); send_colours(); } elseif ($_REQUEST['action'] === 'notes') { check_session(); if (!empty($_REQUEST['do']) && $_REQUEST['do'] === 'admin' && $U['status'] > 6) { send_notes('admin'); } if ($U['status'] < 5) { send_access_denied();
function show_profile() { global $user, $main_smarty, $the_template; $savemsg = save_profile(); $main_smarty->assign('savemsg', $savemsg); $main_smarty->assign('UseAvatars', do_we_use_avatars()); $main_smarty->assign('Avatar_ImgLarge', get_avatar('large', $user->avatar, $user->username, $user->email)); $main_smarty->assign('Avatar_ImgSmall', get_avatar('small', $user->avatar, $user->username, $user->email)); check_actions('profile_show'); $main_smarty->assign('user_id', $user->id); $main_smarty->assign('user_email', $user->email); $main_smarty->assign('user_login', $user->username); $main_smarty->assign('user_names', $user->names); $main_smarty->assign('user_username', $user->username); $main_smarty->assign('user_url', $user->url); $main_smarty->assign('user_publicemail', $user->public_email); $main_smarty->assign('user_location', $user->location); $main_smarty->assign('user_occupation', $user->occupation); $main_smarty->assign('user_aim', $user->aim); $main_smarty->assign('user_msn', $user->msn); $main_smarty->assign('user_yahoo', $user->yahoo); $main_smarty->assign('user_gtalk', $user->gtalk); $main_smarty->assign('user_skype', $user->skype); $main_smarty->assign('user_irc', $user->irc); $main_smarty->assign('user_karma', $user->karma); $main_smarty->assign('user_joined', get_date($user->date)); $main_smarty->assign('user_avatar_source', $user->avatar_source); $user->all_stats(); $main_smarty->assign('user_total_links', $user->total_links); $main_smarty->assign('user_published_links', $user->published_links); $main_smarty->assign('user_total_comments', $user->total_comments); $main_smarty->assign('user_total_votes', $user->total_votes); $main_smarty->assign('user_published_votes', $user->published_votes); define('pagename', 'profile'); $main_smarty->assign('pagename', pagename); $main_smarty->assign('tpl_center', $the_template . '/profile_center'); $main_smarty->display($the_template . '/pligg.tpl'); }
function show_profile() { global $user, $admin_mode, $user_levels, $globals, $site_key, $current_user; save_profile(); echo '<div id="genericform-contents"><div id="genericform">'; echo '<form enctype="multipart/form-data" action="profile.php" method="post" id="thisform" AUTOCOMPLETE="off">'; echo '<fieldset><legend>'; echo '<span class="sign">' . _('opciones de usuario') . " <a href='" . get_user_uri($user->username) . "'>{$user->username}</a>: {$user->level}</span></legend>"; echo '<img class="thumbnail" src="' . $globals['base_url'] . 'backend/get_avatar.php?id=' . $user->id . '&size=80&t=' . time() . '" width="80" height="80" alt="' . $user->username . '" />'; echo '<input type="hidden" name="process" value="1" />'; echo '<input type="hidden" name="user_id" value="' . $user->id . '" />'; echo '<input type="hidden" name="form_hash" value="' . md5($site_key . $user->id . $globals['user_ip']) . '" />'; if ($admin_mode) { echo '<input type="hidden" name="login" value="' . $user->username . '" />'; } echo '<p class="l-top"><label>' . _('usuario') . ':</label><br/>'; echo '<input type="text" autocomplete="off" name="username" id="username" value="' . $user->username . '" onkeyup="enablebutton(this.form.checkbutton1, null, this)" />'; echo ' <span id="checkit"><input type="button" id="checkbutton1" disabled="disabled" value="' . _('verificar') . '" onclick="checkfield(\'username\', this.form, this.form.username)"/></span>'; echo '<br/><span id="usernamecheckitvalue"></span>' . "\n"; echo '</p>'; echo '<p class="l-top"><label>' . _('nombre real') . ':</label><br/>'; echo '<input type="text" autocomplete="off" name="names" id="names" value="' . $user->names . '" />'; echo '</p>'; echo '<p><label>' . _('correo electrónico') . ':</label><br/>'; echo '<input type="text" autocomplete="off" name="email" id="email" value="' . $user->email . '" onkeyup="enablebutton(this.form.checkbutton2, null, this)"/>'; echo ' <input type="button" id="checkbutton2" disabled="disabled" value="' . _('verificar') . '" onclick="checkfield(\'email\', this.form, this.form.email)"/>'; echo '<br/><span id="emailcheckitvalue"></span>'; echo '</p>'; echo '<p><label>' . _('página web') . ':</label><br/>'; echo '<input type="text" autocomplete="off" name="url" id="url" value="' . $user->url . '" />'; echo '</p>'; echo '<p><label>' . _('mensajero instantáneo público, invisible para los demás') . ':</label><br/>'; echo '<span class="genericformnote">' . _('necesario si te conectarás vía Jabber/Google Talk') . '</span><br/>'; echo '<input type="text" autocomplete="off" name="public_info" id="public_info" value="' . $user->public_info . '" />'; echo '</p>'; if ($user->id == $current_user->user_id) { echo '<p><label>' . _('teléfono móvil') . ':</label><br/>'; echo '<span class="genericformnote">' . _('sólo necesario si enviarás notas al nótame vía SMS') . '</span><br/>'; echo '<span class="genericformnote">' . _('pon el número completo, con código de país: +34123456789') . '</span><br/>'; echo '<input type="text" autocomplete="off" name="phone" id="phone" value="' . $user->phone . '" />'; echo '</p>'; } if ($globals['external_user_ads']) { echo '<p><label for="adcode">' . _('codigo AdSense') . ':</label><br/>'; echo '<span class="genericformnote">' . _('tu código de usuario de AdSense, del tipo pub-123456789') . '</span><br/>'; echo '<input type="text" autocomplete="off" name="adcode" id="adcode" maxlength="20" value="' . $user->adcode . '" /><br />'; echo '<span class="genericformnote">' . _('canal AdSense (opcional), del tipo 1234567890') . '</span><br/>'; echo '<input type="text" autocomplete="off" name="adchannel" id="adchannel" maxlength="12" value="' . $user->adchannel . '" />'; echo '</p>'; } if (is_avatars_enabled()) { echo '<input type="hidden" name="MAX_FILE_SIZE" value="300000" />'; echo '<p><label>' . _('avatar') . ':</label><br/>'; echo '<span class="genericformnote">' . _('el avatar debe ser una imagen cuadrada en jpeg, gif o png de no más de 100 KB, sin transparencias') . '</span><br/>'; echo '<input type="file" autocomplete="off" name="image" />'; echo '</p>'; } echo '<fieldset><legend>' . _('opciones de visualización') . '</legend>'; echo '<p>' . _('mostrar todos los comentarios') . ': '; print_checkbox('comment_pref', $user->comment_pref & 1); echo '</p>'; echo '</fieldset>'; echo '<p>' . _('introduce la nueva clave para cambiarla -no se cambiará si la dejas en blanco-:') . '</p>'; echo '<p><label for="password">' . _("clave") . ':</label><br />' . "\n"; echo '<input type="password" autocomplete="off" id="password" name="password" size="25" /></p>' . "\n"; echo '<p><label for="verify">' . _("repite la clave") . ': </label><br />' . "\n"; echo '<input type="password" autocomplete="off" id="verify" name="password2" size="25" /></p>' . "\n"; if ($admin_mode) { echo '<p><label for="verify">' . _("estado") . ': </label><br />' . "\n"; echo '<select name="user_level">'; foreach ($user_levels as $level) { echo '<option value="' . $level . '"'; if ($user->level == $level) { echo ' selected="selected"'; } echo '>' . $level . '</option>'; } echo '</select>'; echo '<p><label for="karma">' . _('karma') . ':</label><br/>'; echo '<input type="text" autocomplete="off" name="karma" id="karma" value="' . $user->karma . '" />'; echo '</p>'; } echo '<p class="l-bottom"><input type="submit" name="save_profile" value="' . _('actualizar') . '" class="genericsubmit" /></p>'; echo '</fieldset>'; // Disable the account if ($user->id == $current_user->user_id) { echo '<br/><fieldset><legend>' . _('deshabilitar la cuenta') . '</legend>'; echo '<p>' . _('atención! la cuenta será deshabilitada.') . '</p>'; echo '<p class="genericformnote">' . _('se eliminarán automáticamente los datos personales.') . '<br/>'; echo _('las notas serán eliminadas, los envíos y comentarios NO se borrarán.') . '</p>'; echo '<p>' . _('sí, quiero deshabilitarla') . ': <input name="disable" type="checkbox" value="1"/>'; echo '</p>'; echo '<p class="l-bottom"><input type="submit" name="disabledme" value="' . _('deshabilitar cuenta') . '" class="genericsubmit" /></p>'; echo '</fieldset>'; } echo "</form></div></div>\n"; }
function show_profile() { global $user, $main_smarty, $the_template, $CSRF; if (isset($_POST['email'])) { $savemsg = save_profile(); $main_smarty->assign('savemsg', $savemsg); } $CSRF->create('profile_change', true, true); // assign avatar source to smarty $main_smarty->assign('UseAvatars', do_we_use_avatars()); $main_smarty->assign('Avatar_ImgLarge', get_avatar('large', $user->avatar_source, $user->username, $user->email)); $main_smarty->assign('Avatar_ImgSmall', get_avatar('small', $user->avatar_source, $user->username, $user->email)); // module system hook $vars = ''; check_actions('profile_show', $vars); // assign profile information to smarty $main_smarty->assign('user_id', $user->id); $main_smarty->assign('user_email', $user->email); $main_smarty->assign('user_login', $user->username); $main_smarty->assign('user_names', $user->names); $main_smarty->assign('user_username', $user->username); $main_smarty->assign('user_url', $user->url); $main_smarty->assign('user_publicemail', $user->public_email); $main_smarty->assign('user_location', $user->location); $main_smarty->assign('user_occupation', $user->occupation); $main_smarty->assign('user_aim', $user->aim); $main_smarty->assign('user_msn', $user->msn); $main_smarty->assign('user_yahoo', $user->yahoo); $main_smarty->assign('user_gtalk', $user->gtalk); $main_smarty->assign('user_skype', $user->skype); $main_smarty->assign('user_irc', $user->irc); $main_smarty->assign('user_karma', $user->karma); $main_smarty->assign('user_joined', get_date($user->date)); $main_smarty->assign('user_avatar_source', $user->avatar_source); $user->all_stats(); $main_smarty->assign('user_total_links', $user->total_links); $main_smarty->assign('user_published_links', $user->published_links); $main_smarty->assign('user_total_comments', $user->total_comments); $main_smarty->assign('user_total_votes', $user->total_votes); $main_smarty->assign('user_published_votes', $user->published_votes); // pagename define('pagename', 'profile'); $main_smarty->assign('pagename', pagename); $main_smarty->assign('form_action', $_SERVER["PHP_SELF"]); // show the template $main_smarty->assign('tpl_center', $the_template . '/profile_center'); $main_smarty->display($the_template . '/pligg.tpl'); }
} if ($_GET['cs'] && $config['verify_email_profile']) { $error = ''; list($member_id, $ver_code) = split("-", $_GET["cs"]); $member_id = intval($member_id); if (!$member_id || $member_id != $_SESSION['_amember_id'] || !$ver_code || $user['data']['email_confirm_code'] != $ver_code) { fatal_error(_SIGNUP_INCORRECT_LINK); } else { if ($user['data']['email_confirm_code_exp'] < time()) { // Security code expired ; Remove vefication code and expire_date; profile_clean_verification_fields($user); fatal_error(_TPL_CHANGEPASSWORD_FAILED_EXPIRED); } else { // Everything is ok. Let's change email. $user['email'] = $user['data']['email_new']; profile_clean_verification_fields($user); html_redirect("profile.php", false, _TPL_PROFILE_SAVED_TITLE, _TPL_PROFILE_SAVED_SUCCESS); exit; } } } if ($vars['do_save']) { $error = save_profile($vars, $user); if ($error) { display_form($user); } else { display_saved(); } } else { display_form($user); }