Source for file pnadmin.php
Documentation is available at pnadmin.php
* Zikula Application Framework
* @copyright (c) 2002, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: pnadmin.php 24342 2008-06-06 12:03:14Z markwest $
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package Zikula_Value_Addons
* the main administration function
* This function is the default function, and is called whenever the
* module is called without defining arguments.
* As such it can be used for a number of things, but most commonly
* it either just shows the module menu and returns or calls whatever
* the module designer feels should be the default function (often this
* is the view() function)
* @return output The main module admin page.
// Security check - important to do this as early as possible to avoid
// potential security holes or just too much wasted processing
* This function shows a form to send an e-mail
* @return output The main module admin page
// Security check - important to do this as early as possible to avoid
// potential security holes or just too much wasted processing
// Get parameters from whatever input we need. All arguments to this
// function should be obtained from FormUtil::getPassedValue(), getting them
// from other places such as the environment is not allowed, as that makes
// assumptions that will not hold in future versions of Zikula
// Admin functions of this type can be called by other modules. If this
// happens then the calling module will be able to pass in arguments to
// this function through the $args parameter. Hence we extract these
// arguments *after* we have obtained any form-based input through
// FormUtil::getPassedValue().
// get the groups from the groups API and process into
// a form useful for the html_options smarty plugin
foreach ($groupsapi as $group) {
$groups[$group['gid']] = $group['name'];
// Create output object - this object will store all of our output so that
// we can return it easily when required
// As Admin output changes often, we do not want caching.
$pnRender->caching = false;
// if we have user id from the input then assign the username
$pnRender->assign('groups', $groups);
return $pnRender->fetch('mailusers_admin_view.htm');
* This function shows a form to send an e-mail
* @todo Move groups table sql to groups API
* @todo Move users table sql to users API
* @return output The main module admin page
// Security check - important to do this as early as possible to avoid
// potential security holes or just too much wasted processing
// Get parameters from whatever input we need. All arguments to this
// function should be obtained from FormUtil::getPassedValue(), getting them
// from other places such as the environment is not allowed, as that makes
// assumptions that will not hold in future versions of Zikula
} elseif ($subject == "") {
} elseif ($message == "") {
if (isset ($perpage)== 0 or $perpage== "") {
if (isset ($startat)== 0 or $startat== "") {
$column = $pntable['users_column'];
if (!isset ($condition) || $condition == '') {
if ($unamecontains != '') {
foreach ($uids as $uid) {
if ($regdateafter != '') {
$condition .= " AND ". $column['user_regdate']. ">UNIX_TIMESTAMP('". DataUtil::formatForStore($regdateafter). "')";
if ($regdatebefore != '') {
$condition .= " AND ". $column['user_regdate']. "<UNIX_TIMESTAMP('". DataUtil::formatForStore($regdatebefore). "')";
$where = $condition . " AND " . $column['uname']. "!='Anonymous'";
$page = $startat/ $perpage+ 1;
$totalpages = ceil($count/ $perpage);
foreach ($users as $userinfo) {
pnMail($rpemail, $subject, $message, "From: \"". $from. "\" <". $rpemail. ">\nBcc: ". $userinfo['email']. "\nX-Mailer: PHP/" . phpversion());
pnModSetVar($modname, 'regdatebefore', $regdatebefore);
* Display form to continue sending mail
* This function shows a form to continue send the e-mail
* when a bulk mail is split to ensure process completes
* @return output The main module admin page
// Security check - important to do this as early as possible to avoid
// potential security holes or just too much wasted processing
if ($page++== $totalpages) {
<form action="'. pnModUrl(pnModGetName(),'admin',dealwithform). '" method="post" name="mailform" id="mailform">
* Utility function to create a hidden form field
* @return output The main module admin page
return '<input name="'. $name. '" type="hidden" id="'. $name. '" value="'. $value. '">';
|