23 lines
579 B
PHP
Executable File
23 lines
579 B
PHP
Executable File
<?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 ÃspeÅnÃý!');
|
|
} else {
|
|
return redirect()->route('add-user')->with('success', 'Nastala cbyba!');
|
|
}
|
|
}
|
|
}
|