<div dir="ltr">Hello,
<div><br></div><div>I am trying to use exec to check if a user in valid in a custom PHP script, what I would like is to get multiple attributes returned.</div><div><br></div><div><br></div><div>I created a module as:</div>
<div>=======================================================================<br></div><div><div>exec checkuser {</div><div> wait = yes</div><div> input_pairs = request</div><div> output_pairs = reply</div>
<div> program = "/etc/raddb/check-user.php -log -debug '%{User-Name}' '%{User-Password}'"</div><div> shell_escape = yes</div><div>}</div></div><div>=======================================================================</div>
<div>and then activated it in the "authorize" section.<br></div><div><br></div><div>The check-user.php script I would like to output the following:</div><div>=======================================================================</div>
<div><div><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19px"><?php</pre><pre style="font-family:courier,'courier new',monospace;font-size:14px;white-space:pre-wrap;word-wrap:break-word;margin-top:0px;margin-bottom:0px;color:rgb(0,0,0);line-height:19px">
echo "Access-Accept = Accept"; // I used also commas.. same error</pre></div><div>echo "Mikrotik-Group = student";</div><div>echo "Mikrotik-Rate-Limit = 1564k/6400k"; </div></div><div><br></div>
<div>So howevery I am echo-ing these I just get: "Exec format error"</div><div>========================================================================</div><div><div>[checkuser] expand: '%{User-Name}' -> 'AC:81:F3:63:7D:07'</div>
<div>[checkuser] expand: '%{User-Password}' -> ''</div><div>Exec-Program output: Exec-Program: FAILED to execute /etc/raddb/check-user.php: Exec format error</div><div>Exec-Program-Wait: plaintext: Exec-Program: FAILED to execute /etc/raddb/check-user.php: Exec format error</div>
<div>Exec-Program: returned: 1</div><div>++[checkuser] returns reject</div></div><div><div>======================================================================</div><div><br></div><div>What is the correct way to return multiple attributes in PHP</div>
<div><br></div><div>All help is appreciated, that you.</div><div><br></div><div>Adnan</div><div></div></div><div><br></div><div><br></div></div>