X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=banana%2Fbanana.inc.php.in;h=ab4e6da386e8e534ade5e994d222a565275da5fb;hb=218e9ec8a45fa38c2265814fa2bae09d88f81730;hp=4bc88267abf5608689340cc5790ef438a07f3345;hpb=73ab762c360a7348f3630d12b18b95ec8345d457;p=banana.git diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index 4bc8826..ab4e6da 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -24,7 +24,10 @@ class Banana var $can_attach = true; /** Maximum allowed file size for attachment */ - var $maxfilesize = 100000; + var $maxfilesize = 100000; + /** Indicate wether x-face should be skinned as specials data or not + */ + var $formatxface = true; /** Regexp for selecting newsgroups to show (if empty, match all newsgroups) * ex : '^xorg\..*' for xorg.* @@ -36,7 +39,20 @@ class Banana var $tmax = 50; var $wrap = 74; + /** Match an url + * Should be included in a regexp delimited using ! (eg: "!$url_regexp!i") + * If it matches, return 3 main parts : + * \\1 and \\3 are delimiters + * \\2 is the url + * + * eg : preg_match("!$url_regexp!i", "[http://www.polytechnique.org]", $matches); + * $matches[1] = "[" + * $matches[2] = "http://www.polytechnique.org" + * $matches[3] = "]" + */ + var $url_regexp = '(["\[])?((?:https?|ftp|news)://(?:&|[a-z@0-9.~%$£µ&i#\-+=_/\?])*)(["\]])?'; + /** Boundary for multipart messages */ var $boundary = 'bananaBoundary42'; @@ -90,7 +106,6 @@ class Banana $banana->state = Array ('group' => $group, 'artid' => $artid); if (is_null($group)) { - if (isset($_GET['subscribe'])) { return $banana->action_listSubs(); } elseif (isset($_POST['subscribe'])) { @@ -108,7 +123,6 @@ class Banana } } else { - if (isset($_POST['action']) && $_POST['action']=='cancel') { $res = $banana->action_cancelArticle($group, $artid); } else { @@ -302,9 +316,11 @@ class Banana $html .= ''._b_('Corps').''; $html .= ''; - $html .= ''._b_('Pièces jointes').''; - $html .= ''; - $html .= ''; + if ($this->can_attach) { + $html .= ''._b_('Pièce jointe').''; + $html .= ''; + $html .= ''; + } $html .= ''; if ($id > 0) { $html .= ''; @@ -342,7 +358,7 @@ class Banana } $body_headers = $this->custom_plain; - $body = wrap($body, "", $this->wrap); + $body = wrap($body, ""); // include attachment in the body $uploaded = $this->_upload('newpj');