xoops forums

markcoleman

Just popping in
Posted on: 2008/2/4 14:22
markcoleman
markcoleman (Show more)
Just popping in
Posts: 4
Since: 2006/9/25
#1

Formulaire NOPERM for anon users

I have 2 different sites doing the same thing. Both are XOOPS 2.0.17 and Formulaire 3.33. I have a contact form set up and when anon users go to fill it out they get a NOPERM message and a redirect to the front page. I have given permissions for the form in Formulaire and access to Formulaire to the Anon group. Any suggestions?

hmorgan

Just popping in
Posted on: 2008/2/7 7:51
hmorgan
hmorgan (Show more)
Just popping in
Posts: 2
Since: 2008/2/7 7
#2

Re: Formulaire NOPERM for anon users

The problem appears to be that the name of the permission specified when the Formulaire system checks for viewing rights is hard coded, and is using the French name for the permission. The quick fix is to change it to the language you are using. For me, that's English. You'll need to make changes to these four files in the formulaire directory:

formulaire.php
index.php
blocks/formulaire_menu.php
blocks/qcm_menu.php

Look for lines that call the checkRight() method like this:

if ( $gperm_handler -> checkRight( 'Droits des categories', ...

Change the Frech permission name to your language, like this for English:

if ( $gperm_handler -> checkRight( 'Permissions of the categories', ...

The long term solution will be to use the language constants instead of hard coding the permission names. The developer has a constant for this, called _AM_CATPERM, but it appears that these files don't currently include the library files. Oh well. Hope this solves the problem for you.

blueteen

Quite a regular
Posted on: 2008/2/7 14:04
blueteen
blueteen (Show more)
Quite a regular
Posts: 379
Since: 2004/7/16
#3

Re: Formulaire NOPERM for anon users

Great hmorgan, you're right

/modules/formulaire/index.php
line 43, change
$perm_name 'Droits des categories';

to
$perm_name 'Permissions of the categories';


/modules/formulaire/formulaire.php
line 120, change
if ( $gperm_handler -> checkRight'Droits des categories'$id$groups$formulaireModule->getVar('mid') ) ) {}

to
if ( $gperm_handler -> checkRight'Permissions of the categories'$id$groups$formulaireModule->getVar('mid') ) ) {}


/modules/formulaire/blocks/qcm_menu.php
line 30, change
if ( $gperm_handler -> checkRight'Droits des categories'$row['id_form'], $groups$formulaireModule->getVar('mid') ) ) {

to
if ( $gperm_handler -> checkRight'Permissions of the categories'$row['id_form'], $groups$formulaireModule->getVar('mid') ) ) {


/modules/formulaire/blocks/formulaire_menu.php
line 30, change
if ( $gperm_handler -> checkRight'Droits des categories'$row['id_form'], $groups$formulaireModule->getVar('mid') ) ) {

to
if ( $gperm_handler -> checkRight'Permissions of the categories'$row['id_form'], $groups$formulaireModule->getVar('mid') ) ) {



After theses change, it seems you need to uninstall the reinstall the module.

I'll contact Philou !

Single

Just popping in
Posted on: 2008/2/8 13:05
Single
Single (Show more)
Just popping in
Posts: 13
Since: 2008/2/8 1
#4

Re: Formulaire NOPERM for anon users

I hade the same problem, i create an anonymous group in the database.

markcoleman

Just popping in
Posted on: 2008/2/9 14:31
markcoleman
markcoleman (Show more)
Just popping in
Posts: 4
Since: 2006/9/25
#5

Re: Formulaire NOPERM for anon users

Great, thanks for the help, I will give it a shot.

voltan

Theme Designer
Posted on: 2008/2/13 17:37
voltan
voltan (Show more)
Theme Designer
Posts: 724
Since: 2006/12/5
#6

Re: Formulaire NOPERM for anon users

I test it . not worked in localhost (by xampp) .
xoops 2.0.18

blueteen

Quite a regular
Posted on: 2008/2/13 18:02
blueteen
blueteen (Show more)
Quite a regular
Posts: 379
Since: 2004/7/16
#7

Re: Formulaire NOPERM for anon users

Did you try uninstall the reinstall ?

markcoleman

Just popping in
Posted on: 2008/2/13 20:15
markcoleman
markcoleman (Show more)
Just popping in
Posts: 4
Since: 2006/9/25
#8

Re: Formulaire NOPERM for anon users

After uninstalling and reinstalling with the four changes it worked fine.

Thanks again.

voltan

Theme Designer
Posted on: 2008/2/15 17:48
voltan
voltan (Show more)
Theme Designer
Posts: 724
Since: 2006/12/5
#9

Re: Formulaire NOPERM for anon users

I uninstall and install again and set permission . an see (( NOPERM )) message again. but when i install module in new XOOPS work nice
xoops : 2.0.18

Daethian

Quite a regular
Posted on: 2008/3/17 14:23
Daethian
Daethian (Show more)
Quite a regular
Posts: 305
Since: 2005/3/4 1
#10

Re: Formulaire NOPERM for anon users

Thanks for the instructions, I was having this problem too!
http://www.artfire.com/daethian
My Artfire store- Vintage Jewelry and New Bead Jewelry