23 lines
579 B
PHP
23 lines
579 B
PHP
|
<?php
|
|||
|
|
|||
|
namespace App\Http\Controllers;
|
|||
|
|
|||
|
use Illuminate\Http\Request;
|
|||
|
use Illuminate\Support\Facades\Session;
|
|||
|
use Illuminate\Http\JsonResponse;
|
|||
|
|
|||
|
class EnrollUserController extends Controller
|
|||
|
{
|
|||
|
|
|||
|
|
|||
|
public function enrollUserAction(Request $request){
|
|||
|
$name = \request('name');
|
|||
|
$output = shell_exec('python3 enroll_raspberrypi.py ' . $name);
|
|||
|
if($output){
|
|||
|
return redirect()->route('add-user')->with('success', 'Pridanie bolo <20>spe<70>n<EFBFBD>ý!');
|
|||
|
} else {
|
|||
|
return redirect()->route('add-user')->with('success', 'Nastala cbyba!');
|
|||
|
}
|
|||
|
}
|
|||
|
}
|