This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Module.Profile ... best way to defeat security

Greets,

Question: What is the best way to store user specific custom data fields to be used by php content pages to produce reports, yet not allow the user to change/edit those fields? (Data to be set my admins)

Background:

Desiring to use Drupal to handle php reports (as content) and leverage the Authentication and Menu system. I have installed both "nodeaccess" and "menu by role" and they work great and life was good and then the hero rode off into the sunset.

Then I needed to being able to define "custom fields" in a user profile that can be used by different php reports (content) to limit/expand information in the reports. I turned on the Module.Profile and set some user fields, set access to Private, and accessed them in the reports and they worked great and life was good and then the hero rode off into the sunset.

Then I woke up and realized that the users can themselves change those fields ... then the earth shook and dark clouds formed ... so I set the privs on the fields to "Hidden Profile" and the user was denied access ... Geat! But the PHP Content reports were denied access as well ... Bad :-(

Problems with simple form

Hi,

I'm new to Drupal and I'm looking to create a customized field that can plug into an existing content type. I'm basically trying to set up a list of input field rows with 3 columns and I'm encountering a few problems for little things that seem like they should be simple enough.

I have the following to implement the hook_widget() to build up my form for user editing:

<?php

function ingredients_widget($op, &$node, $field, &$items, $delta = NULL) {
switch ($op) {
case 'form':

$form = array();
$form[$field['field_name']]['#tree'] = TRUE;
$form['#attributes'] = array('class' => 'container-ingredients');
$form['#theme'] = array('ingredients_form_fieldgroup');

$form[$field['field_name']]['value'] = build_ingredient_input_fields();
$form[$field['field_name']]['#title'] = $field['widget']['label'];

return $form;
}
}

function build_ingredient_input_fields() {

$form['ingredients']['quantity'] = array(
'#type' => 'textfield',
'#title' => t('Quantity'),
'#maxlength' => 8,
'#size' => 8,
);

$form['ingredients']['units'] = array(
'#type' => 'select',
'#title' => t('Units'),
'#options' => array(0 => t('option 1'), 1 => t('option 2')),

How to create HIERARCHICAL menu of groups and subGrouops?

Hi,
i'm using the og Groups module, and the related modules (subgroups, block_visibilty), i have à view of the list of groups, but this list don't display an HIERARCHICAL menu of groups:(
Anyone hav a ideia to do that?
thanks

few view / user node questions

question 1.
is the ideal way to create a 'user profile' to just populate a node after registration with the registrations additional fields and then give that node the author of the new user so they can only edit that node?

question 2.
views can be created programmatically correct?

question 3.
views can be executed and have arguments passed via php also?

im still new to drupal thanks for the help guys !

help me createing my module

hi

i'm at dumb point in creating my module, a simple module wich create a node colled structures ( local association structures) for wich i store data such as : region, city, adress, ecc..

i succesfully implemanted

hook_node_info
hook_help
hook_perm
hook_access
hook_menu
hook_link
hook_form
hook_insert
hook_update
hook_delete
hook_load

Module allowing users to only view their own content?

Does anyone know if there are any modules that will allow users to only view content that they have created? I would like something like this to build a site where multiple users create their content on one system, but they are only permissioned to view the content they created. This would mean that things like search and notification are restricted to searching/notifying only their own content as well. I imagine that a system like this would impact many modules, so isn't as straightforward as it may seem.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions