- Add videodb PHP/MySQL media collection manager (Blu-ray, DVD, CD) - Dockerfile: PHP 8.1 + Apache with GD/mysqli/exif extensions - docker-compose.yml: app on port 6761 + MySQL 8.0 with health checks - docker-entrypoint.sh: auto-generates config.inc.php from env vars, waits for MySQL, initializes DB schema idempotently - init-db.php: CLI schema installer using app's own prefix_query() logic - Persistent volumes for DB, cache, and cover images Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
70 lines
1.6 KiB
PHP
70 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* Profile page
|
|
*
|
|
* Handles saving of the various config options for the user.
|
|
*
|
|
* @package Setup
|
|
* @author Andreas Gohr <a.gohr@web.de>
|
|
* @version $Id: profile.php,v 2.19 2008/04/20 17:31:20 andig2 Exp $
|
|
*/
|
|
|
|
require_once './core/functions.php';
|
|
require_once './core/setup.core.php';
|
|
|
|
/**
|
|
* input
|
|
*/
|
|
$user_id = get_current_user_id();
|
|
$save = req_int('save');
|
|
// all other input are within `if (save) foreach {}`
|
|
|
|
// 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)
|
|
{
|
|
// insert data
|
|
foreach ($SETUP_USER as $opt)
|
|
{
|
|
$val = req_string($opt);
|
|
if ($opt == 'languageflags') {
|
|
// convert languages array back into string
|
|
$val = @join('::', req_array('languages'));
|
|
}
|
|
$SQL = "REPLACE INTO ".TBL_USERCONFIG." (user_id, opt, value)
|
|
VALUES ('" . escapeSQL($user_id) . "', '$opt', '" . escapeSQL($val) . "')";
|
|
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');
|
|
|