<p>Untitled Document <!--
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
.style4 {
	font-size: 12px;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style2 {font-size: 12px}
.style5 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
<script type="text/javascript"></script>
</p>
<p class="style4" lang="pt-BR" xml:lang="pt-BR"><strong>MCR2: How to create a mcr2_en_us.php method returning a value.</strong> <span class="style2"><span class="style5"><strong></strong></span></span></p>
<p class="style4" lang="pt-BR" xml:lang="pt-BR"><br /><strong>Application Name: </strong>returning_login<br /><strong>Description:</strong> Control Application effecting login in the system with validation method returning values<br /><strong><span class="style1"><span class="style2"><span class="style4"><span class="style2"><strong>Fields that will be shown in the control</strong></span></span></span></span>: </strong><br />login, password<br /><span class="style1"><span class="style2"><span class="style4"><span class="style2"><strong>Table width:</strong> 0<br /></span><span class="style7"><strong>Table width unit: </strong>Automatic</span><span class="style2"><br /><strong>Header -&gt; Application Title: </strong></span></span></span></span><span lang="pt-BR" xml:lang="pt-BR">Method Returning value</span></p>
<table style="height: 262px;" border="1" cellspacing="0" width="456" bordercolor="#333333">
<tbody>
<tr>
<td class="style4" width="188"><strong>New Method:</strong></td>
<td class="style4" width="412">userValidate</td>
</tr>
<tr>
<td class="style4">
<p><strong>Code:</strong></p>
</td>
<td class="style4">
<p>sc_lookup(ds,"Select count(*) from seg_users where login='{login}'");</p>
<p>if(empty({ds}))<br />{<br />return @@##Inexistent User!@@##;<br />}<br />else<br />{<br />if({ds[0][1]}!={password})<br />{<br />return 'Invalid Password!';<br />}<br />}<br />return 'ok';</p>
</td>
</tr>
</tbody>
</table>