added user export page for simplenews unsubscription
This commit is contained in:
parent
09d1f06552
commit
4c32c73321
@ -22,6 +22,10 @@ function materio_user_permission() {
|
||||
'title' => t('access to online payment'),
|
||||
'description' => t('Access to online payment'),
|
||||
),
|
||||
'access to user export' => array(
|
||||
'title' => t('access to user export'),
|
||||
'description' => t('Access to user export'),
|
||||
),
|
||||
);
|
||||
|
||||
$simplenews_cats = simplenews_category_list();
|
||||
@ -73,6 +77,13 @@ function materio_user_menu(){
|
||||
'access callback' => TRUE,
|
||||
);
|
||||
|
||||
$items['materio_user/export'] = $base+array(
|
||||
'title' => 'Materio base user export',
|
||||
'page callback' => 'materio_user_export',
|
||||
// 'page arguments' => array(),
|
||||
'access arguments' => array('access to user export'),
|
||||
);
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
|
@ -55,4 +55,31 @@ function materio_user_login_submit(){
|
||||
user_login_submit(array(), $form_state);
|
||||
|
||||
drupal_json_output($return);
|
||||
}
|
||||
}
|
||||
|
||||
function materio_user_export(){
|
||||
$query = db_select('users', 'u');
|
||||
$query->join('users_roles', 'ur', 'u.uid=ur.uid');
|
||||
$query->join('simplenews_subscriber', 'ssr', 'u.uid=ssr.uid');
|
||||
$query->join('simplenews_subscription', 'ssn', 'ssr.snid=ssn.snid');
|
||||
$query
|
||||
// ->range(0, 5)
|
||||
->fields('u', array('mail'))
|
||||
->condition('u.status', '1')
|
||||
->condition('ur.rid', '7')
|
||||
->condition('ssn.tid', '6374')
|
||||
->condition('ssn.status', '1');
|
||||
|
||||
$results = $query->execute()->fetchall();
|
||||
|
||||
$vals = array();
|
||||
foreach ($results as $rec) {
|
||||
$vals[] = $rec->mail;
|
||||
}
|
||||
$ret = "Liste des user utilisateur inscrits au daily<br />";
|
||||
$ret .= '<textarea >'.implode($vals, ' ').'</textarea>';
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user