コード例 #1
0
ファイル: profile.php プロジェクト: GallardoAlba/Meneame
function show_profile()
{
    global $user, $user_levels, $globals, $site_key, $current_user;
    echo '<div>';
    echo '<form  enctype="multipart/form-data" action="' . get_auth_link() . '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 . '&amp;size=80&amp;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 . mnminclude) . '" />';
    echo '<p><label>' . _('usuario') . ':</label><br/>';
    echo '<input type="text" autocomplete="off" name="username" id="username" value="' . $user->username . '"/>';
    echo '</p>';
    echo '<p><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 . '"/>';
    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>';
    if (is_avatars_enabled()) {
        echo '<input type="hidden" name="MAX_FILE_SIZE" value="300000" />';
        echo '<p><label>' . _('avatar') . ':</label><br/>';
        echo '<input type="file" autocomplete="off" name="image" />';
        echo '</p>';
    }
    echo '<p><label for="password">' . _("nueva clave") . ':</label><br />' . "\n";
    echo '<input type="password" autocomplete="off" id="password" name="password" size="25" onkeyup="return securePasswordCheck(this.form.password);"/></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" onkeyup="checkEqualFields(this.form.password2, this.form.password)"/></p>' . "\n";
    echo '<p><input type="submit" name="save_profile" value="' . _('actualizar') . '"/></p>';
    echo '</fieldset>';
    echo "</form></div>\n";
}
コード例 #2
0
ファイル: profile.php プロジェクト: GallardoAlba/Meneame
    $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();
$form->bio_max = $bio_max;
$form->bio_left = $form->bio_max - mb_strlen(html_entity_decode($user->bio, ENT_COMPAT, 'UTF-8'), 'UTF-8');
Haanga::Load('profile.html', compact('user', 'form', 'messages'));
do_footer();
function save_profile()
{
    global $db, $user, $current_user, $globals, $admin_mode, $site_key, $bio_max;
    $errors = 0;
    // benjami: control added (2005-12-22)
    $new_pass = false;
    $messages = array();
    $form_hash = md5($site_key . $user->id . $current_user->user_id);
    if (isset($_POST['disabledme']) && intval($_POST['disable']) == 1 && $_POST['form_hash'] == $form_hash && $_POST['user_id'] == $current_user->user_id) {
        $old_user_login = $user->username;
        $old_user_id = $user->id;
コード例 #3
0
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.'&amp;size=80&amp;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 '&nbsp;&nbsp;<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 '&nbsp;&nbsp;<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";
	
}
コード例 #4
0
ファイル: profile.php プロジェクト: rasomu/chuza
function show_profile() {
	global $user, $admin_mode, $user_levels, $globals, $site_key, $current_user, $db;

	echo '<div class="genericform" style="margin: 0 50px">';
	echo '<form  enctype="multipart/form-data" action="'.get_auth_link().'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="'.get_avatar_url($user->id, $user->avatar, 80).'" 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.mnminclude) .'" />';
	get_form_auth_ip();
	if ($admin_mode)
		echo '<input type="hidden" name="login" value="'.$user->username.'" />';

	echo '<p><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 '&nbsp;&nbsp;<span id="checkit"><input type="button" class="button" id="checkbutton1" disabled="disabled" value="'._('verificar').'" onclick="checkfield(\'username\', this.form, this.form.username)"/></span>';
	echo '&nbsp;<span id="usernamecheckitvalue"></span>' . "\n";
	echo '</p>';

	echo '<p><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 '&nbsp;&nbsp;<input type="button" class="button" id="checkbutton2" disabled="disabled" value="'._('verificar').'" onclick="checkfield(\'email\', this.form, this.form.email)"/>';
	echo '&nbsp;<span id="emailcheckitvalue"></span>';
	echo '</p>';

    echo '<p style="padding-bottom:10px;"><label>'._('norma ortográfica').':</label><br/>';
    echo '<select name="standard" >';
    foreach ($globals['standards'] as &$val) {
        $selected = "";
        if ($user->standard == $val['id']) $selected = 'selected="selected"';
        echo '<option value="'.$val['id'].'" '.$selected.' >&nbsp;'.$val['name'].'&nbsp;</option>'; 
    }
    echo '</select><br/>';
	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="note">' . _('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="note">' . _('sólo necesario si enviarás notas al nótame vía SMS') . '</span><br/>';
		echo '<span class="note">' . _('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="note">' . _('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="note">' . _('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="400000" />';
		echo '<p><label>'._('avatar').':</label><br/>';
		echo '<span class="note">' . _('imagen cuadrada de no más de 400 KB, sin transparencias') . '</span><br/>';
		echo '<input type="file" class="button" autocomplete="off" name="image" />';
		if ($user->avatar > 0) {
			echo '&nbsp;&nbsp;&nbsp;'._('Eliminar avatar').': <input type="checkbox" name="avatar_delete" value="1"/>';
		}
		echo '</p>';
	}

	echo '<fieldset><legend>'._('opciones de visualización') . '</legend>';
	echo '<p><label>'._('mostrar todos los comentarios').':&nbsp;';
	print_checkbox('comment_pref', $user->comment_pref & 1);
	echo '</label></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" onkeyup="return securePasswordCheck(this.form.password);"/></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" onkeyup="checkEqualFields(this.form.password2, this.form.password)"/></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><input type="submit" name="save_profile" value="'._('actualizar').'" class="button" /></p>';
	echo '</fieldset>';

	// Disable the account
	if ($user->id  == $current_user->user_id) {
		echo '<br/><fieldset><legend>'._('deshabilitar cuenta') . '</legend>';
		echo '<p>'._('¡atención! la cuenta será deshabilitada.').'</p>';
		echo '<p class="note">'._('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><label>'._('sí, quiero deshabilitarla').': <input  name="disable" type="checkbox" value="1"/>';
		echo '</label></p>';
		echo '<p><input type="submit" name="disabledme" value="'._('deshabilitar cuenta').'" class="button" /></p>';
		echo '</fieldset>';
	}


	echo "</form></div>\n";
	
}