2004-04-24 21:25:41 -04:00
|
|
|
<?php
|
2004-10-18 23:03:06 -04:00
|
|
|
require_once('admin.php');
|
2004-04-24 21:25:41 -04:00
|
|
|
|
|
|
|
$title = "Profile";
|
2004-08-22 19:24:50 -04:00
|
|
|
$parent_file = 'profile.php';
|
2003-05-22 08:12:53 -04:00
|
|
|
|
2004-10-18 23:03:06 -04:00
|
|
|
$wpvarstoreset = array('action','redirect','profile','user');
|
2003-12-18 04:36:13 -05:00
|
|
|
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
|
|
|
$wpvar = $wpvarstoreset[$i];
|
|
|
|
if (!isset($$wpvar)) {
|
2004-04-20 18:56:47 -04:00
|
|
|
if (empty($_POST["$wpvar"])) {
|
|
|
|
if (empty($_GET["$wpvar"])) {
|
2003-12-18 04:36:13 -05:00
|
|
|
$$wpvar = '';
|
2003-05-22 08:12:53 -04:00
|
|
|
} else {
|
2004-04-20 18:56:47 -04:00
|
|
|
$$wpvar = $_GET["$wpvar"];
|
2003-05-22 08:12:53 -04:00
|
|
|
}
|
|
|
|
} else {
|
2004-04-20 18:56:47 -04:00
|
|
|
$$wpvar = $_POST["$wpvar"];
|
2003-05-22 08:12:53 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-06-12 18:47:45 -04:00
|
|
|
require_once('../wp-config.php');
|
2003-12-31 19:55:31 -05:00
|
|
|
require_once('auth.php');
|
2003-05-22 08:12:53 -04:00
|
|
|
switch($action) {
|
|
|
|
|
2003-06-01 02:45:53 -04:00
|
|
|
case 'update':
|
2003-05-22 08:12:53 -04:00
|
|
|
|
|
|
|
get_currentuserinfo();
|
|
|
|
|
|
|
|
/* checking the nickname has been typed */
|
2004-04-20 18:56:47 -04:00
|
|
|
if (empty($_POST["newuser_nickname"])) {
|
2004-04-24 21:25:41 -04:00
|
|
|
die (__("<strong>ERROR</strong>: please enter your nickname (can be the same as your login)"));
|
2003-05-22 08:12:53 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if the ICQ UIN has been entered, check to see if it has only numbers */
|
2004-04-20 18:56:47 -04:00
|
|
|
if (!empty($_POST["newuser_icq"])) {
|
|
|
|
if ((ereg("^[0-9]+$",$_POST["newuser_icq"]))==false) {
|
2004-04-24 21:25:41 -04:00
|
|
|
die (__("<strong>ERROR</strong>: your ICQ UIN can only be a number, no letters allowed"));
|
2003-05-22 08:12:53 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* checking e-mail address */
|
2004-04-20 18:56:47 -04:00
|
|
|
if (empty($_POST["newuser_email"])) {
|
2004-04-24 21:25:41 -04:00
|
|
|
die (__("<strong>ERROR</strong>: please type your e-mail address"));
|
2003-05-22 08:12:53 -04:00
|
|
|
return false;
|
2004-04-20 18:56:47 -04:00
|
|
|
} else if (!is_email($_POST["newuser_email"])) {
|
2004-06-13 12:14:58 -04:00
|
|
|
die (__("<strong>ERROR</strong>: the e-mail address isn't correct"));
|
2003-05-22 08:12:53 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2004-04-20 18:56:47 -04:00
|
|
|
if ($_POST["pass1"] == "") {
|
|
|
|
if ($_POST["pass2"] != "")
|
2004-04-24 21:25:41 -04:00
|
|
|
die (__("<strong>ERROR</strong>: you typed your new password only once. Go back to type it twice."));
|
2003-05-22 08:12:53 -04:00
|
|
|
$updatepassword = "";
|
|
|
|
} else {
|
2004-04-20 18:56:47 -04:00
|
|
|
if ($_POST["pass2"] == "")
|
2004-04-24 21:25:41 -04:00
|
|
|
die (__("<strong>ERROR</strong>: you typed your new password only once. Go back to type it twice."));
|
2004-04-20 18:56:47 -04:00
|
|
|
if ($_POST["pass1"] != $_POST["pass2"])
|
2004-04-24 21:25:41 -04:00
|
|
|
die (__("<strong>ERROR</strong>: you typed two different passwords. Go back to correct that."));
|
2004-04-20 18:56:47 -04:00
|
|
|
$newuser_pass = $_POST["pass1"];
|
2004-02-09 04:56:57 -05:00
|
|
|
$updatepassword = "user_pass=MD5('$newuser_pass'), ";
|
2004-10-10 14:02:30 -04:00
|
|
|
setcookie('wordpresspass_' . COOKIEHASH, " ", time() - 31536000, COOKIEPATH);
|
|
|
|
setcookie('wordpresspass_' . COOKIEHASH, md5(md5($newuser_pass)), time() + 31536000, COOKIEPATH);
|
2003-05-22 08:12:53 -04:00
|
|
|
}
|
|
|
|
|
2004-11-19 02:23:37 -05:00
|
|
|
$newuser_firstname = $_POST['newuser_firstname'];
|
|
|
|
$newuser_lastname = $_POST['newuser_lastname'];
|
|
|
|
$newuser_nickname = $_POST['newuser_nickname'];
|
|
|
|
$newuser_nicename = sanitize_title($newuser_nickname);
|
|
|
|
$newuser_icq = $_POST['newuser_icq'];
|
|
|
|
$newuser_aim = $_POST['newuser_aim'];
|
|
|
|
$newuser_msn = $_POST['newuser_msn'];
|
|
|
|
$newuser_yim = $_POST['newuser_yim'];
|
|
|
|
$newuser_email = $_POST['newuser_email'];
|
|
|
|
$newuser_url = $_POST['newuser_url'];
|
2004-06-14 10:58:10 -04:00
|
|
|
$newuser_url = preg_match('/^(https?|ftps?|mailto|news|gopher):/is', $newuser_url) ? $newuser_url : 'http://' . $newuser_url;
|
2004-06-17 20:22:09 -04:00
|
|
|
$newuser_idmode=$_POST['newuser_idmode'];
|
|
|
|
$user_description = $_POST['user_description'];
|
2003-12-31 19:55:31 -05:00
|
|
|
|
2004-11-19 02:23:37 -05:00
|
|
|
$result = $wpdb->query("UPDATE $wpdb->users SET user_firstname='$newuser_firstname', $updatepassword user_lastname='$newuser_lastname', user_nickname='$newuser_nickname', user_icq='$newuser_icq', user_email='$newuser_email', user_url='$newuser_url', user_aim='$newuser_aim', user_msn='$newuser_msn', user_yim='$newuser_yim', user_idmode='$newuser_idmode', user_description = '$user_description', user_nicename = '$newuser_nicename' WHERE ID = $user_ID");
|
|
|
|
|
2003-12-31 19:55:31 -05:00
|
|
|
header('Location: profile.php?updated=true');
|
2003-05-22 08:12:53 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case 'IErightclick':
|
|
|
|
|
2004-09-04 20:24:28 -04:00
|
|
|
$bookmarklet_height= 550;
|
2003-05-22 08:12:53 -04:00
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
<div class="menutop"> IE one-click bookmarklet</div>
|
|
|
|
|
|
|
|
<table width="100%" cellpadding="20">
|
|
|
|
<tr><td>
|
|
|
|
|
|
|
|
<p>To have a one-click bookmarklet, just copy and paste this<br />into a new text file:</p>
|
|
|
|
<?php
|
2004-03-01 01:13:32 -05:00
|
|
|
$regedit = "REGEDIT4\r\n[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Post To &WP : ". get_settings('blogname') ."]\r\n@=\"javascript:doc=external.menuArguments.document;Q=doc.selection.createRange().text;void(btw=window.open('". get_settings('siteurl') ."/wp-admin/bookmarklet.php?text='+escape(Q)+'".$bookmarklet_tbpb."&popupurl='+escape(doc.location.href)+'&popuptitle='+escape(doc.title),'bookmarklet','scrollbars=no,width=480,height=".$bookmarklet_height.",left=100,top=150,status=yes'));btw.focus();\"\r\n\"contexts\"=hex:31\"";
|
2003-05-22 08:12:53 -04:00
|
|
|
?>
|
|
|
|
<pre style="margin: 20px; background-color: #cccccc; border: 1px dashed #333333; padding: 5px; font-size: 12px;"><?php echo $regedit; ?></pre>
|
2003-05-23 18:43:58 -04:00
|
|
|
<p>Save it as wordpress.reg, and double-click on this file in an Explorer<br />
|
2003-05-22 08:12:53 -04:00
|
|
|
window. Answer Yes to the question, and restart Internet Explorer.<br /><br />
|
|
|
|
That's it, you can now right-click in an IE window and select <br />
|
2003-05-23 18:43:58 -04:00
|
|
|
'Post to WP' to make the bookmarklet appear. :)</p>
|
2003-05-22 08:12:53 -04:00
|
|
|
|
|
|
|
<p align="center">
|
2004-02-01 06:03:43 -05:00
|
|
|
<form>
|
2003-05-22 08:12:53 -04:00
|
|
|
<input class="search" type="button" value="1" name="Close this window" />
|
2004-02-01 06:03:43 -05:00
|
|
|
</form>
|
2003-05-22 08:12:53 -04:00
|
|
|
</p>
|
|
|
|
</td></tr>
|
|
|
|
</table>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
2004-07-21 03:23:45 -04:00
|
|
|
$parent_file = 'users.php';
|
2003-12-31 19:55:31 -05:00
|
|
|
include_once('admin-header.php');
|
2003-05-22 08:12:53 -04:00
|
|
|
$profiledata=get_userdata($user_ID);
|
|
|
|
|
2004-09-04 20:24:28 -04:00
|
|
|
$bookmarklet_height= 440;
|
2003-05-22 08:12:53 -04:00
|
|
|
|
2004-08-22 19:24:50 -04:00
|
|
|
if (isset($updated)) { ?>
|
2004-04-19 04:09:27 -04:00
|
|
|
<div class="updated">
|
2004-04-24 21:25:41 -04:00
|
|
|
<p><strong><?php _e('Profile updated.') ?></strong></p>
|
2003-12-31 19:55:31 -05:00
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
<div class="wrap">
|
2004-05-19 03:09:32 -04:00
|
|
|
<h2><?php _e('Profile'); ?></h2>
|
2003-12-10 19:22:36 -05:00
|
|
|
<form name="profile" id="profile" action="profile.php" method="post">
|
2004-02-01 06:03:43 -05:00
|
|
|
<p>
|
2003-06-01 02:45:53 -04:00
|
|
|
<input type="hidden" name="action" value="update" />
|
|
|
|
<input type="hidden" name="checkuser_id" value="<?php echo $user_ID ?>" />
|
|
|
|
</p>
|
2004-05-19 03:09:32 -04:00
|
|
|
|
2003-12-31 19:55:31 -05:00
|
|
|
<table width="99%" border="0" cellspacing="2" cellpadding="3">
|
2004-05-19 03:05:40 -04:00
|
|
|
<tr>
|
|
|
|
<th width="33%" scope="row"><?php _e('Login:') ?></th>
|
2004-08-22 19:24:50 -04:00
|
|
|
<td width="67%"><?php echo $profiledata->user_login; ?></td>
|
2004-05-19 03:09:32 -04:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row"><?php _e('Level:') ?></th>
|
|
|
|
<td><?php echo $profiledata->user_level; ?></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th scope="row"><?php _e('Posts:') ?></th>
|
|
|
|
<td> <?php
|
|
|
|
$posts = get_usernumposts($user_ID);
|
|
|
|
echo $posts;
|
|
|
|
?></td>
|
|
|
|
</tr>
|
2003-12-31 19:55:31 -05:00
|
|
|
<tr>
|
2004-05-19 03:09:32 -04:00
|
|
|
<th scope="row"><?php _e('First name:') ?></th>
|
|
|
|
<td><input type="text" name="newuser_firstname" id="newuser_firstname" value="<?php echo $profiledata->user_firstname ?>" /></td>
|
2003-12-31 19:55:31 -05:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-04-24 21:25:41 -04:00
|
|
|
<th scope="row"><?php _e('Last name:') ?></th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td><input type="text" name="newuser_lastname" id="newuser_lastname2" value="<?php echo $profiledata->user_lastname ?>" /></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-04-24 21:25:41 -04:00
|
|
|
<th scope="row"><?php _e('Profile:') ?></th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td><textarea name="user_description" rows="5" id="textarea2" style="width: 99%; "><?php echo $profiledata->user_description ?></textarea></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-04-24 21:25:41 -04:00
|
|
|
<th scope="row"><?php _e('Nickname:') ?></th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td><input type="text" name="newuser_nickname" id="newuser_nickname2" value="<?php echo $profiledata->user_nickname ?>" /></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-06-13 12:14:58 -04:00
|
|
|
<th scope="row"><?php _e('E-mail:') ?></th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td><input type="text" name="newuser_email" id="newuser_email2" value="<?php echo $profiledata->user_email ?>" /></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-04-24 21:25:41 -04:00
|
|
|
<th scope="row"><?php _e('Website:') ?></th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td><input type="text" name="newuser_url" id="newuser_url2" value="<?php echo $profiledata->user_url ?>" /></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-04-24 21:25:41 -04:00
|
|
|
<th scope="row"><?php _e('ICQ:') ?></th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td><input type="text" name="newuser_icq" id="newuser_icq2" value="<?php if ($profiledata->user_icq > 0) { echo $profiledata->user_icq; } ?>" /></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-04-24 21:25:41 -04:00
|
|
|
<th scope="row"><?php _e('AIM:') ?></th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td><input type="text" name="newuser_aim" id="newuser_aim2" value="<?php echo $profiledata->user_aim ?>" /></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-04-24 21:25:41 -04:00
|
|
|
<th scope="row"><?php _e('MSN IM:') ?> </th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td><input type="text" name="newuser_msn" id="newuser_msn2" value="<?php echo $profiledata->user_msn ?>" /></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-04-24 21:25:41 -04:00
|
|
|
<th scope="row"><?php _e('Yahoo IM:') ?> </th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td> <input type="text" name="newuser_yim" id="newuser_yim2" value="<?php echo $profiledata->user_yim ?>" /> </td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-04-24 21:25:41 -04:00
|
|
|
<th scope="row"><?php _e('Identity on blog:') ?> </th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td><select name="newuser_idmode">
|
|
|
|
<option value="nickname"<?php
|
2003-06-01 02:45:53 -04:00
|
|
|
if ($profiledata->user_idmode == 'nickname')
|
2004-06-11 14:23:12 -04:00
|
|
|
echo ' selected="selected"'; ?>><?php echo $profiledata->user_nickname ?></option>
|
2003-12-31 19:55:31 -05:00
|
|
|
<option value="login"<?php
|
2003-06-01 02:45:53 -04:00
|
|
|
if ($profiledata->user_idmode=="login")
|
2004-06-11 14:23:12 -04:00
|
|
|
echo ' selected="selected"'; ?>><?php echo $profiledata->user_login ?></option>
|
2003-12-31 19:55:31 -05:00
|
|
|
<option value="firstname"<?php
|
2003-06-01 02:45:53 -04:00
|
|
|
if ($profiledata->user_idmode=="firstname")
|
2004-06-11 14:23:12 -04:00
|
|
|
echo ' selected="selected"'; ?>><?php echo $profiledata->user_firstname ?></option>
|
2003-12-31 19:55:31 -05:00
|
|
|
<option value="lastname"<?php
|
2003-06-01 02:45:53 -04:00
|
|
|
if ($profiledata->user_idmode=="lastname")
|
2004-06-11 14:23:12 -04:00
|
|
|
echo ' selected="selected"'; ?>><?php echo $profiledata->user_lastname ?></option>
|
2003-12-31 19:55:31 -05:00
|
|
|
<option value="namefl"<?php
|
2003-06-01 02:45:53 -04:00
|
|
|
if ($profiledata->user_idmode=="namefl")
|
2004-06-11 14:23:12 -04:00
|
|
|
echo ' selected="selected"'; ?>><?php echo $profiledata->user_firstname." ".$profiledata->user_lastname ?></option>
|
2003-12-31 19:55:31 -05:00
|
|
|
<option value="namelf"<?php
|
2003-06-01 02:45:53 -04:00
|
|
|
if ($profiledata->user_idmode=="namelf")
|
2004-06-11 14:23:12 -04:00
|
|
|
echo ' selected="selected"'; ?>><?php echo $profiledata->user_lastname." ".$profiledata->user_firstname ?></option>
|
2003-12-31 19:55:31 -05:00
|
|
|
</select> </td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2004-04-24 21:25:41 -04:00
|
|
|
<th scope="row"><?php _e('New <strong>Password</strong> (Leave blank to stay the same.)') ?></th>
|
2003-12-31 19:55:31 -05:00
|
|
|
<td><input type="password" name="pass1" size="16" value="" />
|
2004-06-11 14:23:12 -04:00
|
|
|
<br />
|
2003-12-31 19:55:31 -05:00
|
|
|
<input type="password" name="pass2" size="16" value="" /></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2004-04-15 05:15:56 -04:00
|
|
|
<p class="submit">
|
2004-05-07 21:15:03 -04:00
|
|
|
<input type="submit" value="<?php _e('Update Profile »') ?>" name="submit" />
|
2004-04-15 05:15:56 -04:00
|
|
|
</p>
|
2004-02-01 06:03:43 -05:00
|
|
|
</form>
|
2003-12-31 19:55:31 -05:00
|
|
|
</div>
|
2004-06-11 14:23:12 -04:00
|
|
|
|
|
|
|
|
2004-02-01 06:03:43 -05:00
|
|
|
<?php if ($is_gecko && $profiledata->user_level != 0) { ?>
|
2003-12-31 19:55:31 -05:00
|
|
|
<div class="wrap">
|
2004-08-01 04:04:39 -04:00
|
|
|
<script type="text/javascript">
|
2004-06-11 14:23:12 -04:00
|
|
|
//<![CDATA[
|
2003-05-22 08:12:53 -04:00
|
|
|
function addPanel()
|
|
|
|
{
|
|
|
|
if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function"))
|
2004-03-01 01:13:32 -05:00
|
|
|
window.sidebar.addPanel("WordPress Post: <?php echo get_settings('blogname'); ?>","<?php echo get_settings('siteurl'); ?>/wp-admin/sidebar.php","");
|
2003-05-22 08:12:53 -04:00
|
|
|
else
|
2004-04-24 21:25:41 -04:00
|
|
|
alert(<?php __("'No Sidebar found! You must use Mozilla 0.9.4 or later!'") ?>);
|
2003-05-22 08:12:53 -04:00
|
|
|
}
|
2004-06-11 14:23:12 -04:00
|
|
|
//]]>
|
2003-05-22 08:12:53 -04:00
|
|
|
</script>
|
2004-05-23 13:24:38 -04:00
|
|
|
<strong><?php _e('SideBar') ?></strong><br />
|
|
|
|
<?php _e('Add the <a href="#" onClick="addPanel()">WordPress Sidebar</a>!') ?>
|
2003-06-01 02:45:53 -04:00
|
|
|
<?php } elseif (($is_winIE) || ($is_macIE)) { ?>
|
2004-05-23 13:24:38 -04:00
|
|
|
<strong><?php _e('SideBar') ?></strong><br />
|
|
|
|
<?php __('Add this link to your favorites:') ?><br />
|
|
|
|
<a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(_search=open('<?php echo get_settings('siteurl');
|
|
|
|
?>/wp-admin/sidebar.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'_search'))"><?php _e('WordPress Sidebar') ?></a>.
|
2003-12-31 19:55:31 -05:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
2004-06-11 14:23:12 -04:00
|
|
|
</div>
|
2003-05-22 08:12:53 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* </Profile | My Profile> */
|
2004-02-09 04:56:57 -05:00
|
|
|
include('admin-footer.php');
|
2004-04-24 21:25:41 -04:00
|
|
|
?>
|