forked from PHPFusion/PHPFusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
edit_profile.php
executable file
·66 lines (58 loc) · 2.64 KB
/
edit_profile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) PHP-Fusion Inc
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: edit_profile.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "maincore.php";
require_once THEMES."templates/header.php";
include LOCALE.LOCALESET."user_fields.php";
if (!iMEMBER) { redirect("index.php"); }
$_GET['profiles'] = isset($_GET['profiles']) && isnum($_GET['profiles']) ? $_GET['profiles'] : 1;
add_to_title($locale['global_200'].$locale['u102']);
$errors = array();
$_GET['profiles'] = isset($_GET['profiles']) && isnum($_GET['profiles']) ? $_GET['profiles'] : 1;
if (isset($_POST['update_profile'])) {
$userInput = new PHPFusion\UserFieldsInput();
$userInput->setUserNameChange(fusion_get_settings('userNameChange')); // accept or not username change.
$userInput->verifyNewEmail = TRUE;
$userInput->userData = $userdata;
$userInput->saveUpdate();
if (!defined('FUSION_NULL')) redirect(FUSION_SELF);
}
elseif (isset($_GET['code']) && fusion_get_settings('email_verification') == 1) {
$userInput = new PHPFusion\UserFieldsInput();
$userInput->verifyCode($_GET['code']);
redirect(BASEDIR.'edit_profile.php');
}
opentable($locale['u102']);
if (fusion_get_settings('email_verification') == 1) {
$result = dbquery("SELECT user_email FROM ".DB_EMAIL_VERIFY." WHERE user_id='".$userdata['user_id']."'");
if (dbrows($result)) {
$data = dbarray($result);
echo "<div class='tbl2' style='text-align:center; width:500px; margin: 5px auto 10px auto;'>".sprintf($locale['u200'], $data['user_email'])."\n<br />\n".$locale['u201']."\n</div>\n";
}
}
$userFields = new PHPFusion\UserFields();
$userFields->postName = "update_profile";
$userFields->postValue = $locale['u105'];
$userFields->userData = $userdata;
$userFields->plugin_folder = INCLUDES."user_fields/";
$userFields->plugin_locale_folder = LOCALE.LOCALESET."user_fields/";
$userFields->setUserNameChange($settings['userNameChange']);
$userFields->registration = FALSE;
$userFields->method = 'input';
$userFields->render_profile_input();
closetable();
require_once THEMES."templates/footer.php";