Log in as other user
Submitted by
Dmitro
on
Without other modules:
$uid = 777;
$form_state = array();
$form_state['uid'] = $uid;
user_login_submit(array(), $form_state);
Without other modules:
$uid = 777;
$form_state = array();
$form_state['uid'] = $uid;
user_login_submit(array(), $form_state);
To delete nodes:
$type = ['invoice'];
$nids = db_select('node', 'n')
->fields('n', array('nid'))
->condition('type', $type, 'IN')
->execute()->fetchCol();
if (!empty($nids)) {
dsm($nids);
node_delete_multiple($nids);
drupal_set_message(t('Deleted %count nodes.', array('%count' => count($nids))));
}
To detele custom entity type: