11
Peekay
Re: Demo user creation
  • 2007/2/14 14:19

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Group permissions should keep 'demo user' under control - you just need to hack edituser.php and/or it's template to keep them away from the edit profile screen.

I think this is a good topic, but I have flu and cannot think straight enough to make a cup of tea, never mind hack any code.

I'll take a closer look in a while, unless someone else comes to the rescue beforehand.
A thread is for life. Not just for Christmas.

12
onasre
Re: Demo user creation
  • 2007/2/15 19:57

  • onasre

  • Not too shy to talk

  • Posts: 150

  • Since: 2006/8/12


Listen Man take your time and sorry that you having Flu but Remember whenever you get Flu this mean you will never have the same Flu again this what i have been told
Whatever Hits You , Never was to Mess you , and Whatever Messed U , Never Was to Hit You.

13
skenow
Re: Demo user creation
  • 2007/3/5 17:33

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


Quote:

Peekay wrote:
The rule with XOOPS custom user groups is you can give them more - but not less - than registered users. So you can give a custom group 'Demo' access to a block that ordinary registered users cannot see. However, you cannot hide a block from the 'demo' group without hiding it from the 'registered users' group too.

The second problem is that wherever the demo user's name is shown - e.g. in the 'who's online' block, the user can click the link and edit their profile, including the password.

Best solution I can think of is to add a conditional statement to the Smarty template for 'edituser.php' so that the 'change password' field is only shown if the user is NOT in the user group 'demo'.


I'm going to differ on this a bit. The limitation is not what is assigned to the group, but which groups users are in. By default, when a user registers, they are added to the Registered Users group and have all rights assigned to that group. If you add the user to another group like 'Demo', that user will have the rights of the Registered Users group and the Demo group.

If you remove that user from the Registered Users group (which you can do), that only leaves them with the rights assigned to the Demo group.

Seehttp://xoops-tips.com/news-article.storyid-37.htm

14
Peekay
Re: Demo user creation
  • 2007/3/5 17:45

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Quote:

skenow wrote:
If you remove that user from the Registered Users group (which you can do), that only leaves them with the rights assigned to the Demo group.

Thx skenow. I must admit... I didn't know you could do that.
A thread is for life. Not just for Christmas.

15
onasre
Re: Demo user creation
  • 2007/3/8 6:08

  • onasre

  • Not too shy to talk

  • Posts: 150

  • Since: 2006/8/12


Quote:

skenow wrote:
Quote:

Peekay wrote:
The rule with XOOPS custom user groups is you can give them more - but not less - than registered users. So you can give a custom group 'Demo' access to a block that ordinary registered users cannot see. However, you cannot hide a block from the 'demo' group without hiding it from the 'registered users' group too.

The second problem is that wherever the demo user's name is shown - e.g. in the 'who's online' block, the user can click the link and edit their profile, including the password.

Best solution I can think of is to add a conditional statement to the Smarty template for 'edituser.php' so that the 'change password' field is only shown if the user is NOT in the user group 'demo'.


I'm going to differ on this a bit. The limitation is not what is assigned to the group, but which groups users are in. By default, when a user registers, they are added to the Registered Users group and have all rights assigned to that group. If you add the user to another group like 'Demo', that user will have the rights of the Registered Users group and the Demo group.

If you remove that user from the Registered Users group (which you can do), that only leaves them with the rights assigned to the Demo group.

Seehttp://xoops-tips.com/news-article.storyid-37.htm


Thats not Soluation , you here just disable a certain user from Registered Group to A demo Group and this not the Quastion .. the Quastion is to make Demo user who can view every thing on the site and wont be able to edit any thing in the site included profile , password , his comment , or posts..

the best think is what the Guys above Said..

1- Creat Demo Groub
2- Edit user Template to Excute the Demo user from some Opition ..

We need some one Hack that Template ,
Whatever Hits You , Never was to Mess you , and Whatever Messed U , Never Was to Hit You.

16
Peekay
Re: Demo user creation
  • 2007/3/8 10:01

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Sorry if that seemed off-topic, but Skenow was just correcting my general comment about the way groups work.

I am recovered and will take a look at hacking the user changeable options ASAP.

If you want to periodically re-set your demo site to clear any test posts etc, you might want to check out jdseymour's articles on 'Backing up MySQL data' and 'Restoring MySQL data' using CRON on:

http://www.warpigw2.com/

I haven't tried setting up CRON to do this, but it seems like a good idea.
A thread is for life. Not just for Christmas.

17
skenow
Re: Demo user creation
  • 2007/3/8 12:34

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


Quote:

skenow wrote in Post #4:
Try this - create a new group 'Demo', assign your demo user to that group and remove them from the Registered Users group. When you set your module/block permissions for the Demo group, do not allow them to view the User Menu block, this will keep them from seeing the Edit Profile link (the page is still accessible by them, just not visible).

If you want to still show them the User Menu, create a custom block (copy the real User Menu) and remove the Edit Account link. Assign this block only to the Demo group and remove it from all other groups.


Group permissions are very useful and quite capable of controlling activity on your site.

If you want more control of your user profile fields, try the Membership module (not Members, Membership) or investigate what is possible with SmartProfiles

18
Peekay
Re: Demo user creation
  • 2007/3/8 15:35

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


@skenow
The primary problem is that the demo user can change the demo user's password. They just click on any link in a forum post or 'who's online' block to see the profile.

I can stop other users from browsing profiles, but not sure how to stop a user from seeing their own.

Thx for the module links. I will take a look to see if either can prohibit this via an admin option, rather than a hack.

Of course, I am assuming that XOOPS will allow several people to be logged in as 'demo'. I think it will, as I have logged in as the same user from different PCs by accident before when testing stuff across a LAN.
A thread is for life. Not just for Christmas.

19
stefan88
Re: Demo user creation
  • 2007/3/8 18:54

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


You can edit 'edituser.php' file in XOOPS root and under

// If not a user, redirect
if (!is_object($xoopsUser)) {
    
redirect_header('index.php',3,_US_NOEDITRIGHT);
    exit();
}


add this:

// DEMO users can't edit account too
if ($xoopsUser->getVar('uname') == 'DEMO') {
    
redirect_header('index.php',3,_US_NOEDITRIGHT);
    exit();
}


where DEMO is your demo account user name. When user try to edit the account, he will get the message he don't have right to do it.

You can replace 'uname' with 'uid' and use the id of the demo account.
..

20
onasre
Re: Demo user creation
  • 2007/3/8 22:56

  • onasre

  • Not too shy to talk

  • Posts: 150

  • Since: 2006/8/12


Quote:

stefan88 wrote:
You can edit 'edituser.php' file in XOOPS root and under

// If not a user, redirect
if (!is_object($xoopsUser)) {
    
redirect_header('index.php',3,_US_NOEDITRIGHT);
    exit();
}


add this:

// DEMO users can't edit account too
if ($xoopsUser->getVar('uname') == 'DEMO') {
    
redirect_header('index.php',3,_US_NOEDITRIGHT);
    exit();
}


where DEMO is your demo account user name. When user try to edit the account, he will get the message he don't have right to do it.

You can replace 'uname' with 'uid' and use the id of the demo account.



You the Man , thats works Just Cool , Thx a lot .

You shoud add this Hack to Module Hacks Forum
Whatever Hits You , Never was to Mess you , and Whatever Messed U , Never Was to Hit You.

Login

Who's Online

239 user(s) are online (160 user(s) are browsing Support Forums)


Members: 0


Guests: 239


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits