Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 347 lines (299 sloc) 13.822 kb
4775e82 # more line-ending properties
ts77 authored
1 <?php
b7eee56 # Added copyright notices to Phorum files
mmakaay authored
2
4775e82 # more line-ending properties
ts77 authored
3 ////////////////////////////////////////////////////////////////////////////////
4 // //
253986c # Updated copyright notices to 2007
mmakaay authored
5 // Copyright (C) 2007 Phorum Development Team //
4775e82 # more line-ending properties
ts77 authored
6 // http://www.phorum.org //
7 // //
8 // This program is free software. You can redistribute it and/or modify //
9 // it under the terms of either the current Phorum License (viewable at //
10 // phorum.org) or the Phorum License that was distributed with this file //
11 // //
12 // This program is distributed in the hope that it will be useful, //
13 // but WITHOUT ANY WARRANTY, without even the implied warranty of //
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. //
15 // //
16 // You should have received a copy of the Phorum License //
17 // along with this program. //
18 ////////////////////////////////////////////////////////////////////////////////
19 define('phorum_page','control');
20
d8069c2 # Use require_once() for all includes. I prefer require based includes,
mmakaay authored
21 require_once("./common.php");
4775e82 # more line-ending properties
ts77 authored
22
23 phorum_require_login();
24
d8069c2 # Use require_once() for all includes. I prefer require based includes,
mmakaay authored
25 require_once("./include/email_functions.php");
26 require_once("./include/format_functions.php");
18b5987 # New user API code + core changes to work with the user API.
mmakaay authored
27
4775e82 # more line-ending properties
ts77 authored
28 define("PHORUM_CONTROL_CENTER", 1);
29
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
30 // A user has to be logged in to use his control-center.
4775e82 # more line-ending properties
ts77 authored
31 if (!$PHORUM["DATA"]["LOGGEDIN"]) {
32 phorum_redirect_by_url(phorum_get_url(PHORUM_LIST_URL));
33 exit();
34 }
35
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
36 // If the user is not fully logged in, send him to the login page.
ba5300d New security feature! Users must confirm their login before posting or ...
brian authored
37 if(!$PHORUM["DATA"]["FULLY_LOGGEDIN"]){
38 phorum_redirect_by_url(phorum_get_url(PHORUM_LOGIN_URL, "redir=".PHORUM_CONTROLCENTER_URL));
39 exit();
40 }
41
4775e82 # more line-ending properties
ts77 authored
42 $error_msg = false;
b0b0faa MFB: Fixed possible XSS issues, exploitable with register_globals = on; ...
ts77 authored
43 $error = "";
44 $okmsg = "";
da9b6ea MFB: initializing and checking template-var
mmakaay authored
45 $template = "";
4775e82 # more line-ending properties
ts77 authored
46
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
47 // Generating the panel id of the page to use.
65a9dd1 # change urls in template to new standard. fixed pm read style. other m...
brian authored
48 if(isset($PHORUM['args']['panel'])){
49 $panel = $PHORUM['args']['panel'];
4775e82 # more line-ending properties
ts77 authored
50
65a9dd1 # change urls in template to new standard. fixed pm read style. other m...
brian authored
51 } elseif(isset($_POST["panel"])){
52 $panel = $_POST["panel"];
53
54 } else {
55 $panel = PHORUM_CC_SUMMARY;
4775e82 # more line-ending properties
ts77 authored
56 }
57
65a9dd1 # change urls in template to new standard. fixed pm read style. other m...
brian authored
58
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
59 // Set all our URLs.
4775e82 # more line-ending properties
ts77 authored
60 phorum_build_common_urls();
61
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
62 // Generate the control panel URLs.
4775e82 # more line-ending properties
ts77 authored
63 $PHORUM['DATA']['URL']['CC0'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_SUMMARY);
64 $PHORUM['DATA']['URL']['CC1'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_SUBSCRIPTION_THREADS);
65 $PHORUM['DATA']['URL']['CC2'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_SUBSCRIPTION_FORUMS);
66 $PHORUM['DATA']['URL']['CC3'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_USERINFO);
67 $PHORUM['DATA']['URL']['CC4'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_SIGNATURE);
68 $PHORUM['DATA']['URL']['CC5'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_MAIL);
69 $PHORUM['DATA']['URL']['CC6'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_BOARD);
70 $PHORUM['DATA']['URL']['CC7'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_PASSWORD);
71 $PHORUM['DATA']['URL']['CC8'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_UNAPPROVED);
72 $PHORUM['DATA']['URL']['CC9'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_FILES);
73 $PHORUM['DATA']['URL']['CC10'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_USERS);
74 $PHORUM['DATA']['URL']['CC14'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_PRIVACY);
75 $PHORUM['DATA']['URL']['CC15'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_GROUP_MODERATION);
76 $PHORUM['DATA']['URL']['CC16'] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_GROUP_MEMBERSHIP);
77
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
78 // Determine if the user files functionality is available.
79 $PHORUM["DATA"]["MYFILES"] = ($PHORUM["file_uploads"] || $PHORUM["user"]["admin"]);
4775e82 # more line-ending properties
ts77 authored
80
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
81 // Determine if the user is a moderator.
a9bcad7 # Phased out phorum_user_allow_moderate_group() in favor of the new
mmakaay authored
82 $PHORUM["DATA"]["MESSAGE_MODERATOR"] = phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_MESSAGES, PHORUM_ACCESS_ANY);
83 $PHORUM["DATA"]["USER_MODERATOR"] = phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_USERS, PHORUM_ACCESS_ANY);
6d21c13 # Implemented phorum_api_user_check_group_access(), which replaces
mmakaay authored
84 $PHORUM["DATA"]["GROUP_MODERATOR"] = phorum_api_user_check_group_access(PHORUM_USER_GROUP_MODERATOR, PHORUM_ACCESS_ANY);
4775e82 # more line-ending properties
ts77 authored
85 $PHORUM["DATA"]["MODERATOR"] = ($PHORUM["DATA"]["USER_MODERATOR"] + $PHORUM["DATA"]["MESSAGE_MODERATOR"] + $PHORUM["DATA"]["GROUP_MODERATOR"]) > 0;
86
6889943 # Implemented option "allow_pm_email_notify" and added in-program
mmakaay authored
87 // If global email hiding is not enabled, then give the user a chance
88 // to choose for hiding himself.
89 $PHORUM['DATA']['SHOW_EMAIL_HIDE'] = empty($PHORUM['hide_email_addr']) ? 1 : 0;
90
91 // If pm email notifications are enabled, then give the user a chance
92 // to disable it.
93 $PHORUM['DATA']['SHOW_PM_EMAIL_NOTIFY'] = !empty($PHORUM["allow_pm_email_notify"]);
c2a9997 added global option to hide email-addresses (#559)
ts77 authored
94
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
95 // The form action for the common form.
96 $PHORUM["DATA"]["URL"]["ACTION"] = phorum_get_url(PHORUM_CONTROLCENTER_ACTION_URL);
4775e82 # more line-ending properties
ts77 authored
97
31fde34 MFB: breadcrumbs in template are now generated from the forum-path store...
ts77 authored
98 // fill the breadcrumbs-info
417d8dc # Some additions to the breadcrumb generation code and the root node
mmakaay authored
99 $PHORUM['DATA']['BREADCRUMBS'][]=array(
100 'URL'=>$PHORUM['DATA']['URL']['REGISTERPROFILE'],
101 'TEXT'=>$PHORUM['DATA']['LANG']['MyProfile'],
102 'TYPE'=>'control'
103 );
31fde34 MFB: breadcrumbs in template are now generated from the forum-path store...
ts77 authored
104
4775e82 # more line-ending properties
ts77 authored
105 $user = $PHORUM['user'];
106
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
107 // Security messures.
4775e82 # more line-ending properties
ts77 authored
108 unset($user["password"]);
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
109 unset($user["password_temp"]);
4775e82 # more line-ending properties
ts77 authored
110 unset($user["permissions"]);
111
8a68ecc made two different variables for signature in control panel. one for for...
ts77 authored
112 // Fake a message here so we can run the sig through format_message.
113 $fake_messages = array(array("author"=>"", "email"=>"", "subject"=>"", "body"=>$user["signature"]));
114 $fake_messages = phorum_format_messages( $fake_messages );
115 $user["signature_formatted"] = $fake_messages[0]["body"];
6e867ab MFB: User's signatures were not being escaped.
brian authored
116
67fbecc # Prevent duplicate escaping of the signature in the control panel.
mmakaay authored
117 // Format the user signature using standard message body formatting
118 // or HTML escape it
119 $user["signature"] = htmlspecialchars($user["signature"], ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]);
120
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
121 // Initialize any custom profile fields that are not present.
4775e82 # more line-ending properties
ts77 authored
122 if (!empty($PHORUM["PROFILE_FIELDS"])) {
a6e6255 # Ignore "num_fields" from $PHORUM["PROFILE_FIELDS"] when looping over t...
mmakaay authored
123 foreach($PHORUM["PROFILE_FIELDS"] as $id => $field) {
a84aba9 # Updates for handling custom profile fields that are flagged "deleted".
mmakaay authored
124 if ($id === 'num_fields' || !empty($field['deleted'])) continue;
4775e82 # more line-ending properties
ts77 authored
125 if (!isset($user[$field['name']])) $user[$field['name']] = "";
126 }
127 }
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
128
129 // Setup template data.
4775e82 # more line-ending properties
ts77 authored
130 $PHORUM["DATA"]["PROFILE"] = $user;
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
131 $PHORUM["DATA"]["PROFILE"]["forum_id"] = isset($PHORUM["forum_id"]) ? $PHORUM['forum_id'] : 0;
132 $PHORUM["DATA"]["PROFILE"]["PANEL"] = $panel;
25d2b98 # moved a couple of hidden-fields from templates into php (#557)
ts77 authored
133 // used in nearly all or all cc-panels
134 $PHORUM['DATA']['POST_VARS'].="<input type=\"hidden\" name=\"panel\" value=\"{$panel}\" />\n";
4775e82 # more line-ending properties
ts77 authored
135
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
136 // Set the back-URL and -message.
137 if ($PHORUM['forum_id'] > 0 && $PHORUM['folder_flag'] == 0) {
4775e82 # more line-ending properties
ts77 authored
138 $PHORUM['DATA']['URL']['BACK'] = phorum_get_url(PHORUM_LIST_URL);
139 $PHORUM['DATA']['URL']['BACKTITLE'] = $PHORUM['DATA']['LANG']['BacktoForum'];
140 } else {
141 if(isset($PHORUM['forum_id'])) {
142 $PHORUM['DATA']['URL']['BACK'] = phorum_get_url(PHORUM_INDEX_URL,$PHORUM['forum_id']);
143 } else {
144 $PHORUM['DATA']['URL']['BACK'] = phorum_get_url(PHORUM_INDEX_URL);
145 }
146 $PHORUM['DATA']['URL']['BACKTITLE'] = $PHORUM['DATA']['LANG']['BackToForumList'];
147 }
148
13c8647 Implemented a new hook "cc_panel", which can be used to build extra cc p...
mmakaay authored
149 // Load the code for the current panel.
4775e82 # more line-ending properties
ts77 authored
150 $panel = basename($panel);
13c8647 Implemented a new hook "cc_panel", which can be used to build extra cc p...
mmakaay authored
151 /**
152 * [hook]
153 * cc_panel
154 *
155 * [description]
156 * This hook can be used to implement an extra control center panel
157 * or to override an existing panel if you like.
158 *
159 * [category]
160 * Control center
161 *
162 * [when]
163 * Right before loading a standard panel's include file.
164 *
165 * [input]
166 * An array containing the following fields:
167 * <ul>
168 * <li>panel:
169 * the name of the panel that has to be loaded. The module will
170 * have to check this field to see if it should handle the
1d36fea # Documentation updates.
mmakaay authored
171 * panel or not.</li>
13c8647 Implemented a new hook "cc_panel", which can be used to build extra cc p...
mmakaay authored
172 * <li>template:
173 * the name of the template that has to be loaded. This field should
1d36fea # Documentation updates.
mmakaay authored
174 * be filled by the module if it wants to load a specific
175 * template.</li>
13c8647 Implemented a new hook "cc_panel", which can be used to build extra cc p...
mmakaay authored
176 * <li>handled:
177 * if a module does handle the panel, then it can set this field
178 * to a true value, to prevent Phorum from running the standard
1d36fea # Documentation updates.
mmakaay authored
179 * panel code.</li>
13c8647 Implemented a new hook "cc_panel", which can be used to build extra cc p...
mmakaay authored
180 * <li>error:
1d36fea # Documentation updates.
mmakaay authored
181 * modules can fill this field with an error message to show.</li>
13c8647 Implemented a new hook "cc_panel", which can be used to build extra cc p...
mmakaay authored
182 * <li>okmsg:
1d36fea # Documentation updates.
mmakaay authored
183 * modules can fill this field with an ok message to show.</li>
13c8647 Implemented a new hook "cc_panel", which can be used to build extra cc p...
mmakaay authored
184 * </ul>
185 *
186 * [output]
187 * The same array as the one that was used for the hook call
188 * argument, possibly with the "template", "handled", "error" and
189 * "okmsg" fields updated in it.
190 */
191 $hook_info = array(
192 'panel' => $panel,
193 'template' => NULL,
194 'handled' => FALSE,
195 'error' => NULL,
196 'okmsg' => NULL
197 );
198 if (isset($PHORUM['hooks']['cc_panel'])) {
199 $hook_info = phorum_hook('cc_panel', $hook_info);
200 }
201
202 // Retrieve template, error and okmsg info from the module info.
203 if ($hook_info['template'] !== NULL) { $template = $hook_info['template']; }
204 if ($hook_info['okmsg'] !== NULL) { $okmsg = $hook_info['okmsg']; }
205 if ($hook_info['error'] !== NULL) { $error = $hook_info['error']; }
206
207 // If no module did handle the control center panel, then try to load
208 // a standard control center panel file.
209 if (!$hook_info['handled']) {
210 if (file_exists("./include/controlcenter/$panel.php")) {
211 include "./include/controlcenter/$panel.php";
212 } else {
213 include "./include/controlcenter/summary.php";
214 }
4775e82 # more line-ending properties
ts77 authored
215 }
216
449a669 new templates working on CC now
brian authored
217 if(empty($PHORUM["DATA"]["HEADING"])){
bc1da40 # Fixed default HEADING for control.php.
mmakaay authored
218 $PHORUM["DATA"]["HEADING"] = $PHORUM["DATA"]["LANG"]["MyProfile"];
449a669 new templates working on CC now
brian authored
219 }
220
221 // unset default description
222 $PHORUM["DATA"]["DESCRIPTION"] = "";
223
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
224 // The include file can set the template we have to use for
225 // displaying the main part of the control panel screen
226 // in the $template variable.
da9b6ea MFB: initializing and checking template-var
mmakaay authored
227 if (isset($template) && !empty($template)) {
4775e82 # more line-ending properties
ts77 authored
228 $PHORUM['DATA']['content_template'] = $template;
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
229 }
4775e82 # more line-ending properties
ts77 authored
230
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
231 // The include file can also set an error message to show
232 // in the $error variable and a success message in $okmsg.
233 if (isset($error) && !empty($error)) $PHORUM['DATA']['ERROR'] = $error;
234 if (isset($okmsg) && !empty($okmsg)) $PHORUM['DATA']['OKMSG'] = $okmsg;
4775e82 # more line-ending properties
ts77 authored
235
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
236 if ($error_msg) { // Possibly set from the panel include file.
293da1e Moved all template output to common function for control. Added new sta...
brian authored
237 $template = "message";
4775e82 # more line-ending properties
ts77 authored
238 } else {
293da1e Moved all template output to common function for control. Added new sta...
brian authored
239 $template = "cc_index";
4775e82 # more line-ending properties
ts77 authored
240 }
293da1e Moved all template output to common function for control. Added new sta...
brian authored
241
242 // Display the control panel page.
243 phorum_output($template);
4775e82 # more line-ending properties
ts77 authored
244
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
245 // ============================================================================
4775e82 # more line-ending properties
ts77 authored
246
247 /**
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
248 * A common function which is used to save the userdata from the post-data.
249 * @param panel - The panel for which to save data.
250 * @return array - An array containing $error and $okmsg.
4775e82 # more line-ending properties
ts77 authored
251 */
252 function phorum_controlcenter_user_save($panel)
253 {
254 $PHORUM = $GLOBALS['PHORUM'];
255 $error = "";
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
256 $okmsg = "";
257
e8dc690 Moved real_name from a custom profile field to a real user table field.
mmakaay authored
258 // Setup the default userdata fields that can be changed
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
259 // from the control panel interface.
260 $userdata = array(
261 'signature' => NULL,
262 'hide_email' => NULL,
263 'hide_activity' => NULL,
264 'password' => NULL,
46e5de6 Fixed password changing issue reported in chat
brian authored
265 'password_temp' => NULL,
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
266 'tz_offset' => NULL,
267 'is_dst' => NULL,
268 'user_language' => NULL,
269 'threaded_list' => NULL,
270 'threaded_read' => NULL,
271 'email_notify' => NULL,
272 'show_signature' => NULL,
273 'pm_email_notify' => NULL,
274 'email' => NULL,
275 'email_temp' => NULL,
e8d7541 MFB: # user_template could not be changed from the control center panels
mmakaay authored
276 'user_template' => NULL,
c403121 added options for moderators to avoid getting moderation-emails, impleme...
ts77 authored
277 'moderation_email'=> NULL,
e8dc690 Moved real_name from a custom profile field to a real user table field.
mmakaay authored
278 'real_name' => NULL,
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
279 );
280 // Add custom profile fields as acceptable fields.
a6e6255 # Ignore "num_fields" from $PHORUM["PROFILE_FIELDS"] when looping over t...
mmakaay authored
281 foreach ($PHORUM["PROFILE_FIELDS"] as $id => $field) {
a84aba9 # Updates for handling custom profile fields that are flagged "deleted".
mmakaay authored
282 if ($id === "num_fields" || !empty($field['deleted'])) continue;
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
283 $userdata[$field["name"]] = NULL;
284 }
285 // Update userdata with $_POST information.
286 foreach ($_POST as $key => $val) {
287 if (array_key_exists($key, $userdata)) {
288 $userdata[$key] = $val;
289 }
290 }
291 // Remove unused profile fields.
292 foreach ($userdata as $key => $val) {
293 if (is_null($val)) {
294 unset($userdata[$key]);
295 }
296 }
4775e82 # more line-ending properties
ts77 authored
297
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
298 // Set static userdata.
4775e82 # more line-ending properties
ts77 authored
299 $userdata["user_id"] = $PHORUM["user"]["user_id"];
300
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
301 // Run a hook, so module writers can update and check the userdata.
5ad1de1 Made the phorum_hook calls conditional, which should speed up execution
mmakaay authored
302 if (isset($PHORUM["hooks"]["cc_save_user"]))
303 $userdata = phorum_hook("cc_save_user", $userdata);
4775e82 # more line-ending properties
ts77 authored
304
a2e0aab Improved switching between user selected templates. The new template is ...
mmakaay authored
305 // Set $error, in case the cc_save_user hook did set an error.
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
306 if (isset($userdata['error'])) {
6e867ab MFB: User's signatures were not being escaped.
brian authored
307 $error=$userdata['error'];
308 unset($userdata['error']);
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
309 // Try to update the userdata in the database.
c9b26ea # Fully replaced phorum_user_save/phorum_user_add with the new
mmakaay authored
310 } elseif (!phorum_api_user_save($userdata)) {
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
311 // Updating the user failed.
6e867ab MFB: User's signatures were not being escaped.
brian authored
312 $error = $PHORUM["DATA"]["LANG"]["ErrUserAddUpdate"];
4775e82 # more line-ending properties
ts77 authored
313 } else {
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
314 // Updating the user was successful.
315 $okmsg = $PHORUM["DATA"]["LANG"]["ProfileUpdatedOk"];
316
317 // Let the userdata be reloaded.
18b5987 # New user API code + core changes to work with the user API.
mmakaay authored
318 phorum_api_user_set_active_user(PHORUM_FORUM_SESSION, $userdata["user_id"]);
6e867ab MFB: User's signatures were not being escaped.
brian authored
319
18b5987 # New user API code + core changes to work with the user API.
mmakaay authored
320 // If a new password was set, then reset all session id(s), so
d30c7bb # Fixing some typo errors. What a looser^H^H^H^Hser ;-)
mmakaay authored
321 // other computers or browser will lose any active session that
18b5987 # New user API code + core changes to work with the user API.
mmakaay authored
322 // they are running.
c9b26ea # Fully replaced phorum_user_save/phorum_user_add with the new
mmakaay authored
323 if (isset($userdata["password"]) && $userdata["password"] != '') {
18b5987 # New user API code + core changes to work with the user API.
mmakaay authored
324 phorum_api_user_session_create(
325 PHORUM_FORUM_SESSION,
326 PHORUM_SESSID_RESET_ALL
327 );
c403121 added options for moderators to avoid getting moderation-emails, impleme...
ts77 authored
328 }
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
329
330 // Copy data from the updated user back into the template data.
331 // Leave PANEL and forum_id alone (these are injected into the
332 // userdata in the template from this script).
333 foreach ($GLOBALS["PHORUM"]["DATA"]["PROFILE"] as $key => $val) {
334 if ($key == "PANEL" || $key == "forum_id") continue;
335 if (isset($GLOBALS["PHORUM"]["user"][$key])) {
336 $GLOBALS["PHORUM"]["DATA"]["PROFILE"][$key] = $GLOBALS["PHORUM"]["user"][$key];
337 } else {
338 $GLOBALS["PHORUM"]["DATA"]["PROFILE"][$key] = "";
6e867ab MFB: User's signatures were not being escaped.
brian authored
339 }
340 }
4775e82 # more line-ending properties
ts77 authored
341 }
342
b54edef MFB: # Reformatted and cleaned up CC code and added green okay-msg
mmakaay authored
343 return array($error, $okmsg);
4775e82 # more line-ending properties
ts77 authored
344 }
345
346 ?>
Something went wrong with that request. Please try again.