PHP_SMART_HOME_V3/app/controls/setting.php

18 lines
647 B
PHP
Raw Normal View History

2019-10-13 10:29:07 +00:00
<?php
if (isset($_POST) && !empty($_POST)){
if (isset($_POST['submitPasswordChange']) && $_POST['submitPasswordChange'] != "") {
$oldPassword = $_POST['oldPassword'];
$newPassword = $_POST['newPassword1'];
$newPassword2 = $_POST['newPassword2'];
UserManager::changePassword($oldPassword, $newPassword, $newPassword2);
2019-10-13 12:00:41 +00:00
header('Location: ' . BASEDIR . 'logout');
die();
} else if (isset($_POST['submitCreateUser']) && $_POST['submitCreateUser'] != "") {
$userName = $_POST['userName'];
$password = $_POST['userPassword'];
UserManager::createUser($userName, $password);
header('Location: ' . BASEDIR . 'setting');
die();
2019-10-13 10:29:07 +00:00
}
}