Enabled sending netmails to upstream areafix/filefix
This commit is contained in:
@@ -8,17 +8,21 @@ use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Illuminate\Support\ViewErrorBag;
|
||||
|
||||
use App\Http\Requests\SystemRegister;
|
||||
use App\Classes\FTN\Message;
|
||||
use App\Http\Requests\{AreafixRequest,SystemRegister};
|
||||
use App\Jobs\AddressPoll;
|
||||
use App\Models\{Address,Echoarea,Filearea,Setup,System,SystemZone,Zone};
|
||||
use App\Models\{Address,Echoarea,Filearea,Netmail,Setup,System,SystemZone,Zone};
|
||||
use App\Notifications\Netmails\AddressLink;
|
||||
use App\Rules\{FidoInteger,TwoByteInteger};
|
||||
|
||||
class SystemController extends Controller
|
||||
{
|
||||
private const LOGKEY = 'CSC';
|
||||
|
||||
/**
|
||||
* Add an address to a system
|
||||
*
|
||||
@@ -377,6 +381,37 @@ class SystemController extends Controller
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function areafix(AreafixRequest $request,System $o,Zone $zo)
|
||||
{
|
||||
if ($request->post()) {
|
||||
$no = new Netmail;
|
||||
foreach ($request->safe() as $item => $value)
|
||||
$no->{$item} = $value;
|
||||
|
||||
$no->from = auth::user()->name;
|
||||
$no->msg .= "\r";
|
||||
|
||||
$no->datetime = Carbon::now();
|
||||
$no->tzoffset = $no->datetime->utcOffset();
|
||||
$no->flags = (Message::FLAG_LOCAL|Message::FLAG_PRIVATE|Message::FLAG_CRASH);
|
||||
$no->cost = 0;
|
||||
|
||||
$no->tearline = sprintf('%s (%04X)',Setup::PRODUCT_NAME,Setup::PRODUCT_ID);
|
||||
$no->save();
|
||||
|
||||
Log::info(sprintf('%s:= Areafix to [%s], scheduling a poll',self::LOGKEY,$no->fftn->ftn));
|
||||
AddressPoll::dispatch($no->tftn);
|
||||
|
||||
return redirect()->back()->with('success','Areafix/Filefix sent');
|
||||
}
|
||||
|
||||
return view('system.areafix')
|
||||
->with('zo',$zo)
|
||||
->with('ao',$o->match($zo)->first())
|
||||
->with('o',$o)
|
||||
->with('setup',Setup::findOrFail(config('app.id')));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete address assigned to a host
|
||||
*
|
||||
|
Reference in New Issue
Block a user