I have created a new module(under process), that would behave like OG module. I have created a form with my own way like 'newsite_form' not with 'og_form_alter' as in OG.module file.
When I submit the form. It does satisfy the condition as in node.module file...
function node_object_prepare(&$node) {
if (user_access('administer nodes')) {
// Set up default values, if required.
if (!isset($node->created)) {
$node->created = time();
}
if (!isset($node->date)) {
$node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
}
}
node_invoke($node, 'prepare');
node_invoke_nodeapi($node, 'prepare');
}
The line if (user_access('administer nodes')) { is not being satisfied for my module, where I should changed or leave in my module.
If you want to see the form code, that is....
<?php
function newsite_form($form_values = NULL){
global $user;
// $edit = $_POST['edit'];
if (!isset($form_values)) {
$step = 1;
}
drupal_set_message(t($form_values['op']));
drupal_set_message(t($form['id']));
if($form_values['op'] == 'Back') {
$step = $form_values['step'] - 1;
}
if($form_values['op'] == 'Next') {
$step = $form_values['step'] + 1;
}
drupal_set_message(t($step));
drupal_set_message(t($form['#id']));
$form['step'] = array(
'#type' => 'hidden',
i have a configure form for a block, and i'd like one field to be combinationfield or something . the field is a rows of items (with adding/deleting/editing) with a few cols of info. the item itself is like a combination of a text, link, and a weight, which can be filled in in a add/edit form.
I have created a new module that has a form and is submitted. This form submission makes the new registration of the user and makes it login.
In its submission function, if I use the 'drupal_goto('user'./$user->name)', then It keeps the user online but I did not use this and the form is redirected on the new module after submission, the user is not login, then I click on any link and shows the user login but not in new module.
What is essential to use in the new module to keep the user's original status.