shopping-list/php/edit-user.php

23 lines
457 B
PHP
Raw Normal View History

<?php
session_start();
include $_SESSION["docroot"].'/php/classes.user.php';
$user = new user;
2018-11-09 15:58:00 +01:00
if($_POST["function"]!="new-user"){
$user->get_info($_COOKIE["token"]);
}
switch ($_POST["function"]) {
case 'change-pw':
$user->change_password($_POST["current"], $_POST["new"]);
break;
2018-11-09 15:58:00 +01:00
case 'new-user':
$user->new($_POST["username"], $_POST["passwd"]);
break;
default:
// code...
break;
}
?>