Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Commit

Permalink
Update 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sujit223 committed May 12, 2016
1 parent 8e49898 commit 30be280
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ APP_URL=http://localhost

DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=momo
DB_USERNAME=root
DB_PASSWORD=
DB_DATABASE=<-- Here goes database name -->
DB_USERNAME=<-- Here goes database username -->
DB_PASSWORD=<-- Here goes database password -->

CACHE_DRIVER=file
SESSION_DRIVER=file
Expand Down
23 changes: 13 additions & 10 deletions app/Http/Controllers/EmailsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ public function validatingEmailSettings(Request $request) {
$return = 1;
}
}

return $return;
}

Expand All @@ -141,12 +140,13 @@ public function validatingEmailSettings(Request $request) {
* @return type Redirect
*/
public function store($request, $imap_check) {
// dd($request->input('smtp_validate'));
$email = new Emails();
try {
// saving all the fields to the database
if ($email->fill($request->except('password', 'fetching_status', 'fetching_encryption', 'sending_status', 'auto_response'))->save() == true) {
if ($request->input('password')) {
$email->password = Crypt::encrypt($request->input('password'));
$email->password = \Crypt::encrypt($request->input('password'));
}
if ($request->fetching_status == 'on') {
$email->fetching_status = 1;
Expand All @@ -168,11 +168,12 @@ public function store($request, $imap_check) {
} else {
$email->fetching_encryption = $request->fetching_encryption;
}
if ($request->smtp_authentication == 'on') {
$email->smtp_authentication = 1;
if ($request->smtp_validate == 'on') {
$email->smtp_validate = 1;
} else {
$email->smtp_authentication = 0;
$email->smtp_validate = 0;
}
// dd($email);
// inserting the encrypted value of password
$email->save(); // run save
// returns success message for successful email creation
Expand Down Expand Up @@ -341,10 +342,10 @@ public function update($id, $request, $imap_check) {
} else {
$emails->fetching_encryption = $request->fetching_encryption;
}
if ($request->smtp_authentication == 'on') {
$email->smtp_authentication = 1;
if ($request->smtp_validate == 'on') {
$email->smtp_validate = 1;
} else {
$email->smtp_authentication = 0;
$email->smtp_validate = 0;
}
// inserting the encrypted value of password
$emails->password = Crypt::encrypt($request->input('password'));
Expand Down Expand Up @@ -476,7 +477,7 @@ public function getSmtp($request) {
if ($request->input('sending_protocol') == 'smtp') {
$mail = new \PHPMailer();
$mail->isSMTP();
if ($request->smtp_validate == 'on') {
if ($request->input('smtp_validate') == 'on') {
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
Expand All @@ -486,11 +487,13 @@ public function getSmtp($request) {
);
}
$mail->Host = $request->input('sending_host'); // Specify main and backup SMTP servers
//$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = $request->input('email_address'); // SMTP username
$mail->Password = $request->input('password'); // SMTP password
$mail->SMTPSecure = $request->input('sending_encryption'); // Enable TLS encryption, `ssl` also accepted
$mail->Port = $request->input('sending_port'); // TCP port to connect to
// dd($mail);

if ($mail->smtpConnect() == true) {
$mail->smtpClose();
$return = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function up()
$table->string('sending_port');
$table->string('sending_protocol');
$table->string('sending_encryption');
$table->string('smtp_validate');
$table->string('internal_notes');
$table->boolean('auto_response');
$table->boolean('fetching_status');
Expand Down
16 changes: 8 additions & 8 deletions resources/views/email/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class="active"
</div>
<div class="row">
<div class="col-xs-2 form-group {!! $errors->has('fetching_protocol') ? 'has-error' : ''!!}" id="fetching_protocol_error">
<label>Fetching Protocol</label>
<label> Protocol</label>
{!! $errors->first('fetching_protocol', '<spam class="help-block">:message</spam>') !!}
<!-- <input type="text" name="fetching_protocol" class='form-control' id='fetching_protocol'> -->
<select name="fetching_protocol" class='form-control' id='fetching_protocol'>
Expand All @@ -90,17 +90,17 @@ class="active"
</select>
</div>
<div class="col-xs-2 form-group {!! $errors->has('fetching_host') ? 'has-error' : ''!!}" id="fetching_host_error">
<label>Fetching Host</label>
<label> Host</label>
{!! $errors->first('fetching_host', '<spam class="help-block">:message</spam>') !!}
<input type="text" name="fetching_host" class='form-control' id='fetching_host'>
</div>
<div class="col-xs-2 form-group {!! $errors->has('fetching_port') ? 'has-error' : ''!!}" id="fetching_port_error">
<label>Fetching Port</label>
<label> Port</label>
{!! $errors->first('fetching_port', '<spam class="help-block">:message</spam>') !!}
<input type="text" name="fetching_port" class='form-control' id='fetching_port'>
</div>
<div class="col-xs-2 form-group {!! $errors->has('fetching_encryption') ? 'has-error' : ''!!}" id="fetching_encryption_error">
<label>Fetching Encryption</label>
<label> Encryption</label>
{!! $errors->first('fetching_encryption', '<spam class="help-block">:message</spam>') !!}
<!-- <input type="text" name="fetching_encryption" class='form-control' id='fetching_encryption'> -->
<select name="fetching_encryption" class='form-control' id='fetching_encryption'>
Expand Down Expand Up @@ -141,7 +141,7 @@ class="active"
<div class="row">
<!-- Encryption -->
<div class="col-xs-2 form-group {!! $errors->has('sending_protocol') ? 'has-error' : ''!!}" id="sending_protocol_error">
<label>Sending Protocol</label>
<label> Protocol</label>
{!! $errors->first('sending_protocol', '<spam class="help-block">:message</spam>') !!}
<select name="sending_protocol" class="form-control" id="sending_protocol">
<option value="smtp">SMTP</option>
Expand All @@ -150,19 +150,19 @@ class="active"
</div>
<!-- sending hoost -->
<div class="col-xs-2 form-group {!! $errors->has('sending_host') ? 'has-error' : ''!!}" id="sending_host_error">
<label>Sending Host</label>
<label> Host</label>
{!! $errors->first('sending_host', '<spam class="help-block">:message</spam>') !!}
<input type="text" name="sending_host" class="form-control" id="sending_host">
</div>
<!-- sending port -->
<div class="col-xs-2 form-group {!! $errors->has('sending_port') ? 'has-error' : ''!!}" id="sending_port_error">
<label>Sending Port</label>
<label> Port</label>
{!! $errors->first('sending_port', '<spam class="help-block">:message</spam>') !!}
<input type="text" name="sending_port" class="form-control" id="sending_port">
</div>
<!-- Encryption -->
<div class="col-xs-2 form-group {!! $errors->has('sending_encryption') ? 'has-error' : ''!!}" id="sending_encryption_error">
<label>Sending Encryption</label>
<label> Encryption</label>
{!! $errors->first('sending_encryption', '<spam class="help-block">:message</spam>') !!}
<select name="sending_encryption" class="form-control" id="sending_encryption">
<option value="">-----Select-----</option>
Expand Down
18 changes: 9 additions & 9 deletions resources/views/email/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class="active"
</div>
<div class="row">
<div class="col-xs-2 form-group {!! $errors->has('fetching_protocol') ? 'has-error' : ''!!}" id="fetching_protocol_error">
<label>Fetching Protocol</label>
<label> Protocol</label>
<!-- <input type="text" name="fetching_protocol" class='form-control' id='fetching_protocol' value="{!! $emails->fetching_protocol !!}"> -->
<select name="fetching_protocol" class='form-control' id='fetching_protocol'>
<option <?php
Expand All @@ -95,15 +95,15 @@ class="active"
</select>
</div>
<div class="col-xs-2 form-group {!! $errors->has('fetching_host') ? 'has-error' : ''!!}" id="fetching_host_error">
<label>Fetching Host</label>
<label> Host</label>
<input type="text" name="fetching_host" class='form-control' id='fetching_host' value="{!! $emails->fetching_host !!}">
</div>
<div class="col-xs-2 form-group {!! $errors->has('fetching_port') ? 'has-error' : ''!!}" id="fetching_port_error">
<label>Fetching Port</label>
<label> Port</label>
<input type="text" name="fetching_port" class='form-control' id='fetching_port' value="{!! $emails->fetching_port !!}">
</div>
<div class="col-xs-2 form-group {!! $errors->has('fetching_encryption') ? 'has-error' : ''!!}" id="fetching_encryption_error">
<label>Fetching Encryption</label>
<label> Encryption</label>
<!-- <input type="text" name="fetching_encryption" class='form-control' id='fetching_encryption' value="{!! $emails->fetching_encryption !!}"> -->
<select name="fetching_encryption" class='form-control' id='fetching_encryption'>
<option value=""> -----Select----- </option>
Expand Down Expand Up @@ -149,7 +149,7 @@ class="active"
<!-- status -->
<div class="form-group">
<div class="col-xs-2 form-group">
<label>Sending Status</label>
<label> Status</label>
</div>
<div class="col-xs-2 form-group">
<input type="checkbox" name="sending_status" id="sending_status" <?php if ($emails->sending_status == '1') {
Expand All @@ -161,7 +161,7 @@ class="active"
<div class="row">
<!-- Encryption -->
<div class="col-xs-2 form-group {!! $errors->has('sending_protocol') ? 'has-error' : ''!!}" id="sending_protocol_error">
<label>Sending Protocol</label>
<label> Protocol</label>
{!! $errors->first('sending_protocol', '<spam class="help-block">:message</spam>') !!}
<select name="sending_protocol" class="form-control" id="sending_protocol">
<option <?php
Expand All @@ -179,19 +179,19 @@ class="active"
<?php //dd($emails); ?>
<!-- sending hoost -->
<div class="col-xs-2 form-group {!! $errors->has('sending_host') ? 'has-error' : ''!!}" id="sending_host_error">
<label>Sending Host</label>
<label> Host</label>
{!! $errors->first('sending_host', '<spam class="help-block">:message</spam>') !!}
<input type="text" name="sending_host" class="form-control" id="sending_host" value="{!! $emails->sending_host !!}">
</div>
<!-- sending port -->
<div class="col-xs-2 form-group {!! $errors->has('sending_port') ? 'has-error' : ''!!}" id="sending_port_error">
<label>Sending Port</label>
<label> Port</label>
{!! $errors->first('sending_port', '<spam class="help-block">:message</spam>') !!}
<input type="text" name="sending_port" class="form-control" id="sending_port" value="{!! $emails->sending_port !!}">
</div>
<!-- Encryption -->
<div class="col-xs-2 form-group {!! $errors->has('sending_encryption') ? 'has-error' : ''!!}" id="sending_encryption_error">
<label>Sending Encryption</label>
<label> Encryption</label>
{!! $errors->first('sending_encryption', '<spam class="help-block">:message</spam>') !!}
<select name="sending_encryption" class="form-control" id="sending_encryption">
<option value="">-----Select-----</option>
Expand Down

0 comments on commit 30be280

Please sign in to comment.