<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> squid-users <squid-users-bounces@lists.squid-cache.org> on behalf of Antony Stone <Antony.Stone@squid.open.source.it><br>
<b>Sent:</b> Monday, December 11, 2017 9:27 PM<br>
<b>To:</b> squid-users@lists.squid-cache.org<br>
<b>Subject:</b> Re: [squid-users] Helper doent authentify</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">On Monday 11 December 2017 at 22:19:53, Edwin Quijada wrote:<br>
<br>
> Hi!<br>
> I am trying to do a helper for use with Squid. I did my helper but it<br>
> doesnt authentify<br>
> <br>
> <?php<br>
> <br>
> $f = fopen("php://stdin", "r");<br>
> while (!(feof($f)))<br>
> {<br>
>     $line = fgets($f);<br>
>     if ($line)<br>
>      {<br>
>         $fields = explode(' ', trim($line));<br>
>         $username = rawurldecode($fields[0]);<br>
>         $password = rawurldecode($fields[1]);<br>
> <br>
>         if ($username=="edwin" &&  $password=="1234")<br>
>          fwrite(STDOUT, "OK\n");<br>
>         else<br>
>          fwrite(STDOUT, "ERR\n");<br>
>     }<br>
> }<br>
> ?><br>
> <br>
> when I put the values it continues asked me user/password<br>
<br>
I think "$f" might be your problem.<br>
<br>
See <a href="http://freesoftwaremagazine.com/articles/authentication_with_squid/" id="LPlnk698809" previewremoved="true" title="Ctrl+Click or tap to follow the link">
http://freesoftwaremagazine.com/articles/authentication_with_squid/</a> for <br>
</div>
<div class="PlainText"><br>
</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">I copied my example from this page. <span>😞</span></div>
<div class="PlainText">If I run the script it works fine , returns OK or ERR that is suppose to receive
<br>
</div>
<div class="PlainText"><br>
<div id="LPBorder_GT_15130293099690.3822129886817396" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15130293099620.8718306669468874" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" role="presentation" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="TextCell_15130293099640.23663014119119596" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_15130293099640.19528505728095602"></div>
<div id="LPTitle_15130293099640.4535126201117573" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light", "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15130293099640.55227065175051" style="text-decoration: none;" href="http://freesoftwaremagazine.com/articles/authentication_with_squid/" target="_blank">How to build squid authentication helpers</a></div>
<div id="LPMetadata_15130293099670.6331156867422802" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
freesoftwaremagazine.com</div>
<div id="LPDescription_15130293099680.09736187761789261" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Have you ever tried to figure out how to make Squid authenticate users according to your own exotic rules? Users are in a DB? Are you using an ActiveDirectory?</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
what might be a clue (sorry, I'm not really a PHP coder).<br>
<br>
<br>
Antony.<br>
<br>
-- <br>
Why is "dylexia" so difficult to spell, and why can I never remember "aphasia" <br>
when I want to?<br>
<br>
                                                   Please reply to the list;<br>
                                                         please *don't* CC me.<br>
_______________________________________________<br>
squid-users mailing list<br>
squid-users@lists.squid-cache.org<br>
<a href="http://lists.squid-cache.org/listinfo/squid-users" id="LPlnk354784" previewremoved="true">http://lists.squid-cache.org/listinfo/squid-users</a>
<div id="LPBorder_GT_15130293379990.981023968940928" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_15130293379950.3887999387183372" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);" role="presentation" cellspacing="0">
<tbody>
<tr style="border-spacing: 0px;" valign="top">
<td id="TextCell_15130293379970.6138732911753666" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" colspan="2">
<div id="LPRemovePreviewContainer_15130293379970.9409285665163284"></div>
<div id="LPTitle_15130293379970.9770857812858802" style="top: 0px; color: rgb(0, 120, 215); font-weight: 400; font-size: 21px; font-family: "wf_segoe-ui_light", "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_15130293379980.11862309260902837" style="text-decoration: none;" href="http://lists.squid-cache.org/listinfo/squid-users" target="_blank">squid-users Info Page</a></div>
<div id="LPMetadata_15130293379980.28360472142550286" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
lists.squid-cache.org</div>
<div id="LPDescription_15130293379990.03231919339802225" style="display: block; color: rgb(102, 102, 102); font-weight: 400; font-family: "wf_segoe-ui_normal", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
squid-users -- General discussion relating to Squid. The membership of this list is thousands of Squid users from around the world About squid-users</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>