]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
Add support for the max results setting in the user find page
authorkkalev <kkalev>
Tue, 20 Aug 2002 14:49:56 +0000 (14:49 +0000)
committerkkalev <kkalev>
Tue, 20 Aug 2002 14:49:56 +0000 (14:49 +0000)
htdocs/find.php3
lib/ldap/find.php3
lib/sql/find.php3

index aa9014fda320424a9850e181cefa21bc7644c112..d33dcae67861b8c6edcef8e4f115a7e088179c0d 100644 (file)
@@ -47,6 +47,8 @@ if ($find_user == 1){
         </tr>
 EOM;
                foreach ($found_users as $user){
+                       if ($user == '')
+                               $user = '-';
                        $num++;
                        $msg .= <<<EOM
                        <tr align=center>
@@ -57,7 +59,8 @@ EOM;
                }
                $msg .= "</table>\n";
        }
-
+       else
+               $msg = "<b>No users found</b><br>\n";
 }
 ?>
    <form method=post>
index 72a353cb70664349ba96aa507fe7563fc1621c45..fdf6ea4ad613dd4c03789601a7fcf4b7c4d06b28 100644 (file)
@@ -8,7 +8,7 @@ if ($ds) {
                require('../lib/ldap/attrmap.php3');
                $attr = $attrmap[$radius_attr];
        }
-       $sr=@ldap_search($ds,"$config[ldap_base]", "$attr=*$search*",array('uid'));
+       $sr=@ldap_search($ds,"$config[ldap_base]", "$attr=*$search*",array('uid'),0,$max_results);
        if (($info = @ldap_get_entries($ds, $sr))){
                for ($i = 0; $i < $info["count"]; $i++)
                        $found_users[] = $info[$i]['uid'][0];
index d2ddd7068e605421046af16fa7f082088aab6f2d..22d2e5bae3b1a384660fe464c377cec17a9a3013 100644 (file)
@@ -12,7 +12,7 @@ if ($link){
                $attr = ($search_IN == 'name') ? 'Name' : 'Department';
                $res = @da_sql_query($link,$config,
                "SELECT UserName FROM $config[sql_user_info_table] WHERE
-               $attr LIKE '%$search%';");
+               $attr LIKE '%$search%' LIMIT $max_results;");
                if ($res){
                        while(($row = @da_sql_fetch_array($res,$config)))
                                $found_users[] = $row[UserName];
@@ -25,7 +25,7 @@ if ($link){
                $table = ($attr_type[$radius_attr] == 'checkItem') ? $config[sql_check_table] : $config[sql_reply_table];
                $attr = $attrmap[$radius_attr];
                $res = @da_sql_query($link,$config,
-               "SELECT UserName FROM $table WHERE Attribute = '$attr' AND Value LIKE '%$search%';");
+               "SELECT UserName FROM $table WHERE Attribute = '$attr' AND Value LIKE '%$search%' LIMIT $max_results;");
                if ($res){
                        while(($row = @da_sql_fetch_array($res,$config)))
                                $found_users[] = $row[UserName];