diff --git a/include/client/header.inc.php b/include/client/header.inc.php index 4f1c93f88433f82744d328bbe7b70e0687ad6669..107cf479c43884bf362b57f72378c40bc1a5be78 100644 --- a/include/client/header.inc.php +++ b/include/client/header.inc.php @@ -44,8 +44,9 @@ header("Content-Type: text/html; charset=UTF-8\r\n"); <p> <?php if($thisclient && is_object($thisclient) && $thisclient->isValid()) { - echo Format::htmlchars($thisclient->getName()).' - '; + echo Format::htmlchars($thisclient->getName()).' |'; ?> + <a href="<?php echo ROOT_PATH; ?>profile.php">Profile</a> | <?php if($cfg->showRelatedTickets()) {?> <a href="<?php echo ROOT_PATH; ?>tickets.php">Tickets <b>(<?php echo $thisclient->getNumTickets(); ?>)</b></a> - @@ -54,7 +55,7 @@ header("Content-Type: text/html; charset=UTF-8\r\n"); <a href="<?php echo ROOT_PATH; ?>logout.php?auth=<?php echo $ost->getLinkToken(); ?>">Log Out</a> <?php }elseif($nav){ ?> - Guest User - <a href="<?php echo ROOT_PATH; ?>login.php">Log In</a> + Guest User | <a href="<?php echo ROOT_PATH; ?>login.php">Log In</a> <?php } ?> </p> diff --git a/include/client/profile.inc.php b/include/client/profile.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..a103ba1f7ec5f00ec1ec182b520ccfb2eaa8077b --- /dev/null +++ b/include/client/profile.inc.php @@ -0,0 +1,25 @@ +<?php + +?> +<h1>Manage Your Profile Information</h1> +<p> +Use the forms below to update the information we have on file for your +account +</p> +<form action="profile.php" method="post"> + <?php csrf_token(); ?> +<table width="800"> +<?php +foreach ($user->getForms() as $f) { + $f->render(false); +} +?> +</table> +<hr> +<p style="text-align: center;"> + <input type="submit" value="Update"/> + <input type="reset" value="Reset"/> + <input type="button" value="Cancel" onclick="javascript: + window.location.href='index.php';"/> +</p> +</form> diff --git a/profile.php b/profile.php new file mode 100644 index 0000000000000000000000000000000000000000..e17bf690eb9241ff2b7bbad74efe8684bed447d2 --- /dev/null +++ b/profile.php @@ -0,0 +1,35 @@ +<?php +/********************************************************************* + profile.php + + Manage client profile. This will allow a logged-in user to manage + his/her own public (non-internal) information + + Peter Rotich <peter@osticket.com> + Jared Hancock <jared@osticket.com> + Copyright (c) 2006-2013 osTicket + http://www.osticket.com + + Released under the GNU General Public License WITHOUT ANY WARRANTY. + See LICENSE.TXT for details. + + vim: expandtab sw=4 ts=4 sts=4: + $Id: $ +**********************************************************************/ +require 'secure.inc.php'; + +require_once 'class.user.php'; +$user = User::lookup($thisclient->getId()); + +if ($user && $_POST) { + $errors = array(); + if ($user->updateInfo($_POST, $errors)) + Http::redirect('tickets.php'); +} + +$inc = 'profile.inc.php'; + +include(CLIENTINC_DIR.'header.inc.php'); +include(CLIENTINC_DIR.$inc); +include(CLIENTINC_DIR.'footer.inc.php'); +