forked from andig/videodb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
64 lines (51 loc) · 1.4 KB
/
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
<?php
/**
* Profile page
*
* Handles saving of the various config options for the user.
*
* @package Setup
* @author Andreas Gohr <[email protected]>
* @version $Id: profile.php,v 2.19 2008/04/20 17:31:20 andig2 Exp $
*/
require_once './core/session.php';
require_once './core/functions.php';
require_once './core/setup.core.php';
$user_id = get_current_user_id();
// really shouldn't happen
if (empty($user_id))
{
errorpage('Access denied', 'You don\'t have enough permissions to access this '.
'page. Please <a href="login.php">login</a> first. '.
'(This feature is not available in Single User Mode)');
}
// save data
if ($save)
{
// convert languages array back into string
$languageflags = @join('::', $languages);
// insert data
foreach ($SETUP_USER as $opt)
{
$SQL = "REPLACE INTO ".TBL_USERCONFIG." (user_id, opt, value)
VALUES ('".addslashes($user_id)."', '$opt', '".addslashes($$opt)."')";
runSQL($SQL);
}
// update session variables
update_session();
// reload config
load_config(true);
/*
// clear compiled templates for new template
AG: should not be required
$smarty->clear_compiled_tpl(null, $config['cacheid']);
*/
}
// prepare options
$setup = setup_mkOptions(true);
// prepare templates
tpl_page('profile');
$smarty->assign('setup', $setup);
// display templates
tpl_display('profile.tpl');
?>