function anonymous_publishing_cl_admin_blocked in Anonymous Publishing 7
Menu callback: Form to manage blocking of anonymous users.
Return value
array $form
1 string reference to 'anonymous_publishing_cl_admin_blocked'
- anonymous_publishing_cl_menu in modules/
cl/ anonymous_publishing_cl.admin.inc - Implements hook_menu().
File
- modules/
cl/ anonymous_publishing_cl.admin.inc, line 463 - Menu callbacks for the CL tabs on the module admin page.
Code
function anonymous_publishing_cl_admin_blocked($form, &$form_state) {
$form = array();
$form['#tree'] = TRUE;
$form['apu_info'] = array(
'#markup' => t('<p>The table below shows the e-mail address used to verify, IP-address, generated alias, blocked status for all <em>verified</em> e-mail addresses. Toggle the checkbox in the “Blocked” column to block or unblock. Check the checkbox in the “Remove” column to to remove entry from this list. Press “Execute” to execute the changes.</p><p>Note than an e-mail address is not listed here until it has been verified. For yet unverified addresses, see the <em>unverified</em> tab.</p>'),
);
// Fetch all emails.
$rows = db_query("SELECT auid, email, alias, ipaddress, blocked FROM {anonymous_publishing_emails} ORDER BY auid DESC")
->fetchAll(PDO::FETCH_ASSOC);
$form['users'] = array();
foreach ($rows as $row) {
$form['users'][$row['auid']] = array();
$form['users'][$row['auid']]['auid'] = array(
'#markup' => $row['auid'],
);
$form['users'][$row['auid']]['email'] = array(
'#markup' => $row['email'],
);
$form['users'][$row['auid']]['ip-address'] = array(
'#markup' => $row['ipaddress'],
);
$form['users'][$row['auid']]['alias'] = array(
'#markup' => check_plain($row['alias']),
);
$form['users'][$row['auid']]['blocked'] = array(
'#type' => 'checkbox',
'#default_value' => $row['blocked'],
);
$form['users'][$row['auid']]['unverify'] = array(
'#type' => 'checkbox',
'#default_value' => FALSE,
);
}
if ($form['users']) {
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Execute'),
);
}
return $form;
}