summaryrefslogtreecommitdiff
path: root/includes/pages/user_settings.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-01-21 13:58:53 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-21 13:58:53 +0100
commit9a3ad8883403949a59e8935497a548ec536f1d40 (patch)
treed3c27912c925e53bc240640ccc1133d8f87f1fd3 /includes/pages/user_settings.php
parentf7c09cb7ff84db1004a4fa83a70735475702023f (diff)
Changed from mysqli to PDO, some refactorings, faster sql queries
Diffstat (limited to 'includes/pages/user_settings.php')
-rw-r--r--includes/pages/user_settings.php28
1 files changed, 20 insertions, 8 deletions
diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php
index b848ff5f..5d4ba368 100644
--- a/includes/pages/user_settings.php
+++ b/includes/pages/user_settings.php
@@ -1,5 +1,7 @@
<?php
+use Engelsystem\Database\DB;
+
/**
* @return string
*/
@@ -131,11 +133,16 @@ function user_settings_theme($user_source, $themes)
}
if ($valid) {
- sql_query("
+ DB::update('
UPDATE `User`
- SET `color`='" . sql_escape($user_source['color']) . "'
- WHERE `UID`='" . sql_escape($user_source['UID']) . "'
- ");
+ SET `color`=?
+ WHERE `UID`=?
+ ',
+ [
+ $user_source['color'],
+ $user_source['UID'],
+ ]
+ );
success(_('Theme changed.'));
redirect(page_link_to('user_settings'));
@@ -162,11 +169,16 @@ function user_settings_locale($user_source, $locales)
}
if ($valid) {
- sql_query("
+ DB::update('
UPDATE `User`
- SET `Sprache`='" . sql_escape($user_source['Sprache']) . "'
- WHERE `UID`='" . sql_escape($user_source['UID']) . "'
- ");
+ SET `Sprache`=?
+ WHERE `UID`=?
+ ',
+ [
+ $user_source['Sprache'],
+ $user_source['UID'],
+ ]
+ );
$_SESSION['locale'] = $user_source['Sprache'];
success('Language changed.');