Browse code

auth_db: more details for is_subscriber()

Daniel-Constantin Mierla authored on 17/12/2014 22:34:21
Showing 2 changed files
... ...
@@ -463,15 +463,17 @@ if (!auth_check("$fd", "subscriber", "1")) {
463 463
        (usually subscriber table). The string may contain pseudo
464 464
        variables.
465 465
      * flags - set of flags to control the behaviour of the function. If
466
-       it is 1, then the function will use the domain part of the URI to
467
-       perform the database table search.
466
+       1st bit is set, then the function will use the domain part of the
467
+       URI to perform the database table search. If 2nd bit is set, then
468
+       the credentials are not loaded in variables (a simple check if
469
+       subscriber exists).
468 470
        The parameter may be a pseudo variable.
469 471
 
470 472
    This function can be used from ANY_ROUTE.
471 473
 
472 474
    Example 1.13. is_subscriber usage
473 475
 ...
474
-if (!is_subscriber("$ru", "subscriber", "1")) {
476
+if (!is_subscriber("$ru", "subscriber", "3")) {
475 477
     # callee is not a local subscriber
476 478
     ...
477 479
 }
... ...
@@ -585,8 +585,10 @@ if (!auth_check("$fd", "subscriber", "1")) {
585 585
 		</listitem>
586 586
 		<listitem>
587 587
 			<para><emphasis>flags</emphasis> - set of flags to control the
588
-			behaviour of the function. If it is 1, then the function will
588
+			behaviour of the function. If 1st bit is set, then the function will
589 589
 			use the domain part of the URI to perform the database table search.
590
+			If 2nd bit is set, then the credentials are not loaded in variables
591
+			(a simple check if subscriber exists).
590 592
 			</para>
591 593
 			<para>
592 594
 			The parameter may be a pseudo variable.
... ...
@@ -600,7 +602,7 @@ if (!auth_check("$fd", "subscriber", "1")) {
600 600
 		<title>is_subscriber usage</title>
601 601
 		<programlisting format="linespecific">
602 602
 ...
603
-if (!is_subscriber("$ru", "subscriber", "1")) {
603
+if (!is_subscriber("$ru", "subscriber", "3")) {
604 604
     # callee is not a local subscriber
605 605
     ...
606 606
 }