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

Which is the session expiration time of a user logged with user_login_submit?

Hi,
in a custom module (on Drupal7) I'm using an hook_menu that authenticates the user using the function:

$form_state['uid'] = $uid; 
user_login_submit(array(), $form_state); 

If the function is successful then the user is logged into the site.

When the user logs in this way, does the user session expire after a certain period?
Is there a way to change this "expiration time"?

Thank you very much

Claudio

Mailmanager send empty body mail

Hi, i am trying to send a mail programmatically. While the mail should be sent, i get the following error from SMTP authentication module (which is setup correctly):

Error sending e-mail from example@gmail.com to example@gmail.com: Message body empty

The hook_module code:

Is it possible to extend next payment date in moneysuite recurring drupal 7

Is there a way to extend the next payment date for the users who have recurring payment in moneysuite drupal 7. We are using authorize.net for the payments.

Scenario : users have paid for viewing online live event videos. Registered as monthly user. We have blocked live events for avoiding public gathering due to current situation ( corona ). Now next month their amount should not be debited so we have to extend next payment date.

Possibility to add custom fields to section configuration when the layout is defined by another module

This is really about Layout Builder and layouts that are defined by a module. In this case I'm using Layout Discovery to make this example simple.

So I am building a page using Layout Builder and I have selected a layout (provided by the Layout Discovery module) for a section. Now I'd like to add a field to the layouts configuration form (the form where I can select column widths and set administrative title). Maybe I'd like to add something like a background color picker or a text field for an extra class or whatever. 

How to insert custom data from external data source into page content?

Hi there,

I am new to drupal module development.
Please forgive me if the question is too simple.

This question is two fold:
First about strategy: am I going in the right direction?
Second about how to do it... 

How to mock user object to unit test service function that returns user details as an array?

I am new to drupal 8 php unit test. I have written a custom service that will take user id and gives an array of user details. I have tried to unit test this function but getting error on $user->get() function.

Here is my module/custom/common/src/CommonService.php

Pages

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