Location: PHPKode > projects > PHP MicroBlog Free > admin/my_account.php
<?php

// *** Make sure the file isn't accessed directly
if(!preg_match("/index.php/i", $_SERVER['SCRIPT_FILENAME'])){
	//Give out an "access denied" error
	echo "access denied";
	//Block all other code
	exit();
}


if (@$login->is_logged_in_as("mainadmin")) {
	
	$account = new Admins($GLOBALS['user_session']->get_session_variable("session_account_id"));
	$sub_type = isset($_POST['sub_type']) ? $_POST['sub_type']: "";

	// CHANGE PASSWORD
	if ($sub_type == "password") {
		$account->change_password($_POST['password_one'],$_POST['password_two']);
	}else if ($sub_type == "about_me") {
		$account->save_about_me($_POST['about_me'],$_POST['about_me']);
	}
	
	$account->getInfo();

	// Output Personal Information
	draw_title_bar("Personal Information");
	?>
	<table width="100%" border="0" cellspacing="0" cellpadding="2" class="main_text">
	<tr>
		<td width="150px">&nbsp;Name:</td>
		<td><?php echo $account->account_name;?></td>
	</tr>
	<tr><td>&nbsp;</td></tr>
	</table>	

	<?php
	draw_title_bar("Change your Password");
	?>
	<form action="index.php?admin=my_account" method="post">
	<input type="hidden" name="sub_type" value="password" />
	<table width="100%" border="0" cellspacing="0" cellpadding="2" class="main_text">
		<tr>
			<td width="150px">* Password</td>
			<td><input class="form_text" name="password_one" type="password" size="15" maxlength="15"></td>
		</tr>
		<tr>
			<td>* Retype Password</td>
			<td><input class="form_text" name="password_two" type="password" size="15" maxlength="15"></td>
		</tr>
		<tr><td colspan="2">&nbsp;</td>
		<tr>
			<td style="padding-left: 0px;" colspan="2"><input class="form_button" type="submit" name="submit" value="<?php echo BUTTON_CHANGE_PASSWORD ?>"></td>
		</tr>
	</table>
	</form>

	<?php
	draw_title_bar("About Me");
	?>
	<form action="index.php?admin=my_account" method="post">
	<input type="hidden" name="sub_type" value="about_me" />
	<table width="100%" border="0" cellspacing="0" cellpadding="2" class="main_text">
		<tr>
			<td>* Text</td>
			<td><textarea class="form_text" name="about_me" rows="5" cols="45"><?php echo $account->about_me;?></textarea></td>
		</tr>
		<tr><td colspan="2">&nbsp;</td>
		<tr>
			<td style="padding-left: 0px;" colspan="2"><input class="form_button" type="submit" name="submit" value="<?php echo BUTTON_SAVE_CHANGES; ?>"></td>
		</tr>
	</table>
	</form>

<?php
} else draw_important_message(NOT_AUTHORIZED);
?>
Return current item: PHP MicroBlog Free