Esempio n. 1
0
        $userIsAdmin = true;
    }
    if (!$userIsAdmin && $username != $currentValidatedUser) {
        continue;
    }
    $usersDataRows .= '<tr>' . '<td><input type="text" placeholder="Username" value="' . $username . '" class="form-control" id="user-username-' . $uuid . '" ' . ($usersDataRowsIsFirst ? 'disabled' : '') . ' /></td>' . '<td><input type="password" placeholder="Password" value="' . $md5Password . '" class="form-control" id="user-password-' . $uuid . '" /></td>' . '<td><div class="btn-toolbar">' . '<button class="btn btn-success" onclick="savePanelUser(\'' . $uuid . '\', \'' . $username . '\', \'' . $md5Password . '\')"><span class="fa fa-save"></span></button>' . '<button class="btn btn-danger" onclick="deletePanelUser(\'' . $username . '\')" ' . ($usersDataRowsIsFirst ? 'disabled' : '') . '><span class="fa fa-trash"></span></button>' . '</div></td>' . '</tr>';
    $usersDataRowsIsFirst = !$usersDataRowsIsFirst;
}
?>
<div class="app-part">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">
        Panel Users
        <?php 
echo $templates->toggleFavoriteButton();
?>
        <button class="btn btn-default btn-sm" onclick="openPart('extras/panel-settings.php')">Back to Panel Settings</button>
      </h3>
    </div>
    <div class="panel-body">
      <div class="row">
        <div class="col-sm-8">
          <?php 
echo $templates->dataTable('Panel Users', ['Username', 'Password', 'Save'], $usersDataRows, true);
?>
          <?php 
echo $userIsAdmin ? '<div class="btn-toolbar"><button class="btn btn-default" onclick="addPanelUser()">Add User</button></div>' : '';
?>
          <div class="spacer"></div>
        </div>