Location: PHPKode > projects > OpenSupports > support/perfil.php
<?php
session_start();
require "config.php";
$errorverify = false;
$errordentro = "";
if(!isset($_SESSION['user']))
{
header('Location: index.php');
}
if(isset($_POST['emailnuevo']))
{
if(stripos($_POST['emailnuevo'],"@") !== false && strlen($_POST['emailnuevo']) > 5)
{
//mailer
$sendTo = $_SESSION['user'];
$subject = "Support Center - " . $titulo ." - Email Changed";
$headers = "From: ";
$headers .= "<" . $mailprincipal . ">\r\n";
$headers .= "Reply-To: " . $mailprincipal; 
$message =   "You have changed your email information: \n" . $_POST['emailnuevo'] . "\n" . $url;
mail($sendTo, $subject, $message, $headers);
//modifica
$modifica=mysql_query("update usuarios set user='$_POST[emailnuevo]' where user='$_SESSION[user]'");
header('Location: close.php');
}
else
{
$errorverify = true;
$errordentro = "Email typed is not an email.";
}
}
//PASSWORD
if(isset($_POST['passnuevo']))
{
//Password verifica
if(strlen($_POST['passnuevo']) > 5 && $_POST['passnuevo'] == $_POST['rpassnuevo'])
{
$modifica= mysql_query("update usuarios set pass='$_POST[passnuevo]' where user='$_SESSION[user]'");
$sendTo = $_SESSION['user'];
$subject = "Support Center - " . $titulo ." - New Password";
$headers = "From: ";
$headers .= "<" . $mailprincipal . ">\r\n";
$headers .= "Reply-To: " . $mailprincipal; 
$message =   "You have changed your password: \n" . $_POST['passnuevo'] . "\n" . $url;
mail($sendTo, $subject, $message, $headers);
header('Location: close.php');
}
else
{
$errorverify = true;
$errordentro = "The password has less than 6 characters or it is wrong.";
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>


<title>Support Center - <?php echo $titulo; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><!-- default stylesheet -->
<link rel="stylesheet" type="text/css" media="all" href="index_files/index.css">
<style type="text/css">
<!--
body {
	background-image: url(../integration/images/bg.jpg);
	margin-top: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link rel="stylesheet" href="index_files/style.css" type="text/css">
<!-- default javascript -->
<script language="Javascript">
</script>
<script language="Javascript" src="index_files/basejs.js" type="text/javascript"></script>
<style type="text/css">
<!--
.Estilo1 {FONT-FAMILY: Verdana, Arial, Helvetica; font-size: 11px;}
.Estilo2 {color: #003366}
.Estilo3 {
	font-size: 10px;
	font-weight: bold;
}
.Estilo4 {
	color: #FF0000;
	font-weight: bold;
	font-size: 14px;
}
.Estilo20 {color: #000099}
-->
</style></head>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="780">
  <tbody>
    <tr>
      <td style="background-image: url(../integration/images/text-bg.jpg);" valign="top"><table align="center" border="0" cellpadding="0" cellspacing="0" width="750">
        <tbody>
          <tr>
            <td><table border="0" cellpadding="3" cellspacing="0" width="100%">
              <tr>
                <td width="90%" height="5" bgcolor="#ffffff"><p><img src="index_files/space.gif" height="3" width="1"></p>
                        <table width="100%" border="0" cellpadding="3" cellspacing="0" background="index_files/button-right.jpg">
                          <tbody>
                            <tr>
                              <td class="smalltext" align="left" valign="top"><b><font color="#707070"><a href="index.php" id="navlink"></a><a href="index.php">Support Center </a> <img src="login_files/blueblockarrow.gif" width="8" height="8"> <a href="perfil.php">Edit Profile </a> </font></b></td>
                            </tr>
                          </tbody>
                      </table></td>
                <td width="10%" bgcolor="#ffffff"><div align="center"><a href="close.php"><img src="lock.jpg" width="43" height="42"><span class="Estilo3">Close Session </span></a><span class="Estilo3"> </span></div></td>
              </tr>
              <tbody>
              </tbody>
            </table></td>
          </tr>
          <tr>
            <td><table border="0" cellpadding="0" cellspacing="0" width="100%">
              <tbody>
                <tr>
                  <td height="1" width="10"><img src="index_files/space.gif" height="1" width="5"></td>
                  <td height="1" width="222"><img src="index_files/space.gif" height="1" width="1"></td>
                  <td height="1" width="10"><img src="index_files/space.gif" height="1" width="5"></td>
                  <td height="1" width="503"><img src="index_files/space.gif" height="1" width="210"></td>
                  <td height="1" width="5"><img src="index_files/space.gif" height="1" width="5"></td>
                </tr>
                <tr>
                  <td height="" width="10">&nbsp;</td>
                  <td align="left" valign="top" width="222"><table class="tborder" border="0" cellpadding="0" cellspacing="0" width="100%">
                    <!-- BEGIN LOGIN BOX -->
                    <tbody>
                      <tr class="tcat">
                        <td align="left" width="1"><img src="index_files/space.gif" height="21" width="1"></td>
                        <td align="left" width="8"><img src="index_files/blockarrow.gif" height="8" width="8"></td>
                        <td width="146" align="left" valign="middle">&nbsp;<span class="smalltext">Welcome:<?php echo $_SESSION['user']; ?></span></td>
                        <td align="right" width="70">&nbsp;</td>
                      </tr>
                      <tr>
                        <td colspan="4" bgcolor="#f5f5f5"><form name="loginform" action="login.php" method="post">
                            <table border="0" cellpadding="2" cellspacing="1" width="100%">
                              <tbody>
                                <tr>
                                  <td class="smalltext" width="67%"><a href="perfil.php" class="Estilo2"><img src="edit.gif" width="16" height="16"> Edit Profile</a></td>
                                  <td width="33%">&nbsp;</td>
                                </tr>
                                <tr>
                                  <td class="smalltext"><a href="new.php"><img src="plus.gif" width="16" height="16"> Send Ticket </a></td>
                                  <td>&nbsp;</td>
                                </tr>
                                <tr>
                                  <td class="smalltext"><a href="login.php"><img src="document.gif" width="16" height="16"> Submitted Tickets </a><a href="new.php"></a></td>
                                  <td>&nbsp;</td>
                                </tr>
                                <tr>
                                  <td class="smalltext"><a href="guias.php"><img src="info.gif" width="16" height="16"> Guides and Docs </a></td>
                                  <td>&nbsp;</td>
                                </tr>
                              </tbody>
                            </table>
                        </form>
                            <script language="Javascript">
						document.loginform.loginemail.focus();
						  </script></td>
                      </tr>
                      <!-- END LOGIN BOX -->
                      <tr class="borderrow1">
                        <td colspan="4" align="left" height="1"><img src="index_files/space.gif" height="1" width="1"></td>
                      </tr>
                      <tr>
                        <td height="22" colspan="4" bgcolor="#f5f5f5"><form name="search" action="busqueda.php" method="post">
                        </form></td>
                      </tr>
                    </tbody>
                  </table></td>
                  <td width="10"><img src="index_files/space.gif" height="1" width="5"></td>
                  <td align="left" valign="top"><table width="100%" height="298" border="0" cellpadding="0" cellspacing="0">
                    <tbody>
                      <tr>
                        <td align="left" valign="top"><table class="sectiontitlebg" border="0" cellpadding="2" cellspacing="0" width="100%">
                          <tbody>
                            <tr>
                              <td width="1"><img src="login_files/blueblockarrow.gif"></td>
                              <td><strong><font color="#666666"> Edit Profile </font></strong></td>
                            </tr>
                          </tbody>
                        </table>
                                  <table border="0" cellpadding="2" cellspacing="0" width="100%">
                                    <tbody>
                                      <tr>
                                        <td colspan="2"><font color="#666666">Here you can edit your profile </font></td>
                                      </tr>
                                      <tr>
                                        <td colspan="2"><table border="0" cellpadding="0" cellspacing="0" width="100%">
                                          <tbody>
                                            <tr>
                                              <td align="left" valign="top"><br>
                                              </td>
                                              <td width="5"></td>
                                            </tr>
                                          </tbody>
                                        </table>
                                          <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tbody>
                                              <tr>
                                                <td align="left" valign="top"><form name="modifica" method="post" action="perfil.php">
                                                    <fieldset>
                                                    <legend>Email</legend>
                                                      <table border="0" cellpadding="2" cellspacing="1" width="100%">
                                                      <tbody>
                                                        <tr>
                                                          <td align="left" valign="top" width="30%">Email:</td>
                                                          <td width="70%">
                                                          <input type="text" name="emailnuevo" value="<?php echo $_SESSION[user]; ?>"> 
                                                          * It will be send to your old email. </td>
                                                        </tr>
                                                        <tr>
                                                          <td align="left" valign="top" width="30%">&nbsp;</td>
                                                          <td width="70%"><input type="submit" name="Submit" value="Modify">
                                                            *It will close the session </td>
                                                        </tr>
                                                      </tbody>
                                                      </table>
                                                  </fieldset>
                                                </form></td>
                                              </tr>
                                            </tbody>
                                        </table></td>
                                      </tr>
                                    </tbody>
                                  </table>
                                  <table border="0" cellpadding="2" cellspacing="0" width="100%">
                                    <tbody>
                                      <tr>
                                        <td colspan="2"><span class="Estilo1"><font color="#666666">Aqui podrás editar tu contraseña. </font></span></td>
                                      </tr>
                                      <tr>
                                        <td colspan="2"><table border="0" cellpadding="0" cellspacing="0" width="100%">
                                            <tbody>
                                              <tr>
                                                <td align="left" valign="top"><br>
                                                </td>
                                                <td width="5"></td>
                                              </tr>
                                            </tbody>
                                          </table>
                                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                              <tbody>
                                                <tr>
                                                  <td align="left" valign="top"><form name="modifica2" method="post" action="perfil.php">
                                                      <fieldset>
                                                      <legend>Contraseña</legend>
                                                        <table border="0" cellpadding="2" cellspacing="1" width="100%">
                                                        <tbody>
                                                          <tr>
                                                            <td align="left" valign="top">New Password  : </td>
                                                            <td><input name="passnuevo" type="password" id="passnuevo" value="">
                                                              *6 characters minimum </td>
                                                          </tr>

                                                          <tr>
                                                            <td width="30%" align="left" valign="top"><p>Rewrite new Password: </p>
                                                            </td>
                                                            <td width="70%"><input name="rpassnuevo" type="password" id="rpassnuevo" value=""></td>
                                                          </tr>
                                                          <tr>
                                                            <td align="left" valign="top">&nbsp;</td>
                                                            <td>* We will send you an email with this change </td>
                                                          </tr>
                                                          <tr>
                                                            <td align="left" valign="top">&nbsp;</td>
                                                            <td><input type="submit" name="Submit2" value="Modify">
*It will close the session.</td>
                                                          </tr>
                                                        </tbody>
                                                      </table>
                                                    </fieldset>
                                                  </form></td>
                                                </tr>
                                              </tbody>
                                          </table></td>
                                      </tr>
                                    </tbody>
                                  </table>
                              <p><?php if($errorverify == true) 
							  {?>
                                <span class="Estilo4">Error: </span>
                                <?php echo $errordentro;
								}?>
                              </p></td>
                        <td width="5"><img src="index_files/space.gif" height="1" width="5"></td>
                      </tr>
                    </tbody>
                  </table></td>
                  <td height="1" width="5"><img src="index_files/space.gif" height="1" width="5"></td>
                </tr>
              </tbody>
            </table></td>
          </tr>
          <tr>
            <td colspan="2" height="15"><!-- // You can not remove or edit the following copyrights, doing so will void the license and any rights you have to use this script // -->
			<div align="center">Power by <a href="http://www.opensupports.com" class="Estilo20">OpenSupports</a> © 2009 - <?php echo date("Y"); ?>. All Rights reserved </div>
			<!-- //
			Ends Copyrights //--></td
              >
          </tr>
        </tbody>
      </table></td>
    </tr>
  </tbody>
</table>
<center>
  <table border="0" cellpadding="0" cellspacing="0" width="830">
  </table>
</center></body></html>
Return current item: OpenSupports