From 8441b5ecc9ffb207c983d24e5d9916e05579b706 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 5 Sep 2016 16:59:47 -0400 Subject: [PATCH] Profile uses new UI --- admin/profile.php | 138 ++++++++++++++++++++++++---------------------- 1 file changed, 72 insertions(+), 66 deletions(-) diff --git a/admin/profile.php b/admin/profile.php index a848af8a..83570eec 100644 --- a/admin/profile.php +++ b/admin/profile.php @@ -37,6 +37,7 @@ require(HESK_PATH . 'hesk_settings.inc.php'); require(HESK_PATH . 'inc/common.inc.php'); require(HESK_PATH . 'inc/admin_functions.inc.php'); require(HESK_PATH . 'inc/profile_functions.inc.php'); +require(HESK_PATH . 'inc/mail_functions.inc.php'); hesk_load_database_functions(); hesk_session_start(); @@ -84,75 +85,80 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php'); /* Print admin navigation */ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); ?> - -
-
- - -

' . $_SESSION['new']['user']; ?>

-
*
- -
- - '; - $str .= ''; - $str .= '
'; - $str .= ''; - - if (!isset($_GET)) { - $_GET = array(); - } - - foreach ($_GET as $k => $v) { - if ($k == 'language' || $k == 'save_language') { - continue; - } - $str .= ''; - } - - $str .= '
'; - $str .= '
' - - ?> - - +
+
+
+

+ +

+
+ +
+
+
+ * + /* This will handle error, success and notice messages */ + hesk_handle_messages(); -
- -
+ if (defined('WARN_PASSWORD')) { + hesk_show_notice($hesklang['chdp2'], $hesklang['security']); + } + + if ($hesk_settings['can_sel_lang']) { + /* Update preferred language in the database? */ + if (isset($_GET['save_language'])) { + $newlang = hesk_input(hesk_GET('language')); + + /* Only update if it's a valid language */ + if (isset($hesk_settings['languages'][$newlang])) { + $newlang = ($newlang == HESK_DEFAULT_LANGUAGE) ? "NULL" : "'" . hesk_dbEscape($newlang) . "'"; + hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `language`=$newlang WHERE `id`='" . intval($_SESSION['id']) . "' LIMIT 1"); + } + } + + $str = '
'; + $str .= ''; + $str .= '
'; + $str .= ''; + + if (!isset($_GET)) { + $_GET = array(); + } + + foreach ($_GET as $k => $v) { + if ($k == 'language' || $k == 'save_language') { + continue; + } + $str .= ''; + } + + $str .= '
'; + $str .= '
' + + ?> + +
+ + +
+ +
+
-
+