EditUserAction.class.php 591 B

12345678910111213141516171819202122
  1. <?php
  2. class EditUserAction implements IAction {
  3. public function execute() {
  4. if(!Authorize::isLoggedIn() || !Authorize::hasPermission()) {
  5. return array("error" => "Access not authorized");
  6. }
  7. $username = $_POST['username'];
  8. $displayName = $_POST['display_name'];
  9. $password = $_POST['password'];
  10. //TODO: scrub inputs
  11. $passwordHash = hash("sha256", $password);
  12. $sql = "UPDATE users set username = :username, password = :passwordhash, display_name = :display_name;"
  13. throw new NotImplementedException();
  14. //TODO: write record
  15. //$this->database->exec($sql);
  16. }
  17. }