12345678910111213141516171819202122 |
- <?php
- class EditUserAction implements IAction {
- public function execute() {
- if(!Authorize::isLoggedIn() || !Authorize::hasPermission()) {
- return array("error" => "Access not authorized");
- }
- $username = $_POST['username'];
- $displayName = $_POST['display_name'];
- $password = $_POST['password'];
-
- //TODO: scrub inputs
- $passwordHash = hash("sha256", $password);
-
- $sql = "UPDATE users set username = :username, password = :passwordhash, display_name = :display_name;"
-
- throw new NotImplementedException();
- //TODO: write record
- //$this->database->exec($sql);
- }
- }
|