Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/controllers/LastWordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct($argv = [], IDataProvider $DB = null, View $View = n
parent::__construct($argv, $DB, $View);

$path = str_replace(SITE, '', dirname(__DIR__));
$this->View->_link('stylesheet', 'text/css', $path.'/css/lastword.css');
// $this->View->_link('stylesheet', 'text/css', $path.'/css/lastword.css');
$this->View->_script($path.'/js/lastword.js');
$this->View->_script($path.'/js/sha1.js');
$this->View->_script($path.'/js/ajas.js');
Expand Down
96 changes: 61 additions & 35 deletions src/templates/LW.Add.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,66 @@
<?php echo $this->render('header'); ?>
<div class="lastWord">
<div class="form">
<div class="top"><h3>Add A New Account</h3></div>
<div class="lastWord">
<div class="form">
<div class="container col-xl-8 offset-2">
<form action="" method="post" id="addForm" onsubmit="return validateAddForm();">
<table>
<tr>
<td><label for="nl" title="Required">Service Name</label></td>
<td><label for="nu" title="Required">UserName</label></td>
<td><label for="ns" title="Optional">Service Type</label></td>
</tr>
<tr>
<td><input id="nl" type="text" name="service" title="Required"></td>
<td><input id="nu" type="text" name="username" title="Required"></td>
<td><select id="ns" onchange="setLoginDetails(this.value);" title="Optional">
<option value="">Blank/Unknown</option>
<?php foreach ($Websites as $k => $v) { ?>
<option value="<?php echo $k; ?>"><?php echo $v['label']; ?></option>
<?php } ?>
</select></td>
<td><input type="submit" value="Add Account"></td>
</tr>
<tr>
<td><label for="userField" title="Optional">Username Field</label></td>
<td><label for="passField" title="Optional">Password Field</label></td>
<td><label for="loginURI" title="Optional">Login URL</label></td>
</tr>
<tr>
<td><input id="userField" type="text" name="userField" value="username" title="Optional"></td>
<td><input id="passField" type="text" name="passField" value="password" title="Optional"></td>
<td colspan="2"><input id="loginURI" type="text" name="loginURI" value="http://" size="40" title="Optional"></td>
</tr>
</table>
<div class="card">
<div class="card-header">
<h3>Add A New Account</h3>
</div>
<div class="card-body">
<div class="form-group row">
<label for="nl" title="Required" class="col-sm-2 col-form-label">Service Name</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="nl" name="service" title="Required">
</div>
</div>
<div class="form-group row">
<label for="nu" title="Required" class="col-sm-2 col-form-label">UserName</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="nu" name="username" title="Required">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Service Type</label>
<div class="col-sm-3">
<select class="custom-select" id="ns" name="ns" onchange="setLoginDetails(this.value);" title="Optional">
<option value="">Blank/Unknown</option>
<?php foreach ($Websites as $k => $v) { ?>
<option value="<?php echo $k; ?>"><?php echo $v['label']; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group row">
<label for="userField" title="Optional" class="col-sm-2 col-form-label">UserName
Field</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="userField" name="userField" title="Required" value="username">
</div>
</div>
<div class="form-group row">
<label for="passField" title="Optional" class="col-sm-2 col-form-label">Password
Field</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="passField" name="passField" title="Required" value="password">
</div>
</div>
<div class="form-group row">
<label for="loginURI" title="Optional" class="col-sm-2 col-form-label">Login URL</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="loginURI" name="loginURI"
value="http://" title="Optional">
</div>
</div>
<div>
<input type="submit" class="btn btn-primary" value="Add Account">
</div>
</form>
<div class="bottom"></div></div>
</div>
<div class="bottom"></div>
</div>
<script type="text/javascript"><!--
var aLoginDetails = <?php echo json_encode($Websites); ?>;
// --></script>
</div>
<script type="text/javascript"><!--
var aLoginDetails = <?php echo json_encode($Websites); ?>;
// --></script>
<?php echo $this->render('footer');
199 changes: 129 additions & 70 deletions src/templates/LW.Edit.php
Original file line number Diff line number Diff line change
@@ -1,73 +1,132 @@
<?php echo $this->render('header'); ?>
<div class="lastWord">
<div class="form">
<div class="top"><h3>Edit An Account</h3></div>
<form action="" method="post" id="lw_editForm">
<table>
<tr>
<th>Record Id</th>
<td><?php echo $account->lwr_id; ?><input type="hidden" name="lwr_id" value="<?php echo $account->lwr_id; ?>"></td>
</tr>
<tr>
<th>Delete?</th>
<td><input type="checkbox" name="delete" value="<?php echo $account->lwr_id; ?>"></td>
<td class="red">Warning: Deleting cannot be undone.</td>
</tr>
<tr>
<th>Service Name</th>
<td><input type="text" size="20" name="service" value="<?php html($account->service); ?>"></td>
<td class="red">Warning: Changing This will result in a different password!</td>
</tr>
<tr>
<th>User Name</th>
<td><input type="text" size="20" name="username" value="<?php html($account->username); ?>"></td>
<td class="red">Warning: Changing This will result in a different password!</td>
</tr>
<tr>
<th>Password&nbsp;#</th>
<td><input type="text" size="20" name="resetCount" value="<?php html($account->resetCount); ?>"></td>
<td class="red">Warning: Changing This will result in a different password!</td>
</tr>
<tr>
<th>Password&nbsp;Length</th>
<td><input type="text" size="20" name="passLen" value="<?php html($account->passLen); ?>"></td>
<td class="red">Warning: Changing This will result in a different password!</td>
</tr>
<tr>
<td colspan="3"><hr></td>
</tr>
<tr>
<th>Presets</th>
<td><select onchange="setLoginDetails(this.value);" title="Optional">
<option value="">Blank/Unknown</option>
<?php foreach ($Websites as $k => $v) { ?>
<option value="<?php echo $k; ?>"><?php echo $v['label']; ?></option>
<?php } ?>
</select>
</td>
<tr>
<th>Login&nbsp;URL</th>
<td><input type="text" id="loginURI" size="20" name="loginURI" value="<?php html($account->loginURI); ?>"></td>
<td class="green">Safe to change: set to the address of the Service's login <i>handler</i>.</td>
</tr>
<tr>
<th>Username&nbsp;Field</th>
<td><input type="text" id="userField" size="20" name="userField" value="<?php html($account->userField); ?>"></td>
<td class="green">Advanced: set this to the form fieldname the service expects a username in</td>
</tr>
<tr>
<th>Password&nbsp;Field</th>
<td><input type="text" id="passField" size="20" name="passField" value="<?php html($account->passField); ?>"></td>
<td class="green">Advanced: set this to the form fieldname the service expects a password in</td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Submit"></td>
</tr>
</table>
</form>
<div class="bottom"></div></div>
<div class="container-fluid">
<div class="form">
<div class="container col-xl-8 offset-2">
<form action="" method="post" id="lw_editForm">
<div class="card">
<div class="card-header">
<h3> Edit An Account</h3>
</div>
<div class="card-body">
<div class="form-group row">
<label for="lwr_id" class="col-sm-2 col-form-label">Record ID</label>
<label class="col-sm-2 col-form-label"> <?php echo $account->lwr_id; ?></label>

<div class="col-sm-3">
<input type="hidden" class="form-control" id="lwr_id" name="lwr_id" value="<?php echo $account->lwr_id; ?>"
placeholder="<?php echo $account->lwr_id; ?>">
</div>
</div>
<div class="form-group row">
<label for="delete" class="col-sm-2">Delete?</label>
<div class="col-sm-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="delete" name="delete" value="<?php echo $account->lwr_id; ?>">
</div>
</div>
<div class="col-sm-6">
<label class="form-check-label text-warning" for="delete">
Warning: Deleting cannot be undone.
</label>
</div>
</div>
<div class="form-group row">
<label for="service" class="col-sm-2 col-form-label">Service Name</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="service" name="service"
placeholder="<?php html($account->service); ?>" value="<?php html($account->service); ?>">
</div>
<div class="col-sm-6 text-warning">
Warning: Changing This will result in a different password!
</div>
</div>
<div class="form-group row">
<label for="username" class="col-sm-2 col-form-label">Username</label>
<div class="col-sm-3">
<input type="text" class="form-control " id="username" name="username"
placeholder="<?php html($account->username); ?>" value="<?php html($account->username); ?>">
</div>
<div class="col-sm-6 text-warning">
Warning: Changing This will result in a different password!
</div>
</div>
<div class="form-group row">
<label for="resetCount" class="col-sm-2 col-form-label">Password #</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="resetCount" name="resetCount"
value="<?php html($account->resetCount); ?>">
</div>
<div class="col-sm-6 text-warning">
Warning: Changing This will result in a different password!
</div>
</div>
<div class="form-group row">
<label for="passLen" class="col-sm-2 col-form-label">Password Length</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="passLen" name="passLen"
value="<?php html($account->passLen); ?>"
placeholder="<?php html($account->passLen); ?>">
</div>
<div class="col-sm-6 text-warning">
Warning: Changing This will result in a different password!
</div>
</div>
<div class="border-top my-3"></div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">Preset</label>
<div class="col-sm-3">
<select class="custom-select" onchange="setLoginDetails(this.value);"
title="Optional">
<option value="">Blank/Unknown</option>
<?php foreach ($Websites as $k => $v) { ?>
<option value="<?php echo $k; ?>"><?php echo $v['label']; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="form-group row">
<label for="loginURI" class="col-sm-2 col-form-label">Login URL</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="loginURI" name="loginURI"
placeholder="<?php html($account->loginURI); ?>" value="<?php html($account->loginURI); ?>">
</div>
<div class="col-sm-6 text-success">
Safe to change: set to the address of the Service's login
</div>
</div>
<div class="form-group row">
<label for="userField" class="col-sm-2 col-form-label">Username Field</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="userField" name="userField"
value="<?php html($account->userField); ?>"
placeholder="<?php html($account->userField); ?>">
</div>
<div class="col-sm-6 text-info">
Advanced: set this to the form fieldname the service expects a username in
</div>
</div>
<div class="form-group row">
<label for="passField" class="col-sm-2 col-form-label">Password Field</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="passField" name="passField"
value="<?php html($account->passField); ?>"
placeholder="<?php html($account->passField); ?>">
</div>
<div class="col-sm-6 text-info">
Advanced: set this to the form fieldname the service expects a password in
</div>
</div>
<div>
<input type="submit" class="btn btn-primary" value="Submit">
</div>
</div>
</div>
</form>
<div class="bottom"></div>
</div>
</div>
<script type="text/javascript"><!--
var aLoginDetails = <?php echo json_encode($Websites); ?>;
// --></script>
</div>
<script type="text/javascript"><!--
var aLoginDetails = <?php echo json_encode($Websites); ?>;
// --></script>
<?php echo $this->render('footer');
Loading