source: branches/1.1dev/lib/Utilities.inc.php @ 62

Last change on this file since 62 was 10, checked in by scdev, 19 years ago

update module_maker to print module variables instead of writing files

File size: 23.2 KB
Line 
1<?php
2/**
3 * Utilities.inc.php
4 * Code by Strangecode :: www.strangecode.com :: This document contains copyrighted information
5 */
6
7
8/**
9 * Print variable dump.
10 *
11 * @param  mixed $var      Variable to dump.
12 * @param  bool  $display   Hide the dump in HTML comments?
13 * @param  bool  $var_dump Use var_dump instead of print_r.
14 */
15function dump($var, $display=false, $var_dump=false)
16{
17    echo $display ? "\n<br /><pre>\n" : "\n\n\n<!--\n";
18    if ($var_dump) {
19        var_dump($var);
20    } else {
21        print_r($var);
22    }
23    echo $display ?  "\n</pre><br />\n" : "\n-->\n\n\n";
24}
25
26/**
27 * Return dump as variable.
28 *
29 * @param  mixed $var      Variable to dump.
30 *
31 * @return string Dump of var.
32 */
33function getDump($var)
34{
35    ob_start();
36    print_r($var);
37    $d = ob_get_contents();
38    ob_end_clean();
39    return $d;
40}
41
42/**
43 * Return dump as cleaned text. Useful for dumping data into emails.
44 *
45 * @param  mixed $var      Variable to dump.
46 *
47 * @return string Dump of var.
48 */
49function fancyDump($var, $indent='')
50{
51    $output = '';
52    if (is_array($var)) {
53        foreach ($var as $k=>$v) {
54            $k = ucfirst(strtolower(str_replace(array('_', '  '), ' ', $k)));
55            if (is_array($v)) {
56                $output .= sprintf("\n%s%s: %s\n", $indent, $k, fancyDump($v, $indent . $indent));
57            } else {
58                $output .= sprintf("%s%s: %s\n", $indent, $k, $v);
59            }
60        }
61    } else {
62        $output .= sprintf("%s%s\n", $indent, $var);
63    }
64    return $output;
65}
66
67/**
68 * Returns text with appropriate html translations.
69 *
70 * @param  string $txt              Text to clean.
71 * @param  bool   $preserve_html    If set to true, oTxt will not translage <, >, ", or '
72 *                                  characters into HTML entities. This allows HTML to pass
73 *                                  through unmunged.
74 *
75 * @return string                   Cleaned text.
76 */
77function oTxt($txt, $preserve_html=false)
78{
79    global $CFG;
80
81    $search = array();
82    $replace = array();
83
84    // Make converted ampersand entities into normal ampersands (they will be done manually later) to retain HTML entities.
85    $search['retain_ampersand']     = '/&amp;/';
86    $replace['retain_ampersand']    = '&';
87
88    if ($preserve_html) {
89        // Convert characters that must remain non-entities for displaying HTML.
90        $search['retain_left_angle']       = '/&lt;/';
91        $replace['retain_left_angle']      = '<';
92       
93        $search['retain_right_angle']      = '/&gt;/';
94        $replace['retain_right_angle']     = '>';
95       
96        $search['retain_single_quote']     = '/&#039;/';
97        $replace['retain_single_quote']    = "'";
98       
99        $search['retain_double_quote']     = '/&quot;/';
100        $replace['retain_double_quote']    = '"';
101    }
102
103    // & becomes &amp;
104    $search['ampersand']        = '/&((?![\w\d#]{1,10};))/';
105    $replace['ampersand']       = '&amp;\\1';
106
107    return preg_replace($search, $replace, htmlentities($txt, ENT_QUOTES, $CFG->character_set));
108}
109
110/**
111 * Returns text with stylistic modifications.
112 *
113 * @param  string   $txt  Text to clean.
114 *
115 * @return string         Cleaned text.
116 */
117function fancyTxt($txt)
118{
119    global $CFG;
120
121    $search = array();
122    $replace = array();
123
124    // "double quoted text"  becomes  &ldquo;double quoted text&rdquo;
125    $search['double_quotes']    = '/(^|[^\w=])(?:"|&quot;|&#34;|&#x22;|&ldquo;)([^"]+?)(?:"|&quot;|&#34;|&#x22;|&rdquo;)([^\w]|$)/'; // " is the same as &quot; and &#34; and &#x22;
126    $replace['double_quotes']   = '\\1&ldquo;\\2&rdquo;\\3';
127
128    // text's apostrophes  become  text&rsquo;s apostrophes
129    $search['apostrophe']       = '/(\w)(?:\'|&#39;)(\w)/';
130    $replace['apostrophe']      = '\\1&rsquo;\\2';
131
132    // "single quoted text"  becomes  &lsquo;single quoted text&rsquo;
133    $search['single_quotes']    = '/(^|[^\w=])(?:\'|&#39;|&lsquo;)([^\']+?)(?:\'|&#39;|&rsquo;)([^\w]|$)/';
134    $replace['single_quotes']   = '\\1&lsquo;\\2&rsquo;\\3';
135   
136    // em--dashes  become em&mdash;dashes
137    $search['em_dash']          = '/(\s*[^!<-])--([^>-]\s*)/';
138    $replace['em_dash']         = '\\1&mdash;\\2';
139   
140    // & becomes &amp;
141    $search['ampersand']        = '/&((?![\w\d#]{1,10};))/';
142    $replace['ampersand']       = '&amp;\\1';
143
144    return preg_replace($search, $replace, $txt);
145}
146
147   
148/**
149 * Generates a hexadecibal html color based on provided word.
150 *
151 * @access public
152 *
153 * @param  string $text  A string for which to convert to color.
154 *
155 * @return string  A hexadecimal html color.
156 */
157function getTextColor($text, $method=1)
158{
159    $r = substr(md5($text), 0, 1);
160    $g = substr(md5($text), 1, 1);
161    $b = substr(md5($text), 2, 1);
162
163    switch ($method) {
164    case 2 :
165        if (hexdec($r) > hexdec('c')) {
166            $r = dechex(hexdec('f') - hexdec($r));
167        }
168        if (hexdec($g) > hexdec('c')) {
169            $g = dechex(hexdec('f') - hexdec($g));
170        }
171        if (hexdec($b) > hexdec('c')) {
172            $b = dechex(hexdec('f') - hexdec($b));
173        }
174        break;
175       
176    case 1 :
177    default :
178        $r = dechex(round(hexdec($r) * .8));
179        $g = dechex(round(hexdec($g) * .8));
180        $b = dechex(round(hexdec($b) * .6));
181        break;
182    }
183
184    return $r . $r . $g . $g . $b . $b;
185}
186
187/**
188 * Encodes a string into unicode values 128-255.
189 * Useful for hiding an email address from spambots.
190 *
191 * @access  public
192 *
193 * @param   string   $text   A line of text to encode.
194 *
195 * @return  string   Encoded text.
196 */
197function encodeAscii($text)
198{
199    $ouput = '';
200    $num = strlen($text);
201    for ($i=0; $i<$num; $i++) {
202        $output .= sprintf('&#%03s', ord($text{$i}));
203    }
204    return $output;
205}
206
207/**
208 * Encodes an email into a user (at) domain (dot) com format.
209 *
210 * @access  public
211 * @param   string   $email   An email to encode.
212 * @param   string   $at      Replaces the @.
213 * @param   string   $dot     Replaces the ..
214 * @return  string   Encoded email.
215 */
216function encodeEmail($email, $at='-at-', $dot='-dot-')
217{
218    $search = array('/@/', '/\./');
219    $replace = array($at, $dot);
220    return preg_replace($search, $replace, $email);
221}
222
223/**
224 * Return a human readable filesize.
225 *
226 * @param       int    $size        Size
227 * @param       int    $unit        The maximum unit
228 * @param       int    $format      The return string format
229 * @author      Aidan Lister <aidan@php.net>
230 * @version     1.1.0
231 */
232function humanFileSize($size, $unit=null, $format='%01.2f %s')
233{
234    // Units
235    $units = array('B', 'KB', 'MB', 'GB', 'TB');
236    $ii = count($units) - 1;
237 
238    // Max unit
239    $unit = array_search((string) $unit, $units);
240    if ($unit === null || $unit === false) {
241        $unit = $ii;
242    }
243 
244    // Loop
245    $i = 0;
246    while ($unit != $i && $size >= 1024 && $i < $ii) {
247        $size /= 1024;
248        $i++;
249    }
250 
251    return sprintf($format, $size, $units[$i]);
252}
253
254/**
255 * If $var is net set or null, set it to $default. Otherwise leave it alone.
256 * Returns the final value of $var. Use to find a default value of one is not avilable.
257 *
258 * @param  mixed $var       The variable that is being set.
259 * @param  mixed $default   What to set it to if $val is not currently set.
260 * @return mixed            The resulting value of $var.
261 */
262function setDefault(&$var, $default='')
263{
264    if (!isset($var)) {
265        $var = $default;
266    }
267    return $var;
268}
269
270/**
271 * Like preg_quote() except for arrays, it takes an array of strings and puts
272 * a backslash in front of every character that is part of the regular
273 * expression syntax.
274 *
275 * @param  array $array    input array
276 * @param  array $delim    optional character that will also be excaped.
277 *
278 * @return array    an array with the same values as $array1 but shuffled
279 */
280function pregQuoteArray($array, $delim='/')
281{
282    if (!empty($array)) {
283        if (is_array($array)) {
284            foreach ($array as $key=>$val) {
285                $quoted_array[$key] = preg_quote($val, $delim);
286            }
287            return $quoted_array;
288        } else {
289            return preg_quote($array, $delim);
290        }
291    }
292}
293
294/**
295 * Converts a PHP Array into encoded URL arguments and return them as an array.
296 *
297 * @param  mixed $data        An array to transverse recursivly, or a string
298 *                            to use directly to create url arguments.
299 * @param  string $prefix     The name of the first dimension of the array.
300 *                            If not specified, the first keys of the array will be used.
301 *
302 * @return array              URL with array elements as URL key=value arguments.
303 */
304function urlEncodeArray($data, $prefix='', $_return=true) {
305   
306    // Data is stored in static variable.
307    static $args;
308   
309    if (is_array($data)) {
310        foreach ($data as $key => $val) {
311            // If the prefix is empty, use the $key as the name of the first dimention of the "array".
312            // ...otherwise, append the key as a new dimention of the "array".
313            $new_prefix = ('' == $prefix) ? urlencode($key) : $prefix . '[' . urlencode($key) . ']';
314            // Enter recursion.
315            urlEncodeArray($val, $new_prefix, false);
316        }
317    } else {
318        // We've come to the last dimention of the array, save the "array" and it's value.
319        $args[$prefix] = urlencode($data);
320    }
321   
322    if ($_return) {
323        // This is not a recursive execution. All recursion is complete.
324        // Reset static var and return the result.
325        $ret = $args;
326        $args = array();
327        return is_array($ret) ? $ret : array();
328    }
329}
330
331/**
332 * Converts a PHP Array into encoded URL arguments and return them in a string.
333 *
334 * @param  mixed $data        An array to transverse recursivly, or a string
335 *                            to use directly to create url arguments.
336 * @param  string $prefix     The name of the first dimention of the array.
337 *                            If not specified, the first keys of the array will be used.
338 *
339 * @return string url         A string ready to append to a url.
340 */
341function urlEncodeArrayToString($data, $prefix='') {
342   
343    $array_args = urlEncodeArray($data, $prefix);
344    $url_args = '';
345    $delim = '';
346    foreach ($array_args as $key=>$val) {
347        $url_args .= $delim . $key . '=' . $val;
348        $delim = ini_get('arg_separator.output');
349    }
350    return $url_args;
351}
352
353/**
354 * An alternative to "shuffle()" that actually works.
355 *
356 * @param  array $array1   input array
357 * @param  array $array2   argument used internally through recursion
358 *
359 * @return array    an array with the same values as $array1 but shuffled
360 */
361function arrayRand(&$array1, $array2 = array())
362{
363    if (!sizeof($array1)) {
364        return array();
365    }
366   
367    srand((double) microtime() * 10000000);
368    $rand = array_rand($array1);
369   
370    $array2[] = $array1[$rand];
371    unset ($array1[$rand]);
372   
373    return $array2 + arrayRand($array1, $array2);
374}
375
376/**
377 * Fills an arrray with the result from a multiple ereg search.
378 * Curtesy of Bruno - rbronosky@mac.com - 10-May-2001
379 * Blame him for the funky do...while loop.
380 *
381 * @param  mixed $pattern   regular expression needle
382 * @param  mixed $string   haystack
383 *
384 * @return array    populated with each found result
385 */
386function eregAll($pattern, $string)
387{
388    do {
389        if (!ereg($pattern, $string, $temp)) {
390             continue;
391        }
392        $string = str_replace($temp[0], '', $string);
393        $results[] = $temp;
394    } while (ereg($pattern, $string, $temp));
395    return $results;
396}
397
398/**
399 * Prints the word "checked" if a variable is set, and optionally matches
400 * the desired value, otherwise prints nothing,
401 * used for printing the word "checked" in a checkbox form input.
402 *
403 * @param  mixed $var     the variable to compare
404 * @param  mixed $value   optional, what to compare with if a specific value is required.
405 */
406function frmChecked($var, $value=null)
407{
408    if (func_num_args() == 1 && $var) {
409        // 'Checked' if var is true.
410        echo ' checked="checked" ';
411    } else if (func_num_args() == 2 && $var == $value) {
412        // 'Checked' if var and value match.
413        echo ' checked="checked" ';
414    } else if (func_num_args() == 2 && is_array($var)) {
415        // 'Checked' if the value is in the key or the value of an array.
416        if (isset($var[$value])) {
417            echo ' checked="checked" ';
418        } else if (in_array($value, $var)) {
419            echo ' checked="checked" ';
420        }
421    }
422}
423
424/**
425 * prints the word "selected" if a variable is set, and optionally matches
426 * the desired value, otherwise prints nothing,
427 * otherwise prints nothing, used for printing the word "checked" in a
428 * select form input
429 *
430 * @param  mixed $var     the variable to compare
431 * @param  mixed $value   optional, what to compare with if a specific value is required.
432 */
433function frmSelected($var, $value=null)
434{
435    if (func_num_args() == 1 && $var) {
436        // 'selected' if var is true.
437        echo ' selected="selected" ';
438    } else if (func_num_args() == 2 && $var == $value) {
439        // 'selected' if var and value match.
440        echo ' selected="selected" ';
441    } else if (func_num_args() == 2 && is_array($var)) {
442        // 'selected' if the value is in the key or the value of an array.
443        if (isset($var[$value])) {
444            echo ' selected="selected" ';
445        } else if (in_array($value, $var)) {
446            echo ' selected="selected" ';
447        }
448    }
449}
450
451/**
452 * Adds slashes to values of an array and converts the array to a
453 * comma delimited list. If value provided is not an array or is empty
454 * return nothing. This is useful for putting values coming in from
455 * posted checkboxes into a SET column of a database.
456 *
457 * @param  array $array   Array to convert.
458 * @return string         Comma list of array values.
459 */
460function dbArrayToList($array)
461{
462    if (is_array($array) && !empty($array)) {
463        return join(',', array_map('addslashes', array_keys($array)));
464    }
465}
466
467/**
468 * Converts a human string date into a SQL-safe date.
469 * Dates nearing infinity use the date 2038-01-01 so conversion to unix time
470 * format remain within valid range.
471 *
472 * @param  array $date     String date to convert.
473 * @param  array $format   Date format to pass to date().
474 *                         Default produces MySQL datetime: 0000-00-00 00:00:00.
475 *
476 * @return string          SQL-safe date.
477 */
478function strToSQLDate($date, $format='Y-m-d H:i:s')
479{
480    // Translate the human string date into SQL-safe date format.
481    if (empty($date) || '0000-00-00' == $date || strtotime($date) === -1) {
482        $sql_date = '0000-00-00';
483    } else {
484        $sql_date = date($format, strtotime($date));
485    }
486   
487    return $sql_date;
488}
489
490/**
491 * If magic_quotes_gpc is in use, run stripslashes() on $var. If $var is an
492 * array, stripslashes is run on each value, recursivly, and the stripped
493 * array is returned
494 *
495 * @param  mixed $var   The string or array to un-quote, if necessary.
496 * @return mixed        $var, minus any magic quotes.
497 */
498function dispelMagicQuotes($var)
499{
500    static $magic_quotes_gpc;
501   
502    if (!isset($magic_quotes_gpc)) {
503        $magic_quotes_gpc = get_magic_quotes_gpc();
504    }
505   
506    if ($magic_quotes_gpc) {
507        if (!is_array($var)) {
508            $var = stripslashes($var);
509        } else {
510            foreach ($var as $key=>$val) {
511                if (is_array($val)) {
512                    $var[$key] = dispelMagicQuotes($val);
513                } else {
514                    $var[$key] = stripslashes($val);
515                }
516            }
517        }
518    }
519    return $var;
520}
521
522/**
523 * Get a form variable from GET or POST data, stripped of magic
524 * quotes if necessary.
525 *
526 * @param string $var (optional) The name of the form variable to look for.
527 * @param string $default (optional) The value to return if the
528 *                                   variable is not there.
529 *
530 * @return mixed      A cleaned GET or POST if no $var specified.
531 * @return string     A cleaned form $var if found, or $default.
532 */
533function getFormData($var=null, $default=null)
534{
535    if ('POST' == $_SERVER['REQUEST_METHOD'] && is_null($var)) {
536        return dispelMagicQuotes($_POST);
537    } else if ('GET' == $_SERVER['REQUEST_METHOD'] && is_null($var)) {
538        return dispelMagicQuotes($_GET);
539    }
540    if (isset($_POST[$var])) {
541        return dispelMagicQuotes($_POST[$var]);
542    } else if (isset($_GET[$var])) {
543        return dispelMagicQuotes($_GET[$var]);
544    } else {
545        return $default;
546    }
547}
548function getPost($var=null, $default=null)
549{
550    if (is_null($var)) {
551        return dispelMagicQuotes($_POST);
552    }
553    if (isset($_POST[$var])) {
554        return dispelMagicQuotes($_POST[$var]);
555    } else {
556        return $default;
557    }
558}
559function getGet($var=null, $default=null)
560{
561    if (is_null($var)) {
562        return dispelMagicQuotes($_GET);
563    }
564    if (isset($_GET[$var])) {
565        return dispelMagicQuotes($_GET[$var]);
566    } else {
567        return $default;
568    }
569}
570
571/**
572 * Signs a value using md5 and a simple text key. In order for this
573 * function to be useful (i.e. secure) the key must be kept secret, which
574 * means keeping it as safe as database credentials. Putting it into an
575 * environment variable set in httpd.conf is a good place.
576 *
577 * @access  public
578 *
579 * @param   string  $val    The string to sign.
580 * @param   string  $key    (Optional) A text key to use for computing the signature.
581 *
582 * @return  string  The original value with a signature appended.
583 */
584function addSignature($val, $key=null)
585{
586    global $CFG;
587   
588    if ('' == $val) {
589        logMsg(sprintf('Adding signature to empty string.', null), LOG_NOTICE, __FILE__, __LINE__);
590    }
591   
592    if (!isset($key)) {
593        $key = $CFG->signing_key;
594    }
595
596    return $val . '-' . substr(md5($val . $key), 0, 18);
597}
598
599/**
600 * Strips off the signature appended by addSignature().
601 *
602 * @access  public
603 *
604 * @param   string  $signed_val     The string to sign.
605 *
606 * @return  string  The original value with a signature removed.
607 */
608function removeSignature($signed_val)
609{
610    return substr($signed_val, 0, strrpos($signed_val, '-'));
611}
612
613
614/**
615 * Verifies a signature appened to a value by addSignature().
616 *
617 * @access  public
618 *
619 * @param   string  $signed_val A value with appended signature.
620 * @param   string  $key        (Optional) A text key to use for computing the signature.
621 *
622 * @return  bool    True if the signature matches the var.
623 */
624function verifySignature($signed_val, $key=null)
625{
626    // Strip the value from the signed value.
627    $val = substr($signed_val, 0, strrpos($signed_val, '-'));
628    // If the signed value matches the original signed value we consider the value safe.
629    if ($signed_val == addSignature($val, $key)) {
630        // Signature verified.
631        return true;
632    } else {
633        return false;
634    }
635}
636
637/**
638 * Stub functions used when installation does not have
639 * GNU gettext extension installed
640 */
641if (!extension_loaded('gettext')) {
642    /**
643    * Translates text
644    *
645    * @access public
646    * @param string $text the text to be translated
647    * @return string translated text
648    */
649    function gettext($text) {
650        return $text;
651    }
652   
653    /**
654    * Translates text
655    *
656    * @access public
657    * @param string $text the text to be translated
658    * @return string translated text
659    */
660    function _($text) {
661        return $text;
662    }
663   
664    /**
665    * Translates text by domain
666    *
667    * @access public
668    * @param string $domain the language to translate the text into
669    * @param string $text the text to be translated
670    * @return string translated text
671    */
672    function dgettext($domain, $text) {
673        return $text;
674    }
675   
676    /**
677    * Translates text by domain and category
678    *
679    * @access public
680    * @param string $domain the language to translate the text into
681    * @param string $text the text to be translated
682    * @param string $category the language dialect to use
683    * @return string translated text
684    */
685    function dcgettext($domain, $text, $category) {
686        return $text;
687    }
688   
689    /**
690    * Binds the text domain
691    *
692    * @access public
693    * @param string $domain the language to translate the text into
694    * @param string
695    * @return string translated text
696    */
697    function bindtextdomain($domain, $directory) {
698        return $domain;
699    }
700   
701    /**
702    * Sets the text domain
703    *
704    * @access public
705    * @param string $domain the language to translate the text into
706    * @return string translated text
707    */
708    function textdomain($domain) {
709        return $domain;
710    }
711}
712
713/**
714 * Sends empty output to the browser and flushes the php buffer so the client
715 * will see data before the page is finished processing.
716 */
717function flushBuffer() {
718    echo str_repeat('          ', 205);
719    flush();
720}
721
722/**
723 * Adds email address to mailman mailing list. Requires /etc/sudoers entry for apache to sudo execute add_members.
724 * Don't forget to allow php_admin_value open_basedir access to "/var/mailman/bin".
725 *
726 * @access  public
727 *
728 * @param   string  $email     Email address to add.
729 * @param   string  $list      Name of list to add to.
730 * @param   bool    $send_welcome_message   True to send welcome message to subscriber.
731 *
732 * @return  bool    True on success, false on failure.
733 */
734function mailmanAddMember($email, $list, $send_welcome_message=false)
735{
736   $add_members = '/var/mailman/bin/add_members';
737    if (is_executable($add_members) && is_readable($add_members)) {
738        $welcome_msg = $send_welcome_message ? 'y' : 'n';
739        exec(sprintf('/bin/echo %s | /usr/bin/sudo %s -r - --welcome-msg=%s --admin-notify=n %s', escapeshellarg($email), escapeshellarg($add_members), $welcome_msg, escapeshellarg($list)), $stdout, $return_code);
740        if (0 == $return_code) {
741            logMsg(sprintf('Mailman add member success for list: %s, user: %s', $list, $email, $stdout), LOG_INFO, __FILE__, __LINE__);
742            return true;
743        } else {
744            logMsg(sprintf('Mailman add member failed for list: %s, user: %s, with message: %s', $list, $email, $stdout), LOG_WARNING, __FILE__, __LINE__);
745            return false;
746        }
747    } else {
748        logMsg(sprintf('Mailman add member program not executable: %s', $add_members), LOG_ALERT, __FILE__, __LINE__);
749        return false;
750    }
751}
752
753/**
754 * Removes email address from mailman mailing list. Requires /etc/sudoers entry for apache to sudo execute add_members.
755 * Don't forget to allow php_admin_value open_basedir access to "/var/mailman/bin".
756 *
757 * @access  public
758 *
759 * @param   string  $email     Email address to add.
760 * @param   string  $list      Name of list to add to.
761 * @param   bool    $send_user_ack   True to send goodbye message to subscriber.
762 *
763 * @return  bool    True on success, false on failure.
764 */
765function mailmanRemoveMember($email, $list, $send_user_ack=false)
766{
767    $remove_members = '/var/mailman/bin/remove_members';
768    if (is_executable($remove_members) && is_readable($remove_members)) {
769        $userack = $send_user_ack ? '' : '--nouserack';
770        exec(sprintf('/usr/bin/sudo %s %s --noadminack %s %s', escapeshellarg($remove_members), $userack, escapeshellarg($list), escapeshellarg($email)), $stdout, $return_code);
771        if (0 == $return_code) {
772            logMsg(sprintf('Mailman remove member success for list: %s, user: %s', $list, $email, $stdout), LOG_INFO, __FILE__, __LINE__);
773            return true;
774        } else {
775            logMsg(sprintf('Mailman remove member failed for list: %s, user: %s, with message: %s', $list, $email, $stdout), LOG_WARNING, __FILE__, __LINE__);
776            return false;
777        }
778    } else {
779        logMsg(sprintf('Mailman remove member program not executable: %s', $remove_members), LOG_ALERT, __FILE__, __LINE__);
780        return false;
781    }
782}
783
784
785
786?>
Note: See TracBrowser for help on using the repository browser.