mirror of https://github.com/gophish/gophish
Added autofocus
PUT /api/groups/:id can now update the group name and modified datepull/24/head
parent
b3e411c54c
commit
bfdf9ca00e
8
db/db.go
8
db/db.go
|
@ -7,6 +7,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net/mail"
|
"net/mail"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/coopernurse/gorp"
|
"github.com/coopernurse/gorp"
|
||||||
"github.com/jordan-wright/gophish/config"
|
"github.com/jordan-wright/gophish/config"
|
||||||
|
@ -304,6 +305,13 @@ func PutGroup(g *models.Group, uid int64) error {
|
||||||
insertTargetIntoGroup(nt, g.Id)
|
insertTargetIntoGroup(nt, g.Id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Update the group
|
||||||
|
g.ModifiedDate = time.Now()
|
||||||
|
_, err = Conn.Update(g)
|
||||||
|
if err != nil {
|
||||||
|
Logger.Println(err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- New Campaign Modal -->
|
<!-- New Campaign Modal -->
|
||||||
<div class="modal" id="newCampaignModal" tabindex="-1" role="dialog" aria-labelledby="campaignModalLabel" aria-hidden="true">
|
<div class="modal" id="newCampaignModal" role="dialog" aria-labelledby="campaignModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="name">Name:</label>
|
<label for="name">Name:</label>
|
||||||
<input type="text" class="form-control" ng-model="campaign.name" id="name" placeholder="Campaign name">
|
<input type="text" class="form-control" ng-model="campaign.name" id="name" placeholder="Campaign name" autofocus>
|
||||||
<br />
|
<br />
|
||||||
<label class="control-label" for="users">Groups:</label>
|
<label class="control-label" for="users">Groups:</label>
|
||||||
<form ng:submit="addGroup()">
|
<form ng:submit="addGroup()">
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- New Template Modal -->
|
<!-- New Template Modal -->
|
||||||
<div class="modal" id="newTemplateModal" tabindex="-1" role="dialog" aria-labelledby="templateModalLabel" aria-hidden="true">
|
<div class="modal" id="newTemplateModal" role="dialog" aria-labelledby="templateModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog modal-lg">
|
<div class="modal-dialog modal-lg">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<label class="control-label" for="name">Name:</label>
|
<label class="control-label" for="name">Name:</label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" ng-model="template.name" placeholder="Template name" id="name" />
|
<input type="text" class="form-control" ng-model="template.name" placeholder="Template name" id="name" autofocus/>
|
||||||
</div>
|
</div>
|
||||||
<!-- Nav tabs -->
|
<!-- Nav tabs -->
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- New Group Modal -->
|
<!-- New Group Modal -->
|
||||||
<div class="modal" id="newGroupModal" tabindex="-1" role="dialog" aria-labelledby="groupModalLabel" aria-hidden="true">
|
<div class="modal" id="newGroupModal" role="dialog" aria-labelledby="groupModalLabel" aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<label class="control-label" for="name">Name:</label>
|
<label class="control-label" for="name">Name:</label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input type="text" class="form-control" ng-model="group.name" placeholder="Group name" id="name" />
|
<input type="text" class="form-control" ng-model="group.name" placeholder="Group name" id="name" autofocus/>
|
||||||
</div>
|
</div>
|
||||||
<fieldset disabled>
|
<fieldset disabled>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
Loading…
Reference in New Issue