File "admin-users-be-edit.inc.php"

Full Path: /srv/www/www.cadoro.it/src/controllers/admin-users-be-edit.inc.php
File size: 783 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
  $user = models\UserBE::get_by_id($user_id);
  if (!$user) {
    not_found();
  }

  $status = null;

  if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $params = array(
      "company" => _post('company'),
      "lastname" => _post('lastname'),
      "firstname" => _post('firstname'),
      "email" => _post('email'),
      "password" => _post('password'),
      "role" => _post('role'),
      "roles" => _post('roles'),
      "store" => _post('store'),
    );
    $user->update($params);
    $status = 1;
  }

  $smarty->assign("user", $user);
  $smarty->assign("status", $status);
  $smarty->assign("stores", models\Store::get_vocabulary());

  $smarty->assign("menu", "users");
  $smarty->assign("submenu", "users-be");

  $smarty->display("admin-users-be-edit.tmpl");
?>