Beispiel #1
0
                        Authentication::logoutUser();
                    }
                } else {
                    $notifications[] = MakeNotification("error", Language::Get('main', 'differentPasswords', $langTemplate));
                }
            } else {
                $notifications[] = MakeNotification("error", Language::Get('main', 'incorrectOldPassword', $langTemplate));
            }
        } else {
            $notifications = $notifications + $f->notifications;
        }
    } else {
        if ($_POST['action'] == "SetAccountInfo") {
            $f = new FormEvaluator($_POST);
            $f->checkStringForKey('language', FormEvaluator::OPTIONAL, 'warning', '???.');
            if ($f->evaluate(true)) {
                $foundValues = $f->foundValues;
                $language = $foundValues['language'];
                $newUserSettings = User::encodeUser(User::createUser($uid, null, null, null, null, null, null, null, null, null, null, null, null, null, $language));
                $URI = $databaseURI . "/user/" . $uid;
                http_put_data($URI, $newUserSettings, true, $message);
                if ($message == "201") {
                    $notifications[] = MakeNotification("success", Language::Get('main', 'languageChanged', $langTemplate));
                }
            } else {
                $notifications = $notifications + $f->notifications;
            }
        }
    }
}
// load user data from the database