Solved

problem with @if stat

Posted on 2001-09-02
10
169 Views
Last Modified: 2013-12-18
hai experts,
@If(@name([cn]; @username) = "test user";
"page1"; "page2").this formula will work only for a single user.user other than "test user" it wont work for other users.Now i want to use the same formula for more users more than 200 users.so how i can give the formula as dynamic.I want to display the perticular page for some users only like for 30 users.how can we do it?
waiting for reply.

saleem.
0
Comment
Question by:saleemkhan
  • 5
  • 5
10 Comments
 
LVL 8

Accepted Solution

by:
Jean Marie Geeraerts earned 50 total points
ID: 6449782
There are a few steps to take :
1) Put the people that need the page displayed in a group in your company's public name and address book.
To do this, just open the address book in your notes client (it will be located in the server's root directory with a name like "xxx's Address Book").
Go to the groups view, click the Button "Add group" to create the new group. Enter a name and description for the group. Select "Access Control List only" for the Group type. Use the arrow next to the Members field to add the users to the group. Click "Save and Close" to save the group.
2) Create a role in the ACL of your database.
When you opened your database, click on File, Database, Access Control List. You will get the ACL management dialog box. On the left, click on Roles. Now click "Add..." Enter a name for the role, e.g. HOME
The role will be listed as [HOME]. (Don't close the dialog box yet)
3) Assign this role to the access group you created earlier.
Select "Basics" at the left in the ACL dialog box.
Click "Add..." and type the name of the group you just created or click on the button next to the input field to select it from your Address Book. Click OK and the group will appear in your ACL list. Now select the group by clicking on it once, set the "User type" (on the right) to "Person Group" and in the bottom-right corner select the role you just created by clicking on it once. (You will notice a checkmark appearing before the name of the role).
4) Finally : your formula should be the following :
@If(@IsMember("[HOME]"; @UserRoles); "page1"; "page2")
This formula will check if a user has the role [HOME], if it does, it will display page1, if not it will display page2.
You have to be careful not to make a typing error here, because the group names are case-sensitive. (So "Home" is not the same as "HOME")

If you need further assistance, let me know.
0
 

Author Comment

by:saleemkhan
ID: 6449813
i have the acl of the database as

default :designer
admin   :manager
Anonymous:noaccess.

if i created the role and gave permissions as u said and for the group as desinger for the person will it authenticate login the users means first it should authenticate and then enter the frameset of the datbase will it do?

wiaitng for reply.

saleem.
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6449833
Roles are assigned the moment you open the database. If anonymous is set to "No Access" you have to authenticate. Once you're authenticated Notes knows to what groups you belong and therefore the roles will work.
People that are not in the group, won't have the role "[HOME]" and therefore will see a different page.
Just try it, you'll see it works as it should.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:saleemkhan
ID: 6449869
ok now i have a small doubt.to create a group u want me to open the address book the and then add group.am i correct?
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6449879
Yes, but make sure it's the address book on the server hosting the application and not on local.
0
 

Author Comment

by:saleemkhan
ID: 6449953
hai jerrith,
  as u said i created the group of the address book name "group1".in the group i added two persons.
  created the role name "home"
  persongroup    check mark home.

now i created page that contains html so i want to display this page for perticular person in the down frame.

so i did like this.

frame properties: named element page
            name test.html
  and the formula
@If(@IsMember("[home]"; @UserRoles); "test.html"; "")

when i close this i am getting invalid or non existent doucment.what may be the error.

invalid or non existent document means it not identifying the page or is there any error in the formula.

what may be the error.

waiting for reply.

saleem.
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6450003
It's the "" (to display nothing) in the formula that causes the error. I've tried it in a test database of my own and you can ignore the error.
To prevent the error put the name of an existing alternative page.
0
 

Author Comment

by:saleemkhan
ID: 6450009
hai jerrith,
  now i tried like this
@If(@IsMember("[home]"; @UserRoles); "first"; "second")

if i give blank instead of second i am getting invalid or non existent document.
Now i am not getting any error but the problem is who ever logs in its displaying the second page not the first where i done the mistake.

can u please help me in this.


waiting for reply.

saleem.



0
 

Author Comment

by:saleemkhan
ID: 6450114
hai jerrith,
  Thank u very much for valuable information.Its working great. i need the same help in future also.



Lets meet again,


saleem.
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6450124
You're welcome.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question