[ic] display userdb contents with one-click search

Kevin Walsh interchange-users@icdevgroup.org
Thu Jul 18 06:40:03 2002


> 
> IC 4.8.5. I want to allow fellow classmates to view contact info with
> each other. I want to use a one-click search, but I can not get this
> code to work. It displays a list of users, but clicking on any users'
> name does not display that username on classmate.html:
> 
> [calc]$Config->{NoSearch} = ''[/calc]
> [search-region  more=1
>                    search="
>                    fi=userdb
>                    tf=username
>                    ra=yes
>                    ml=400
>                   "]
>    [search-list]
>           [page search="
>       sp=classmate
>       fi=userdb
>       sf=username
>       se=[item-data userdb username]
>       "]
> [item-data userdb username][/page]<br>
>    [/search-list]
> 
>    [/search-region]
> 
> On classmate.html I have:
> 
> [search-region]
> [search-list]
> [item-data userdb username]
> [/search-list]
> [/search-region]
> 
> 
> The result page does display without errors, but the username is
> blank. Error logs report "Search of 'userdb.txt' denied by NoSearch
> directive". It is as if I had not unset the NoSearch directive, but I
> have (once, and I've tried to 'unset' it a second time without
> success). I know the code works with other databases. I have poured
> over the archives and docs. I have spent many hours 'throwing code' at
> it. I have tried this with several different catalog installs of IC.
> It just don't work.
> 
> If someone can offer ANY advice, please do, my hair is gone now.
> 
Your config change is not persistent; it applies to that page only.
Once you click on the search link, a new page is called.  The search
is attempted (and fails) before your new page code is seen, and before
you have the chance to unset the config.

My suggestion is to change your first page to use something like this:

[search-list]
    <a href="[area href='classmate' arg='[item-code]']">[item-code]</a>
    <br />
[/search-list]

Your classmate.html page would unset the NoSearch config, as before,
and then initiate a userdb search using [data session arg] as the
username.

Please think about whether you really want to allow userdb searches.
The NoSearch defaults to 'userdb' for your own protection and for the
protection of the personal data stored in that table.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/