Skip to Content Skip to Menu

Protect fields plugin

14 years 11 months ago #116888 by Viragolion
Protect fields plugin was created by Viragolion
Hello,

i want to protect three fields on the front-end wich have to be editable by an admin trough the front-end also. I'm looking into the protectfields2 plugin, but when i instal this on CB 1.2.1 i run into an error.

On top of my pages i get:

Save

Apply

Close Community Builder Plugin: Edit [ Protect Fields ]
registerFunction( 'onBeforeUserUpdate','protectFields', 'getProtectFieldsTab' ); /** * Protection Tab Class for handling the CB tab api * @package Community Builder * @author JoomlaJoe and Beat */ class getProtectFieldsTab extends cbTabHandler { /** * Constructor */ function getProtectFieldsTab() { $this->cbTabHandler(); } /** * gets object with name, title and table corresponding to a field id * @access private * @param int fieldId * @returns mixed : either object, or null if no match */ function getFieldInfo($protectFieldId) { global $database; if ($protectFieldId == "0"«») return null; $query = "SELECT `name`,`table`,`title`,`type` FROM #__comprofiler_fields WHERE published=1 AND fieldid=".$protectFieldId; $database->setQuery($query); ...... and a lot more of this.....



PHP version: 5.3.0
Joomla! version: Joomla! 1.5.13 Stable

How can i fix this?
Or isn't this plugin compatible with my current CB version?

Post edited by: Viragolion, at: 2009/11/15 13:48

Post edited by: Viragolion, at: 2009/11/15 13:55

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
14 years 11 months ago #116893 by nant
Replied by nant on topic Re:Protect fields plugin
Well, first of all your PHP version (5.3) is not compatible with the current version of CB (CB 1.2.1).

Please Log in or Create an account to join the conversation.

14 years 11 months ago #116902 by Viragolion
Replied by Viragolion on topic Re:Protect fields plugin
I've just "downgraded" to PHP 5.2.9 and it seems to do the job, partialy. Thank you!

Now i'm getting another error:
Fatal error: Call to a member function setQuery() on a non-object in ...\components\com_comprofiler\plugin\user\plug_protectfields\protectFields.php on line 36

Hopefully there is a fix for this also. thank you all in advance.

Martin

UPDATE:
Setting joomla in legacy mode fixes the error. But now the field is protected in the front-end(like it's supposed to). But also when i log in at the front end as an admin.

Post edited by: Viragolion, at: 2009/11/15 18:39

Please Log in or Create an account to join the conversation.

14 years 11 months ago #117009 by Viragolion
Replied by Viragolion on topic Re:Protect fields plugin
Looks like protectfields isn't going to work.
Any other possibilities to protect certain user profile fields from editing through the front-end depending on an acces level (group)they are in?

I would like to add fields wich only moderators or higher can modify.

Please Log in or Create an account to join the conversation.

  • Iaky
  • Iaky
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
14 years 10 months ago #118860 by Iaky
Replied by Iaky on topic Re:Protect fields plugin
Viragolion wrote:

Now i'm getting another error:
Fatal error: Call to a member function setQuery() on a non-object in ...\components\com_comprofiler\plugin\user\plug_protectfields\protectFields.php on line 36

Hopefully there is a fix for this also. thank you all in advance.

Martin


Hi,

I'm getting the exact same error as you do. I send an email to the developer of the plug-in hopefully he'll have good news, if any i'll post it here just incase someone else has the same issue.

Pd: Yeah, from the little i could understand of the code it seems it blocks all access from front-end, but I can't be sure until tryed.


cya

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum